govuk_tech_docs 6.4.1.0 → 6.5.1.test
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.
- checksums.yaml +4 -4
- data/.github/workflows/build-middleman-artifact.yaml +1 -1
- data/.github/workflows/check-documentation-updates.yaml +3 -2
- data/.github/workflows/check-gem-version.yaml +1 -1
- data/.github/workflows/pipeline.yaml +1 -1
- data/.github/workflows/publish-gem.yaml +1 -10
- data/.github/workflows/publish-github-pages.yaml +1 -1
- data/.github/workflows/ruby-vulnerability-scanner.yaml +1 -1
- data/.github/workflows/test.yaml +1 -1
- data/CHANGELOG.md +23 -0
- data/README.md +9 -21
- data/documentation/config/tech-docs.yml +14 -3
- data/documentation/source/configure_project/global_configuration/index.html.md.erb +55 -5
- data/documentation/source/maintain_project/use_latest_template/index.html.md.erb +2 -2
- data/documentation/source/publish_project/deploy/index.html.md.erb +6 -6
- data/documentation/source/write_docs/content/index.html.md.erb +18 -2
- data/lib/assets/stylesheets/_govuk_tech_docs.scss +1 -9
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +4 -1
- data/lib/govuk_tech_docs/govuk_nunjuck_componenet_renderer.rb +1 -1
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/govuk_tech_docs/warning_text_extension.rb +1 -1
- data/lib/govuk_tech_docs.rb +1 -4
- data/lib/source/layouts/_govuk_footer.erb +9 -0
- data/lib/source/layouts/_govuk_header.erb +17 -0
- data/lib/source/layouts/_service_navigation.erb +24 -24
- data/lib/source/layouts/core.erb +22 -5
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/package-lock.json +35 -36
- data/package.json +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 240beaeb8112ff43acd05488cefbb968e8b0ff584e9a6fd92726a496a2c1bdb5
|
|
4
|
+
data.tar.gz: 6b1eab16ab7e92142079c50eea9a6e68c7366e088666512dbbbf4f6ea6309e44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 767bbf65cf758fca6ab148518445d05ab6354ca970b497b675bb414802406765827174ae00dc5707f5a8542e2a9d83bdc4b55cfd9f3b6ee881195f303d405dfc
|
|
7
|
+
data.tar.gz: a5f8a9d82dd8e8ae0583bad9a302e4780a9549af0284b2bc10987a01470d523a8fa773e92b288cc045a9f91c95911a69be794c8c9ca478cb0123762489a03e94
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
with:
|
|
24
24
|
node-version-file: 'documentation/.nvmrc'
|
|
25
25
|
- name: Setup Ruby
|
|
26
|
-
uses: ruby/setup-ruby@
|
|
26
|
+
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
27
27
|
with:
|
|
28
28
|
bundler-cache: true
|
|
29
29
|
working-directory: documentation
|
|
@@ -17,15 +17,16 @@ jobs:
|
|
|
17
17
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
18
18
|
with:
|
|
19
19
|
show-progress: false
|
|
20
|
+
fetch-depth: 2
|
|
20
21
|
|
|
21
|
-
- uses: ruby/setup-ruby@
|
|
22
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
22
23
|
with:
|
|
23
24
|
ruby-version: '3'
|
|
24
25
|
|
|
25
26
|
- name: Documentation updated
|
|
26
27
|
id: documentation_updated
|
|
27
28
|
run: |
|
|
28
|
-
if git diff --name-only
|
|
29
|
+
if git diff --name-only HEAD^ HEAD | grep -q '^documentation/'; then
|
|
29
30
|
echo "documentation-updated=true" >> $GITHUB_OUTPUT
|
|
30
31
|
else
|
|
31
32
|
echo "documentation-updated=false" >> $GITHUB_OUTPUT
|
|
@@ -48,7 +48,7 @@ jobs:
|
|
|
48
48
|
|
|
49
49
|
publish-github-pages:
|
|
50
50
|
needs: check-documentation-updates
|
|
51
|
-
if: github.event_name == 'push' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
|
|
51
|
+
if: always() && github.event_name == 'push' && needs.check-documentation-updates.result == 'success' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
|
|
52
52
|
uses: ./.github/workflows/publish-github-pages.yaml
|
|
53
53
|
permissions:
|
|
54
54
|
contents: read
|
|
@@ -35,20 +35,11 @@ jobs:
|
|
|
35
35
|
node-version-file: '.nvmrc'
|
|
36
36
|
cache: 'npm'
|
|
37
37
|
|
|
38
|
-
- uses: ruby/setup-ruby@
|
|
38
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
39
39
|
with:
|
|
40
40
|
ruby-version: '3'
|
|
41
41
|
bundler-cache: true
|
|
42
42
|
|
|
43
|
-
- name: Verify Secret Presence
|
|
44
|
-
run: |
|
|
45
|
-
if [ -z "${{ secrets.RUBYGEMS_API_KEY }}" ]; then
|
|
46
|
-
echo "Error: Secret is empty or missing from this context!"
|
|
47
|
-
exit 1
|
|
48
|
-
else
|
|
49
|
-
echo "Secret is populated."
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
43
|
- name: Publish
|
|
53
44
|
env:
|
|
54
45
|
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
16
16
|
|
|
17
17
|
- name: Setup Ruby
|
|
18
|
-
uses: ruby/setup-ruby@
|
|
18
|
+
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8
|
|
19
19
|
with:
|
|
20
20
|
ruby-version: '3.3'
|
|
21
21
|
bundler-cache: true
|
data/.github/workflows/test.yaml
CHANGED
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
node-version-file: '.nvmrc'
|
|
34
34
|
cache: 'npm'
|
|
35
35
|
|
|
36
|
-
- uses: ruby/setup-ruby@
|
|
36
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
37
37
|
with:
|
|
38
38
|
ruby-version: ${{ matrix.ruby }}
|
|
39
39
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
## Unreleased changes
|
|
2
2
|
|
|
3
|
+
## 6.5.0
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **potentially breaking**: `enable_govuk_components` has been removed from the config as these are now required for the header and footer. If you are using this value for custom code or templates you should address this before updating.
|
|
8
|
+
- added config settings:
|
|
9
|
+
- `product_name`
|
|
10
|
+
- `headerContainerClasses`
|
|
11
|
+
- `headerClasses`
|
|
12
|
+
- `navigationContainerClasses`
|
|
13
|
+
- `navigationClasses`
|
|
14
|
+
|
|
15
|
+
[Check the documentation](https://design-system.service.gov.uk/components/header/) to see if you should add this value into your site.
|
|
16
|
+
|
|
17
|
+
- updated header and footer layouts to use components
|
|
18
|
+
|
|
19
|
+
### Deprecation warning
|
|
20
|
+
|
|
21
|
+
- `show_govuk_logo:` setting will be removed in v7.x.x in to be replaced by the generic header and custom logo settings
|
|
22
|
+
- `warning_text` custom extension will be removed in v7.x.x. This was [marked as deprecated on 1st June 2026](https://github.com/alphagov/tech-docs-gem/commit/304230ba9c49759471a9a8f2daa425e37f846364#diff-2a7ef696e418f6044e5b18ae22c9cff4cac18481ae6fd0c1360ef978087b6cc9R8-R9). You should now [use the GOV.UK warning text component](https://alphagov.github.io/tech-docs-gem/write_docs/content/#use-the-gov-uk-design-system).
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
3
26
|
## 6.4.1
|
|
4
27
|
|
|
5
28
|
- Bugfix: [Issue 283](https://github.com/alphagov/tech-docs-gem/issues/283) - correctly read report issue url (backwards compatible)
|
data/README.md
CHANGED
|
@@ -159,38 +159,26 @@ refer to this [list of possible fixes](#issue-with-ffi-on-osx-mohave).
|
|
|
159
159
|
For more information on previewing your documentation locally, see
|
|
160
160
|
the [Tech Docs template documentation on previewing your documentation](https://alphagov.github.io/tech-docs-gem/create_project/preview/#preview-your-documentation).
|
|
161
161
|
|
|
162
|
-
## Tests
|
|
163
162
|
|
|
164
|
-
|
|
163
|
+
## Linting
|
|
165
164
|
|
|
166
|
-
You
|
|
167
|
-
|
|
168
|
-
```shell
|
|
169
|
-
bundle exec rake spec
|
|
170
|
-
```
|
|
165
|
+
You should run the linter before pushing any changes to GitHub to check for errors and correct formatting. You can run linter jobs for ruby by running `bundle exec rubocop`. If you would like the linter to try and automatically fix any errors use `bundle exec rubocop -a`.
|
|
171
166
|
|
|
172
|
-
|
|
167
|
+
You can lint javascript files with the command `npm run lint`. If only want to see the final result and not the full output, use `npm run lint --silent`.
|
|
173
168
|
|
|
174
|
-
You can
|
|
169
|
+
You can also use the `Rakefile` job to run both together by running `bundle exec rake lint`. See the [Rakefile](./Rakefile) for more detail.
|
|
175
170
|
|
|
176
|
-
|
|
177
|
-
bundle exec rubocop
|
|
178
|
-
```
|
|
171
|
+
### Ruby tests
|
|
179
172
|
|
|
180
|
-
|
|
181
|
-
with:
|
|
173
|
+
You can run the Ruby test suite with the following command:
|
|
182
174
|
|
|
183
175
|
```shell
|
|
184
|
-
bundle exec
|
|
176
|
+
bundle exec rake spec
|
|
185
177
|
```
|
|
186
178
|
|
|
187
|
-
|
|
179
|
+
To test a specific file, use Rake's `SPEC` variable and set it to your filepath or directory. For example `bundle exec rake spec SPEC=spec/govuk_tech_docs/meta_tags_spec.rb`
|
|
188
180
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
```sh
|
|
192
|
-
bundle exec rake
|
|
193
|
-
```
|
|
181
|
+
### JavaScript tests
|
|
194
182
|
|
|
195
183
|
The JavaScript tests use the [Jasmine test framework][jas].
|
|
196
184
|
|
|
@@ -3,14 +3,25 @@ host: https://alphagov.github.io/tech-docs-gem
|
|
|
3
3
|
|
|
4
4
|
# Header-related options
|
|
5
5
|
show_govuk_logo: false
|
|
6
|
+
product_name:
|
|
6
7
|
service_name: Tech docs template
|
|
7
8
|
service_link: https://alphagov.github.io/tech-docs-gem
|
|
8
9
|
phase: Beta
|
|
9
10
|
|
|
10
|
-
# Uncomment if you do not want to activate the GOV.UK Design System component extension
|
|
11
|
-
enable_govuk_components: true
|
|
12
11
|
|
|
13
|
-
#
|
|
12
|
+
#These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
|
|
13
|
+
#https://design-system.service.gov.uk/components/header/
|
|
14
|
+
#https://design-system.service.gov.uk/components/service-navigation/
|
|
15
|
+
#https://design-system.service.gov.uk/components/footer/
|
|
16
|
+
|
|
17
|
+
headerContainerClasses:
|
|
18
|
+
headerClasses:
|
|
19
|
+
navigationContainerClasses:
|
|
20
|
+
navigationClasses:
|
|
21
|
+
footerContainerClasses:
|
|
22
|
+
footerClasses:
|
|
23
|
+
|
|
24
|
+
# Links to show on service navigation below header
|
|
14
25
|
header_links:
|
|
15
26
|
Template: https://github.com/alphagov/tech-docs-template
|
|
16
27
|
Ruby gem: https://github.com/alphagov/tech-docs-gem
|
|
@@ -16,13 +16,23 @@ When you create your documentation project, the template creates a `tech-docs.ym
|
|
|
16
16
|
host:
|
|
17
17
|
|
|
18
18
|
# Header-related options
|
|
19
|
+
product_name: GOV.UK Product
|
|
19
20
|
show_govuk_logo: true
|
|
20
21
|
service_name: My First Service
|
|
21
22
|
service_link: https://www.larry-the-cat.service.gov.uk
|
|
22
23
|
phase: Beta
|
|
23
24
|
|
|
24
|
-
#
|
|
25
|
-
#
|
|
25
|
+
#These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
|
|
26
|
+
#https://design-system.service.gov.uk/components/header/
|
|
27
|
+
#https://design-system.service.gov.uk/components/service-navigation/
|
|
28
|
+
#https://design-system.service.gov.uk/components/footer/
|
|
29
|
+
|
|
30
|
+
headerContainerClasses:
|
|
31
|
+
headerClasses:
|
|
32
|
+
navigationContainerClasses:
|
|
33
|
+
navigationClasses:
|
|
34
|
+
footerContainerClasses:
|
|
35
|
+
footerClasses:
|
|
26
36
|
|
|
27
37
|
# Links to show on right-hand-side of header
|
|
28
38
|
header_links:
|
|
@@ -56,7 +66,7 @@ github_repo: alphagov/YOUR_REPO
|
|
|
56
66
|
github_branch: main
|
|
57
67
|
```
|
|
58
68
|
|
|
59
|
-
<%=
|
|
69
|
+
<%= govukWarningText({text: "All of these settings are optional. However, you should enable or disable settings to increase the usability of your documentation or because of best practice.", iconFallbackText: "Warning"}) %>
|
|
60
70
|
|
|
61
71
|
You must wrap a value in quotes if it contains a colon, unless the value is a URL. For example:
|
|
62
72
|
|
|
@@ -88,6 +98,18 @@ Enables and disables the GOV.UK crown logo in the top left corner of the site. D
|
|
|
88
98
|
show_govuk_logo: true
|
|
89
99
|
```
|
|
90
100
|
|
|
101
|
+
<%= govukWarningText({text: "This setting is deprecated and will be replaced in version 7 by the generic header and custom logo options.", iconFallbackText: "Warning"}) %>
|
|
102
|
+
|
|
103
|
+
### product_name
|
|
104
|
+
|
|
105
|
+
Used for the `productName` value in the [GOV.UK header component](https://design-system.service.gov.uk/components/header/). It is used when the product name follows on directly from ‘GOV.UK’. For example, GOV.UK Pay or GOV.UK Design System. In most circumstances, you should use the Service navigation component.
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
product_name: "Great new product"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
91
113
|
### service_name
|
|
92
114
|
|
|
93
115
|
Defines the service name in the header. Defaults to "My First Service" if you do not define it when creating your project.
|
|
@@ -112,7 +134,35 @@ Defines the phase of the service that the documentation is attached to. Defaults
|
|
|
112
134
|
phase: "Beta"
|
|
113
135
|
```
|
|
114
136
|
|
|
115
|
-
###
|
|
137
|
+
### Header and footer custom styles
|
|
138
|
+
|
|
139
|
+
If you have set `show_gouk_logo` to `true`, the header, service navigation and footer will use GOV.UK components.
|
|
140
|
+
|
|
141
|
+
#### Container classes
|
|
142
|
+
|
|
143
|
+
Classes for the container, useful if you want to make the header fixed width. The container settings you can configure are:
|
|
144
|
+
|
|
145
|
+
- `headerContainerClasses:`
|
|
146
|
+
- `navigationContainerClasses:`
|
|
147
|
+
- `footerContainerClasses:`
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
headerContainerClasses: "my-custom-container-style my-additional-styles"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
You can add custom classes to the components in the same way. The settings you can configure are:
|
|
154
|
+
|
|
155
|
+
- `headerClasses:`
|
|
156
|
+
- `navigationClasses:`
|
|
157
|
+
- `footerClasses:`
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
footerClasses: "my-custom-footer-style"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
There is more detail on the [GOV.UK Design System](https://design-system.service.gov.uk/components) documentation site.
|
|
164
|
+
|
|
165
|
+
### Govuk components
|
|
116
166
|
|
|
117
167
|
The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Design System components](https://design-system.service.gov.uk/components). You can include these in your content by creating a `ruby` codeblock, and calling the component as described in the GOV.UK Design System documentation. For example, you can include a [GOV.UK Button](https://design-system.service.gov.uk/components/button/):
|
|
118
168
|
|
|
@@ -123,7 +173,7 @@ The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Desi
|
|
|
123
173
|
This would be a short introduction, but now we need a button!
|
|
124
174
|
|
|
125
175
|
|
|
126
|
-
|
|
176
|
+
<%= govukButton({
|
|
127
177
|
text: "Click me!"
|
|
128
178
|
}) %>
|
|
129
179
|
|
|
@@ -23,8 +23,8 @@ Fetching gem metadata from https://rubygems.org/.............
|
|
|
23
23
|
Fetching gem metadata from https://rubygems.org/.
|
|
24
24
|
Resolving dependencies.......
|
|
25
25
|
<...>
|
|
26
|
-
Fetching govuk_tech_docs
|
|
27
|
-
Installing govuk_tech_docs
|
|
26
|
+
Fetching govuk_tech_docs 6.5.0 (was 6.4.1.0)
|
|
27
|
+
Installing govuk_tech_docs 6.5.0 (was 6.4.1.0)
|
|
28
28
|
<...>
|
|
29
29
|
Bundle updated!
|
|
30
30
|
```
|
|
@@ -29,16 +29,16 @@ This method relies on adding a `Staticfile.auth` file to the `build` folder beca
|
|
|
29
29
|
|
|
30
30
|
1. In the command line, navigate to your local documentation repo.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
2. If required, run `bundle exec middleman build` to create a `build` folder.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
3. Create a new `Staticfile.auth` file in the `build` folder.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
4. Go to the [Htpasswd Generator].
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
5. Complete the __Username__ and __Password__ fields, and select __Create .htpasswd file__.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
6. Copy the generated username and password hash into the `Staticfile.auth` file and save.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
7. Deploy your documentation site in line with your normal process.
|
|
43
43
|
|
|
44
44
|
<%= partial "partials/links" %>
|
|
@@ -110,6 +110,8 @@ You must include alt text for an image if the image has not been explained in su
|
|
|
110
110
|
|
|
111
111
|
## Insert a warning
|
|
112
112
|
|
|
113
|
+
<%= govukWarningText({text: "This setting is deprecated and will be removed in version 7. You should use the GOV.UK warning text component.", iconFallbackText: "Warning"}) %>
|
|
114
|
+
|
|
113
115
|
Use the warning text component when you need to warn users about something important, such as legal consequences of an action, or lack of action, that they might take.
|
|
114
116
|
|
|
115
117
|
This warning text format is consistent with the [GOV.UK Design System warning text][design-system].
|
|
@@ -117,12 +119,26 @@ This warning text format is consistent with the [GOV.UK Design System warning te
|
|
|
117
119
|
To insert a warning, use the following:
|
|
118
120
|
|
|
119
121
|
```ruby
|
|
120
|
-
|
|
122
|
+
<%= warning_text('insert warning text here') %>
|
|
121
123
|
```
|
|
122
124
|
|
|
125
|
+
|
|
123
126
|
## Use the GOV.UK Design System
|
|
124
127
|
|
|
125
|
-
Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations.
|
|
128
|
+
Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations. To use a component from the design system call the component function inside a ruby block. For example:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
<%=
|
|
132
|
+
govukPhaseBanner({
|
|
133
|
+
tag: {
|
|
134
|
+
text: "Alpha"
|
|
135
|
+
},
|
|
136
|
+
html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.'
|
|
137
|
+
})
|
|
138
|
+
%>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You do not need to import the function using `from "govuk/components/{COMPONENT_NAME}/macro.njk" import {COMPONENT_NAME}`. The extension will do this automatically.
|
|
126
142
|
|
|
127
143
|
|
|
128
144
|
<%= partial "partials/links" %>
|
|
@@ -14,15 +14,7 @@ $govuk-new-link-styles: true;
|
|
|
14
14
|
@import "govuk/core";
|
|
15
15
|
@import "govuk/objects";
|
|
16
16
|
|
|
17
|
-
@import "govuk/components
|
|
18
|
-
@import "govuk/components/footer";
|
|
19
|
-
@import "govuk/components/header";
|
|
20
|
-
@import "govuk/components/service-navigation";
|
|
21
|
-
@import "govuk/components/inset-text";
|
|
22
|
-
@import "govuk/components/input";
|
|
23
|
-
@import "govuk/components/tag";
|
|
24
|
-
@import "govuk/components/skip-link";
|
|
25
|
-
@import "govuk/components/warning-text";
|
|
17
|
+
@import "govuk/components";
|
|
26
18
|
|
|
27
19
|
@import "govuk/utilities";
|
|
28
20
|
@import "govuk/overrides";
|
|
@@ -36,7 +36,7 @@ module GovukTechDocs
|
|
|
36
36
|
render_nunjucks_template(nunjucks_template_string, { "template_data" => template_data }, search_paths)
|
|
37
37
|
# rubocop:disable Lint/UselessAssignment
|
|
38
38
|
rescue StandardError => e
|
|
39
|
-
raise "Could not load GOV.UK component #{component_name} with data #{template_data}."
|
|
39
|
+
raise "Could not load GOV.UK component #{component_name} with data #{template_data}. Called with #{nunjucks_template_string}"
|
|
40
40
|
end
|
|
41
41
|
# rubocop:enable Lint/UselessAssignment
|
|
42
42
|
end
|
|
@@ -5,8 +5,8 @@ module GovukTechDocs
|
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
helpers do
|
|
8
|
-
warn("This functionality is deprecated and will be removed in a future release. \n You should use the GOV.UK warning text component instead.")
|
|
9
8
|
def warning_text(text)
|
|
9
|
+
warn("The `warning_text` function will be removed in version 7. You should use the GOV.UK warning text component instead.")
|
|
10
10
|
<<~EOS
|
|
11
11
|
<div class="govuk-warning-text">
|
|
12
12
|
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
|
data/lib/govuk_tech_docs.rb
CHANGED
|
@@ -84,6 +84,7 @@ module GovukTechDocs
|
|
|
84
84
|
context.activate :unique_identifier
|
|
85
85
|
context.activate :warning_text
|
|
86
86
|
context.activate :api_reference
|
|
87
|
+
context.activate :custom_method_missing_handler
|
|
87
88
|
|
|
88
89
|
context.helpers do
|
|
89
90
|
include GovukTechDocs::PathHelpers
|
|
@@ -164,9 +165,5 @@ module GovukTechDocs
|
|
|
164
165
|
else
|
|
165
166
|
context.ignore "search/*"
|
|
166
167
|
end
|
|
167
|
-
|
|
168
|
-
if context.config[:tech_docs][:enable_govuk_components]
|
|
169
|
-
context.activate :custom_method_missing_handler
|
|
170
|
-
end
|
|
171
168
|
end
|
|
172
169
|
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<%=
|
|
2
|
+
|
|
3
|
+
govukFooter({
|
|
4
|
+
containerClasses: config[:tech_docs][:footerContainerClasses] ? config[:tech_docs][:footerContainerClasses] : "govuk-footer__container--full-width",
|
|
5
|
+
classes: config[:tech_docs][:footerClasses] ? config[:tech_docs][:footerClasses] : "",
|
|
6
|
+
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
%>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%
|
|
2
|
+
service_link = config[:tech_docs][:service_link]
|
|
3
|
+
homepage_url = service_link ? get_path_to_resource(config, service_link, current_page) : nil
|
|
4
|
+
|
|
5
|
+
%>
|
|
6
|
+
|
|
7
|
+
<%=
|
|
8
|
+
|
|
9
|
+
govukHeader({
|
|
10
|
+
homepageUrl: homepage_url || "",
|
|
11
|
+
productName: config[:tech_docs][:product_name] ? config[:tech_docs][:product_name] : "",
|
|
12
|
+
containerClasses: config[:tech_docs][:headerContainerClasses] ? config[:tech_docs][:headerContainerClasses] : "govuk-header__container--full-width",
|
|
13
|
+
classes: config[:tech_docs][:headerClasses] ? config[:tech_docs][:headerClasses] : ""
|
|
14
|
+
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
%>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
<%
|
|
2
|
+
|
|
3
|
+
navigation = []
|
|
4
|
+
config[:tech_docs][:header_links].each do |title, path|
|
|
5
|
+
url = get_path_to_resource config, path, current_page
|
|
6
|
+
navigation.append << {
|
|
7
|
+
href: url,
|
|
8
|
+
text: title,
|
|
9
|
+
active: active_page(path)
|
|
10
|
+
}
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
%>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<%=
|
|
17
|
+
govukServiceNavigation({
|
|
18
|
+
navigation: navigation,
|
|
19
|
+
serviceUrl: config[:tech_docs][:service_link] ,
|
|
20
|
+
serviceName: config[:tech_docs][:service_name],
|
|
21
|
+
navigationClasses: config[:tech_docs][:navigationContainerClasses] ? config[:tech_docs][:navigationContainerClasses] : "",
|
|
22
|
+
classes: config[:tech_docs][:navigationClasses] ? config[:tech_docs][:navigationClasses] : ""
|
|
23
|
+
})
|
|
24
|
+
%>
|
data/lib/source/layouts/core.erb
CHANGED
|
@@ -50,9 +50,23 @@
|
|
|
50
50
|
|
|
51
51
|
<body class="govuk-template__body">
|
|
52
52
|
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<!-- .app-header aligns the header component properly with the in page navigation -->
|
|
54
|
+
<div class="app-header" role="banner" data-module="govuk-header">
|
|
55
|
+
<% if config[:tech_docs][:show_govuk_logo] %>
|
|
56
|
+
<%= partial 'layouts/govuk_header' %>
|
|
57
|
+
<% else %>
|
|
58
|
+
<%=
|
|
59
|
+
# if show govuk_logo is true we can just use the govuk component.
|
|
60
|
+
# If not we need to fall back temporarily to the old custom header to make sure we don't start
|
|
61
|
+
# showing logos everywhere, as there is no option in the component to turn it off. This will be removed once the generic header and branding is in place.
|
|
62
|
+
# We will raise a deprecation warning to let people know this is imminent
|
|
63
|
+
warn("You have set show_govuk_logo to false or removed it from your config. This setting wil be removed in version 7 to be replaced by the generic header and custom logo. If you rely on this setting for custom code you should review this as soon as possible.")
|
|
64
|
+
%>
|
|
65
|
+
<%= partial 'layouts/header' %>
|
|
66
|
+
<% end %>
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
|
|
56
70
|
<% if config[:tech_docs][:header_links] %>
|
|
57
71
|
<%= partial 'layouts/service_navigation' %>
|
|
58
72
|
<% end %>
|
|
@@ -102,9 +116,12 @@
|
|
|
102
116
|
</div>
|
|
103
117
|
</div>
|
|
104
118
|
|
|
105
|
-
|
|
106
119
|
<footer class="govuk-template__footer">
|
|
107
|
-
|
|
120
|
+
<% if config[:tech_docs][:show_govuk_logo] %>
|
|
121
|
+
<%= partial "layouts/govuk_footer" %>
|
|
122
|
+
<% else %>
|
|
123
|
+
<%= partial "layouts/footer" %>
|
|
124
|
+
<% end %>
|
|
108
125
|
</footer>
|
|
109
126
|
|
|
110
127
|
<%= partial 'layouts/analytics' %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
const version = '6.5.
|
|
7
|
+
const version = '6.5.0';
|
|
8
8
|
|
|
9
9
|
function getBreakpoint(name) {
|
|
10
10
|
const property = `--govuk-breakpoint-${name}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const version="6.5.1";function getBreakpoint(t){const e=`--govuk-breakpoint-${t}`;return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}function setFocus(t,e={}){var i;const n=t.getAttribute("tabindex");function onBlur(){var i;null==(i=e.onBlur)||i.call(t),n||t.removeAttribute("tabindex")}n||t.setAttribute("tabindex","-1"),t.addEventListener("focus",(function(){t.addEventListener("blur",onBlur,{once:!0})}),{once:!0}),null==(i=e.onBeforeFocus)||i.call(t),t.focus()}function isSupported(t=document.body){return!!t&&t.classList.contains("govuk-frontend-supported")}function isObject(t){return!!t&&"object"==typeof t&&!function(t){return Array.isArray(t)}(t)}function isScope(t){return!!t&&(t instanceof Element||t instanceof Document)}function formatErrorMessage(Component,t){return`${Component.moduleName}: ${t}`}class GOVUKFrontendError extends Error{constructor(...t){super(...t),this.name="GOVUKFrontendError"}}class SupportError extends GOVUKFrontendError{constructor(t=document.body){const e="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(t?e:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class ConfigError extends GOVUKFrontendError{constructor(...t){super(...t),this.name="ConfigError"}}class ElementError extends GOVUKFrontendError{constructor(t){let e="string"==typeof t?t:"";if(isObject(t)){const{component:i,identifier:n,element:s,expectedType:o}=t;e=n,e+=s?` is not of type ${null!=o?o:"HTMLElement"}`:" not found",i&&(e=formatErrorMessage(i,e))}super(e),this.name="ElementError"}}class InitError extends GOVUKFrontendError{constructor(t){super("string"==typeof t?t:formatErrorMessage(t,"Root element (`$root`) already initialised")),this.name="InitError"}}class Component{get $root(){return this._$root}constructor(t){this._$root=void 0;const e=this.constructor;if("string"!=typeof e.moduleName)throw new InitError("`moduleName` not defined in component");if(!(t instanceof e.elementType))throw new ElementError({element:t,component:e,identifier:"Root element (`$root`)",expectedType:e.elementType.name});this._$root=t,e.checkSupport(),this.checkInitialised();const i=e.moduleName;this.$root.setAttribute(`data-${i}-init`,"")}checkInitialised(){const t=this.constructor,e=t.moduleName;if(e&&function(t,e){return t instanceof HTMLElement&&t.hasAttribute(`data-${e}-init`)}(this.$root,e))throw new InitError(t)}static checkSupport(){if(!isSupported())throw new SupportError}}Component.elementType=HTMLElement;const t=Symbol.for("configOverride");class ConfigurableComponent extends Component{[t](t){return{}}get config(){return this._config}constructor(e,i){super(e),this._config=void 0;const n=this.constructor;if(!isObject(n.defaults))throw new ConfigError(formatErrorMessage(n,"Config passed as parameter into constructor but no defaults defined"));const s=function(Component,t){if(!isObject(Component.schema))throw new ConfigError(formatErrorMessage(Component,"Config passed as parameter into constructor but no schema defined"));const e={},i=Object.entries(Component.schema.properties);for(const n of i){const[i,s]=n,o=i.toString();o in t&&(e[o]=normaliseString(t[o],s)),"object"===(null==s?void 0:s.type)&&(e[o]=extractConfigByNamespace(Component.schema,t,i))}return e}(n,this._$root.dataset);this._config=mergeConfigs(n.defaults,null!=i?i:{},this[t](s),s)}}function normaliseString(t,e){const i=t?t.trim():"";let n,s=null==e?void 0:e.type;switch(s||(["true","false"].includes(i)&&(s="boolean"),i.length>0&&isFinite(Number(i))&&(s="number")),s){case"boolean":n="true"===i;break;case"number":n=Number(i);break;default:n=t}return n}function normaliseOptions(t){let e,i=document;if(isObject(t)){const n=t;(isScope(n.scope)||null===n.scope)&&(i=n.scope),"function"==typeof n.onError&&(e=n.onError)}return isScope(t)?i=t:null===t?i=null:"function"==typeof t&&(e=t),{scope:i,onError:e}}function mergeConfigs(...t){const e={};for(const i of t)for(const t of Object.keys(i)){const n=e[t],s=i[t];isObject(n)&&isObject(s)?e[t]=mergeConfigs(n,s):e[t]=s}return e}function extractConfigByNamespace(t,e,i){const n=t.properties[i];if("object"!==(null==n?void 0:n.type))return;const s={[i]:{}};for(const[o,r]of Object.entries(e)){let t=s;const e=o.split(".");for(const[n,s]of e.entries())isObject(t)&&(n<e.length-1?(isObject(t[s])||(t[s]={}),t=t[s]):o!==i&&(t[s]=normaliseString(r)))}return s[i]}class I18n{constructor(t={},e={}){var i;this.translations=void 0,this.locale=void 0,this.translations=t,this.locale=null!=(i=e.locale)?i:document.documentElement.lang||"en"}t(t,e){if(!t)throw new Error("i18n: lookup key missing");let i=this.translations[t];if("number"==typeof(null==e?void 0:e.count)&&isObject(i)){const n=i[this.getPluralSuffix(t,e.count)];n&&(i=n)}if("string"==typeof i){if(i.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(i,e)}return i}return t}replacePlaceholders(t,e){const i=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return t.replace(/%{(.\S+)}/g,(function(t,n){if(Object.prototype.hasOwnProperty.call(e,n)){const t=e[n];return!1===t||"number"!=typeof t&&"string"!=typeof t?"":"number"==typeof t?i?i.format(t):`${t}`:t}throw new Error(`i18n: no data found to replace ${t} placeholder in string`)}))}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(t,e){if(e=Number(e),!isFinite(e))return"other";const i=this.translations[t],n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):"other";if(isObject(i)){if(n in i)return n;if("other"in i)return console.warn(`i18n: Missing plural form ".${n}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class Accordion extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=void 0,this.$showAllButton=null,this.$showAllIcon=null,this.$showAllText=null,this.i18n=new I18n(this.config.i18n);const i=this.$root.querySelectorAll(`.${this.sectionClass}`);if(!i.length)throw new ElementError({component:Accordion,identifier:`Sections (\`<div class="${this.sectionClass}">\`)`});this.$sections=i,this.initControls(),this.initSectionHeaders(),this.updateShowAllButton(this.areAllSectionsOpen())}initControls(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);const t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$root.insertBefore(t,this.$root.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",(()=>this.onShowOrHideAllToggle())),"onbeforematch"in document&&document.addEventListener("beforematch",(t=>this.onBeforeMatch(t)))}initSectionHeaders(){this.$sections.forEach(((t,e)=>{const i=t.querySelector(`.${this.sectionHeaderClass}`);if(!i)throw new ElementError({component:Accordion,identifier:`Section headers (\`<div class="${this.sectionHeaderClass}">\`)`});this.constructHeaderMarkup(i,e),this.setExpanded(this.isExpanded(t),t),i.addEventListener("click",(()=>this.onSectionToggle(t))),this.setInitialState(t)}))}constructHeaderMarkup(t,e){const i=t.querySelector(`.${this.sectionButtonClass}`),n=t.querySelector(`.${this.sectionHeadingClass}`),s=t.querySelector(`.${this.sectionSummaryClass}`);if(!n)throw new ElementError({component:Accordion,identifier:`Section heading (\`.${this.sectionHeadingClass}\`)`});if(!i)throw new ElementError({component:Accordion,identifier:`Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`});const o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("aria-controls",`${this.$root.id}-content-${e+1}`);for(const d of Array.from(i.attributes))"id"!==d.name&&o.setAttribute(d.name,d.value);const r=document.createElement("span");r.classList.add(this.sectionHeadingTextClass),r.id=i.id;const a=document.createElement("span");a.classList.add(this.sectionHeadingTextFocusClass),r.appendChild(a),Array.from(i.childNodes).forEach((t=>a.appendChild(t)));const l=document.createElement("span");l.classList.add(this.sectionShowHideToggleClass),l.setAttribute("data-nosnippet","");const c=document.createElement("span");c.classList.add(this.sectionShowHideToggleFocusClass),l.appendChild(c);const u=document.createElement("span"),h=document.createElement("span");if(h.classList.add(this.upChevronIconClass),c.appendChild(h),u.classList.add(this.sectionShowHideTextClass),c.appendChild(u),o.appendChild(r),o.appendChild(this.getButtonPunctuationEl()),s){const t=document.createElement("span"),e=document.createElement("span");e.classList.add(this.sectionSummaryFocusClass),t.appendChild(e);for(const i of Array.from(s.attributes))t.setAttribute(i.name,i.value);Array.from(s.childNodes).forEach((t=>e.appendChild(t))),s.remove(),o.appendChild(t),o.appendChild(this.getButtonPunctuationEl())}o.appendChild(l),n.removeChild(i),n.appendChild(o)}onBeforeMatch(t){const e=t.target;if(!(e instanceof Element))return;const i=e.closest(`.${this.sectionClass}`);i&&this.setExpanded(!0,i)}onSectionToggle(t){const e=!this.isExpanded(t);this.setExpanded(e,t),this.storeState(t,e)}onShowOrHideAllToggle(){const t=!this.areAllSectionsOpen();this.$sections.forEach((e=>{this.setExpanded(t,e),this.storeState(e,t)})),this.updateShowAllButton(t)}setExpanded(t,e){const i=e.querySelector(`.${this.upChevronIconClass}`),n=e.querySelector(`.${this.sectionShowHideTextClass}`),s=e.querySelector(`.${this.sectionButtonClass}`),o=e.querySelector(`.${this.sectionContentClass}`);if(!o)throw new ElementError({component:Accordion,identifier:`Section content (\`<div class="${this.sectionContentClass}">\`)`});if(!i||!n||!s)return;const r=t?this.i18n.t("hideSection"):this.i18n.t("showSection");n.textContent=r,s.setAttribute("aria-expanded",`${t}`);const a=[],l=e.querySelector(`.${this.sectionHeadingTextClass}`);l&&a.push(l.textContent.trim());const c=e.querySelector(`.${this.sectionSummaryClass}`);c&&a.push(c.textContent.trim());const u=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");a.push(u),s.setAttribute("aria-label",a.join(" , ")),t?(o.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),i.classList.remove(this.downChevronIconClass)):(o.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),i.classList.add(this.downChevronIconClass)),this.updateShowAllButton(this.areAllSectionsOpen())}isExpanded(t){return t.classList.contains(this.sectionExpandedClass)}areAllSectionsOpen(){return Array.from(this.$sections).every((t=>this.isExpanded(t)))}updateShowAllButton(t){this.$showAllButton&&this.$showAllText&&this.$showAllIcon&&(this.$showAllButton.setAttribute("aria-expanded",t.toString()),this.$showAllText.textContent=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections"),this.$showAllIcon.classList.toggle(this.downChevronIconClass,!t))}getIdentifier(t){const e=t.querySelector(`.${this.sectionButtonClass}`);return null==e?void 0:e.getAttribute("aria-controls")}storeState(t,e){if(!this.config.rememberExpanded)return;const i=this.getIdentifier(t);if(i)try{window.sessionStorage.setItem(i,e.toString())}catch(n){}}setInitialState(t){if(!this.config.rememberExpanded)return;const e=this.getIdentifier(t);if(e)try{const i=window.sessionStorage.getItem(e);null!==i&&this.setExpanded("true"===i,t)}catch(i){}}getButtonPunctuationEl(){const t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.textContent=", ",t}}Accordion.moduleName="govuk-accordion",Accordion.defaults=Object.freeze({i18n:{hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"},rememberExpanded:!0}),Accordion.schema=Object.freeze({properties:{i18n:{type:"object"},rememberExpanded:{type:"boolean"}}});class Button extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",(t=>this.handleKeyDown(t))),this.$root.addEventListener("click",(t=>this.debounce(t)))}handleKeyDown(t){const e=t.target;" "===t.key&&e instanceof HTMLElement&&"button"===e.getAttribute("role")&&(t.preventDefault(),e.click())}debounce(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout((()=>{this.debounceFormSubmitTimer=null}),1e3))}}function closestAttributeValue(t,e){const i=t.closest(`[${e}]`);return i?i.getAttribute(e):null}Button.moduleName="govuk-button",Button.defaults=Object.freeze({preventDoubleClick:!1}),Button.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class CharacterCount extends ConfigurableComponent{[t](t){let e={};return("maxwords"in t||"maxlength"in t)&&(e={maxlength:void 0,maxwords:void 0}),e}constructor(t,e={}){var i,n;super(t,e),this.$textarea=void 0,this.count=0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const s=this.$root.querySelector(".govuk-js-character-count");if(!(s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement))throw new ElementError({component:CharacterCount,element:s,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const o=function(t,e){const i=[];for(const[n,s]of Object.entries(t)){const t=[];if(Array.isArray(s)){for(const{required:i,errorMessage:n}of s)i.every((t=>!!e[t]))||t.push(n);"anyOf"!==n||s.length-t.length>=1||i.push(...t)}}return i}(CharacterCount.schema,this.config);if(o[0])throw new ConfigError(formatErrorMessage(CharacterCount,o[0]));this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.maxLength=null!=(i=null!=(n=this.config.maxwords)?n:this.config.maxlength)?i:1/0,this.$textarea=s;const r=`${this.$textarea.id}-info`,a=document.getElementById(r);if(!a)throw new ElementError({component:CharacterCount,element:a,identifier:`Count message (\`id="${r}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),a.textContent.match(/^\s*$/)&&(a.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",a);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,a.insertAdjacentElement("afterend",l);const c=document.createElement("div");c.className=a.className,c.classList.add("govuk-character-count__status"),c.setAttribute("aria-hidden","true"),this.$visibleCountMessage=c,a.insertAdjacentElement("afterend",c),a.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>{this.$textarea.value!==this.$textarea.textContent&&(this.updateCount(),this.updateCountMessage())})),this.updateCount(),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("input",(()=>this.handleInput())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleInput(){this.updateCount(),this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const t=this.maxLength-this.count<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",t),this.$visibleCountMessage.classList.toggle("govuk-error-message",t),this.$visibleCountMessage.classList.toggle("govuk-hint",!t),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}updateCount(){const t=this.$textarea.value;if(this.config.maxwords){var e;const i=null!=(e=t.match(/\S+/g))?e:[];this.count=i.length}else this.count=t.length}getCountMessage(){const t=this.maxLength-this.count,e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)}formatCountMessage(t,e){if(0===t)return this.i18n.t(`${e}AtLimit`);const i=t<0?"OverLimit":"UnderLimit";return this.i18n.t(`${e}${i}`,{count:Math.abs(t)})}isOverThreshold(){if(!this.config.threshold)return!0;const t=this.count;return this.maxLength*this.config.threshold/100<=t}}CharacterCount.moduleName="govuk-character-count",CharacterCount.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),CharacterCount.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class Checkboxes extends Component{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="checkbox"]');if(!e.length)throw new ElementError({component:Checkboxes,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Checkboxes,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const i=document.getElementById(e);if(null!=i&&i.classList.contains("govuk-checkboxes__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),i.classList.toggle("govuk-checkboxes__conditional--hidden",!e)}}unCheckAllInputsExcept(t){document.querySelectorAll(`input[type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}unCheckExclusiveInputs(t){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"checkbox"!==e.type)return;if(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),!e.checked)return;"exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)}}Checkboxes.moduleName="govuk-checkboxes";class ErrorSummary extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.config.disableAutoFocus||setFocus(this.$root),this.$root.addEventListener("click",(t=>this.handleClick(t)))}handleClick(t){const e=t.target;e&&this.focusTarget(e)&&t.preventDefault()}focusTarget(t){if(!(t instanceof HTMLAnchorElement))return!1;const e=t.hash.replace("#","");if(!e)return!1;const i=document.getElementById(e);if(!i)return!1;const n=this.getAssociatedLegendOrLabel(i);return!!n&&(n.scrollIntoView(),i.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(t){var e;const i=t.closest("fieldset");if(i){const e=i.getElementsByTagName("legend");if(e.length){const i=e[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;const n=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight){if(s.top+s.height-n<window.innerHeight/2)return i}}}return null!=(e=document.querySelector(`label[for='${t.getAttribute("id")}']`))?e:t.closest("label")}}ErrorSummary.moduleName="govuk-error-summary",ErrorSummary.defaults=Object.freeze({disableAutoFocus:!1}),ErrorSummary.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class ExitThisPage extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.$button=void 0,this.$skiplinkButton=null,this.$updateSpan=null,this.$indicatorContainer=null,this.$overlay=null,this.keypressCounter=0,this.lastKeyWasModified=!1,this.timeoutTime=5e3,this.keypressTimeoutId=null,this.timeoutMessageId=null;const i=this.$root.querySelector(".govuk-exit-this-page__button");if(!(i instanceof HTMLAnchorElement))throw new ElementError({component:ExitThisPage,element:i,expectedType:"HTMLAnchorElement",identifier:"Button (`.govuk-exit-this-page__button`)"});this.i18n=new I18n(this.config.i18n),this.$button=i;const n=document.querySelector(".govuk-js-exit-this-page-skiplink");n instanceof HTMLAnchorElement&&(this.$skiplinkButton=n),this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("pageshow",this.resetPage.bind(this))}initUpdateSpan(){this.$updateSpan=document.createElement("span"),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.className="govuk-visually-hidden",this.$root.appendChild(this.$updateSpan)}initButtonClickHandler(){this.$button.addEventListener("click",this.handleClick.bind(this)),this.$skiplinkButton&&this.$skiplinkButton.addEventListener("click",this.handleClick.bind(this))}buildIndicator(){this.$indicatorContainer=document.createElement("div"),this.$indicatorContainer.className="govuk-exit-this-page__indicator",this.$indicatorContainer.setAttribute("aria-hidden","true");for(let t=0;t<3;t++){const t=document.createElement("div");t.className="govuk-exit-this-page__indicator-light",this.$indicatorContainer.appendChild(t)}this.$button.appendChild(this.$indicatorContainer)}updateIndicator(){if(!this.$indicatorContainer)return;this.$indicatorContainer.classList.toggle("govuk-exit-this-page__indicator--visible",this.keypressCounter>0);this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light").forEach(((t,e)=>{t.classList.toggle("govuk-exit-this-page__indicator-light--on",e<this.keypressCounter)}))}exitPage(){this.$updateSpan&&(this.$updateSpan.textContent="",document.body.classList.add("govuk-exit-this-page-hide-content"),this.$overlay=document.createElement("div"),this.$overlay.className="govuk-exit-this-page-overlay",this.$overlay.setAttribute("role","alert"),document.body.appendChild(this.$overlay),this.$overlay.textContent=this.i18n.t("activated"),window.location.href=this.$button.href)}handleClick(t){t.preventDefault(),this.exitPage()}handleKeypress(t){this.$updateSpan&&("Shift"!==t.key||this.lastKeyWasModified?this.keypressTimeoutId&&this.resetKeypressTimer():(this.keypressCounter+=1,this.updateIndicator(),this.timeoutMessageId&&(window.clearTimeout(this.timeoutMessageId),this.timeoutMessageId=null),this.keypressCounter>=3?(this.keypressCounter=0,this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.textContent=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.textContent=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey)}setKeypressTimer(){this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=window.setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)}resetKeypressTimer(){if(!this.$updateSpan)return;this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null);const t=this.$updateSpan;this.keypressCounter=0,t.textContent=this.i18n.t("timedOut"),this.timeoutMessageId=window.setTimeout((()=>{t.textContent=""}),this.timeoutTime),this.updateIndicator()}resetPage(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan&&(this.$updateSpan.setAttribute("role","status"),this.$updateSpan.textContent=""),this.updateIndicator(),this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&window.clearTimeout(this.timeoutMessageId)}}ExitThisPage.moduleName="govuk-exit-this-page",ExitThisPage.defaults=Object.freeze({i18n:{activated:"Loading.",timedOut:"Exit this page expired.",pressTwoMoreTimes:"Shift, press 2 more times to exit.",pressOneMoreTime:"Shift, press 1 more time to exit."}}),ExitThisPage.schema=Object.freeze({properties:{i18n:{type:"object"}}});class FileUpload extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.$label=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const i=this.$root.querySelector('input[type="file"]');if(null===i)throw new ElementError({component:FileUpload,identifier:'File inputs (`<input type="file">`)'});if(this.$input=i,!this.$input.id)throw new ElementError({component:FileUpload,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")});const n=this.findLabel();n.id||(n.id=`${this.id}-label`),this.$label=n,this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","hidden"),this.$status=this.createStatus(),this.$button=this.createButton(),this.$root.insertAdjacentElement("afterbegin",this.$button),this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.bindDraggingEvents()}createStatus(){const t=document.createElement("span");return t.className="govuk-body govuk-file-upload-button__status",t.setAttribute("aria-live","polite"),t.innerText=this.i18n.t("noFileChosen"),t}createButton(){const t=document.createElement("button");t.classList.add("govuk-file-upload-button"),t.type="button",t.id=this.id,t.classList.add("govuk-file-upload-button--empty");const e=this.$input.getAttribute("aria-describedby");e&&t.setAttribute("aria-describedby",e),t.appendChild(this.$status);const i=document.createElement("span");i.className="govuk-visually-hidden",i.innerText=", ",i.id=`${this.id}-comma`,t.appendChild(i);const n=document.createElement("span");n.className="govuk-file-upload-button__pseudo-button-container";const s=document.createElement("span");s.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",s.innerText=this.i18n.t("chooseFilesButton"),n.appendChild(s),n.insertAdjacentText("beforeend"," ");const o=document.createElement("span");return o.className="govuk-body govuk-file-upload-button__instruction",o.innerText=this.i18n.t("dropInstruction"),n.appendChild(o),t.appendChild(n),t.setAttribute("aria-labelledby",`${this.$label.id} ${i.id} ${t.id}`),t.addEventListener("click",this.onClick.bind(this)),t.addEventListener("dragover",(t=>{t.preventDefault()})),t}bindDraggingEvents(){this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",(()=>{this.enteredAnotherElement=!0})),document.addEventListener("dragleave",(()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1}))}updateDropzoneVisibility(t){this.$button.disabled||t.target instanceof Node&&(this.$root.contains(t.target)?t.dataTransfer&&this.canDrop(t.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(t){t.preventDefault(),t.dataTransfer&&this.canFillInput(t.dataTransfer)&&(this.$input.files=t.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(t){return this.matchesInputCapacity(t.files.length)}canDrop(t){return t.items.length?this.matchesInputCapacity(function(t){let e=0;for(let i=0;i<t.length;i++)"file"===t[i].kind&&e++;return e}(t.items)):!t.types.length||t.types.includes("Files")}matchesInputCapacity(t){return this.$input.multiple?t>0:1===t}onChange(){const t=this.$input.files.length;0===t?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===t?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:t}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const t=document.querySelector(`label[for="${this.$input.id}"]`);if(!t)throw new ElementError({component:FileUpload,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return t}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver((t=>{for(const e of t)"attributes"===e.type&&"disabled"===e.attributeName&&this.updateDisabledState()})).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-file-upload-wrapper--disabled",this.$button.disabled)}}FileUpload.moduleName="govuk-file-upload",FileUpload.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),FileUpload.schema=Object.freeze({properties:{i18n:{type:"object"}}});class NotificationBanner extends ConfigurableComponent{constructor(t,e={}){super(t,e),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||setFocus(this.$root)}}NotificationBanner.moduleName="govuk-notification-banner",NotificationBanner.defaults=Object.freeze({disableAutoFocus:!1}),NotificationBanner.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class PasswordInput extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.$input=void 0,this.$showHideButton=void 0,this.$screenReaderStatusMessage=void 0;const i=this.$root.querySelector(".govuk-js-password-input-input");if(!(i instanceof HTMLInputElement))throw new ElementError({component:PasswordInput,element:i,expectedType:"HTMLInputElement",identifier:"Form field (`.govuk-js-password-input-input`)"});if("password"!==i.type)throw new ElementError("Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.");const n=this.$root.querySelector(".govuk-js-password-input-toggle");if(!(n instanceof HTMLButtonElement))throw new ElementError({component:PasswordInput,element:n,expectedType:"HTMLButtonElement",identifier:"Button (`.govuk-js-password-input-toggle`)"});if("button"!==n.type)throw new ElementError("Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.");this.$input=i,this.$showHideButton=n,this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.$showHideButton.removeAttribute("hidden");const s=document.createElement("div");s.className="govuk-password-input__sr-status govuk-visually-hidden",s.setAttribute("aria-live","polite"),this.$screenReaderStatusMessage=s,this.$input.insertAdjacentElement("afterend",s),this.$showHideButton.addEventListener("click",this.toggle.bind(this)),this.$input.form&&this.$input.form.addEventListener("submit",(()=>this.hide())),window.addEventListener("pageshow",(t=>{t.persisted&&"password"!==this.$input.type&&this.hide()})),this.hide()}toggle(t){t.preventDefault(),"password"!==this.$input.type?this.hide():this.show()}show(){this.setType("text")}hide(){this.setType("password")}setType(t){if(t===this.$input.type)return;this.$input.setAttribute("type",t);const e="password"===t,i=e?"show":"hide",n=e?"passwordHidden":"passwordShown";this.$showHideButton.innerText=this.i18n.t(`${i}Password`),this.$showHideButton.setAttribute("aria-label",this.i18n.t(`${i}PasswordAriaLabel`)),this.$screenReaderStatusMessage.innerText=this.i18n.t(`${n}Announcement`)}}PasswordInput.moduleName="govuk-password-input",PasswordInput.defaults=Object.freeze({i18n:{showPassword:"Show",hidePassword:"Hide",showPasswordAriaLabel:"Show password",hidePasswordAriaLabel:"Hide password",passwordShownAnnouncement:"Your password is visible",passwordHiddenAnnouncement:"Your password is hidden"}}),PasswordInput.schema=Object.freeze({properties:{i18n:{type:"object"}}});class Radios extends Component{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="radio"]');if(!e.length)throw new ElementError({component:Radios,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Radios,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const i=document.getElementById(e);if(null!=i&&i.classList.contains("govuk-radios__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),i.classList.toggle("govuk-radios__conditional--hidden",!e)}}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"radio"!==e.type)return;const i=document.querySelectorAll('input[type="radio"][aria-controls]'),n=e.form,s=e.name;i.forEach((t=>{const e=t.form===n;t.name===s&&e&&this.syncConditionalRevealWithInputState(t)}))}}Radios.moduleName="govuk-radios";class ServiceNavigation extends Component{constructor(t){super(t),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const e=this.$root.querySelector(".govuk-js-service-navigation-toggle");if(!e)return this;const i=e.getAttribute("aria-controls");if(!i)throw new ElementError({component:ServiceNavigation,identifier:'Navigation button (`<button class="govuk-js-service-navigation-toggle">`) attribute (`aria-controls`)'});const n=document.getElementById(i);if(!n)throw new ElementError({component:ServiceNavigation,element:n,identifier:`Navigation (\`<ul id="${i}">\`)`});this.$menu=n,this.$menuButton=e,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",(()=>this.handleMenuButtonClick()))}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:ServiceNavigation,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),function(t,e){for(const i in e)t.setAttribute(i,e[i])}(this.$menuButton,e)):(!function(t,e){for(const i of e)t.removeAttribute(i)}(this.$menuButton,Object.keys(e)),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}ServiceNavigation.moduleName="govuk-service-navigation";const e={hidden:"","aria-hidden":"true"};class SkipLink extends Component{constructor(t){var e;super(t);const i=this.$root.hash,n=null!=(e=this.$root.getAttribute("href"))?e:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const s=i.replace("#","");if(!s)throw new ElementError(`Skip link: Target link (\`href="${n}"\`) has no hash fragment`);const o=document.getElementById(s);if(!o)throw new ElementError({component:SkipLink,element:o,identifier:`Target content (\`id="${s}"\`)`});this.$root.addEventListener("click",(()=>setFocus(o,{onBeforeFocus(){o.classList.add("govuk-skip-link-focused-element")},onBlur(){o.classList.remove("govuk-skip-link-focused-element")}})))}}SkipLink.elementType=HTMLAnchorElement,SkipLink.moduleName="govuk-skip-link";class Tabs extends Component{constructor(t){super(t),this.$tabs=void 0,this.$tabList=void 0,this.$tabListItems=void 0,this.jsHiddenClass="govuk-tabs__panel--hidden",this.changingHash=!1,this.boundTabClick=void 0,this.boundTabKeydown=void 0,this.boundOnHashChange=void 0,this.mql=null;const e=this.$root.querySelectorAll("a.govuk-tabs__tab");if(!e.length)throw new ElementError({component:Tabs,identifier:'Links (`<a class="govuk-tabs__tab">`)'});this.$tabs=e,this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this);const i=this.$root.querySelector(".govuk-tabs__list"),n=this.$root.querySelectorAll("li.govuk-tabs__list-item");if(!i)throw new ElementError({component:Tabs,identifier:'List (`<ul class="govuk-tabs__list">`)'});if(!n.length)throw new ElementError({component:Tabs,identifier:'List items (`<li class="govuk-tabs__list-item">`)'});this.$tabList=i,this.$tabListItems=n,this.setupResponsiveChecks()}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:Tabs,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){var t;null!=(t=this.mql)&&t.matches?this.setup():this.teardown()}setup(){var t;this.$tabList.setAttribute("role","tablist"),this.$tabListItems.forEach((t=>{t.setAttribute("role","presentation")})),this.$tabs.forEach((t=>{this.setAttributes(t),t.addEventListener("click",this.boundTabClick,!0),t.addEventListener("keydown",this.boundTabKeydown,!0),this.hideTab(t)}));const e=null!=(t=this.getTab(window.location.hash))?t:this.$tabs[0];this.showTab(e),window.addEventListener("hashchange",this.boundOnHashChange,!0)}teardown(){this.$tabList.removeAttribute("role"),this.$tabListItems.forEach((t=>{t.removeAttribute("role")})),this.$tabs.forEach((t=>{t.removeEventListener("click",this.boundTabClick,!0),t.removeEventListener("keydown",this.boundTabKeydown,!0),this.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0)}onHashChange(){const t=window.location.hash,e=this.getTab(t);if(!e)return;if(this.changingHash)return void(this.changingHash=!1);const i=this.getCurrentTab();i&&(this.hideTab(i),this.showTab(e),e.focus())}hideTab(t){this.unhighlightTab(t),this.hidePanel(t)}showTab(t){this.highlightTab(t),this.showPanel(t)}getTab(t){return this.$root.querySelector(`a.govuk-tabs__tab[href="${t}"]`)}setAttributes(t){const e=t.hash.replace("#","");if(!e)return;t.setAttribute("id",`tab_${e}`),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");const i=this.getPanel(t);i&&(i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",t.id),i.classList.add(this.jsHiddenClass))}unsetAttributes(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");const e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))}onTabClick(t){const e=this.getCurrentTab(),i=t.currentTarget;e&&i instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(i),this.createHistoryEntry(i))}createHistoryEntry(t){const e=this.getPanel(t);if(!e)return;const i=e.id;e.id="",this.changingHash=!0,window.location.hash=i,e.id=i}onTabKeydown(t){switch(t.key){case"ArrowLeft":case"Left":this.activatePreviousTab(),t.preventDefault();break;case"ArrowRight":case"Right":this.activateNextTab(),t.preventDefault()}}activateNextTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.nextElementSibling;if(!e)return;const i=e.querySelector("a.govuk-tabs__tab");i&&(this.hideTab(t),this.showTab(i),i.focus(),this.createHistoryEntry(i))}activatePreviousTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.previousElementSibling;if(!e)return;const i=e.querySelector("a.govuk-tabs__tab");i&&(this.hideTab(t),this.showTab(i),i.focus(),this.createHistoryEntry(i))}getPanel(t){const e=t.hash.replace("#","");return e?this.$root.querySelector(`#${e}`):null}showPanel(t){const e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)}hidePanel(t){const e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)}unhighlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))}highlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))}getCurrentTab(){return this.$root.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")}}function initAll(t={}){const e=isObject(t)?t:{},i=normaliseOptions(t);try{if(!isSupported())throw new SupportError;if(null===i.scope)throw new ElementError({element:i.scope,identifier:"GOV.UK Frontend scope element (`$scope`)"})}catch(n){return void(i.onError?i.onError(n,{config:e}):console.log(n))}[[Accordion,e.accordion],[Button,e.button],[CharacterCount,e.characterCount],[Checkboxes],[ErrorSummary,e.errorSummary],[ExitThisPage,e.exitThisPage],[FileUpload,e.fileUpload],[NotificationBanner,e.notificationBanner],[PasswordInput,e.passwordInput],[Radios],[ServiceNavigation],[SkipLink],[Tabs]].forEach((([Component,t])=>{createAll(Component,t,i)}))}function createAll(Component,t,e){let i;const n=normaliseOptions(e);try{var s;if(!isSupported())throw new SupportError;if(null===n.scope)throw new ElementError({element:n.scope,component:Component,identifier:"Scope element (`$scope`)"});i=null==(s=n.scope)?void 0:s.querySelectorAll(`[data-module="${Component.moduleName}"]`)}catch(o){return n.onError?n.onError(o,{component:Component,config:t}):console.log(o),[]}return Array.from(null!=i?i:[]).map((e=>{try{return void 0!==t?new Component(e,t):new Component(e)}catch(o){return n.onError?n.onError(o,{element:e,component:Component,config:t}):console.log(o),null}})).filter(Boolean)}Tabs.moduleName="govuk-tabs";export{Accordion,Button,CharacterCount,Checkboxes,Component,ConfigurableComponent,ErrorSummary,ExitThisPage,FileUpload,NotificationBanner,PasswordInput,Radios,ServiceNavigation,SkipLink,Tabs,createAll,initAll,isSupported,version};//# sourceMappingURL=govuk-frontend.min.js.map
|
|
1
|
+
const version="6.5.0";function getBreakpoint(t){const e=`--govuk-breakpoint-${t}`;return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}function setFocus(t,e={}){var i;const n=t.getAttribute("tabindex");function onBlur(){var i;null==(i=e.onBlur)||i.call(t),n||t.removeAttribute("tabindex")}n||t.setAttribute("tabindex","-1"),t.addEventListener("focus",(function(){t.addEventListener("blur",onBlur,{once:!0})}),{once:!0}),null==(i=e.onBeforeFocus)||i.call(t),t.focus()}function isSupported(t=document.body){return!!t&&t.classList.contains("govuk-frontend-supported")}function isObject(t){return!!t&&"object"==typeof t&&!function(t){return Array.isArray(t)}(t)}function isScope(t){return!!t&&(t instanceof Element||t instanceof Document)}function formatErrorMessage(Component,t){return`${Component.moduleName}: ${t}`}class GOVUKFrontendError extends Error{constructor(...t){super(...t),this.name="GOVUKFrontendError"}}class SupportError extends GOVUKFrontendError{constructor(t=document.body){const e="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(t?e:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class ConfigError extends GOVUKFrontendError{constructor(...t){super(...t),this.name="ConfigError"}}class ElementError extends GOVUKFrontendError{constructor(t){let e="string"==typeof t?t:"";if(isObject(t)){const{component:i,identifier:n,element:s,expectedType:o}=t;e=n,e+=s?` is not of type ${null!=o?o:"HTMLElement"}`:" not found",i&&(e=formatErrorMessage(i,e))}super(e),this.name="ElementError"}}class InitError extends GOVUKFrontendError{constructor(t){super("string"==typeof t?t:formatErrorMessage(t,"Root element (`$root`) already initialised")),this.name="InitError"}}class Component{get $root(){return this._$root}constructor(t){this._$root=void 0;const e=this.constructor;if("string"!=typeof e.moduleName)throw new InitError("`moduleName` not defined in component");if(!(t instanceof e.elementType))throw new ElementError({element:t,component:e,identifier:"Root element (`$root`)",expectedType:e.elementType.name});this._$root=t,e.checkSupport(),this.checkInitialised();const i=e.moduleName;this.$root.setAttribute(`data-${i}-init`,"")}checkInitialised(){const t=this.constructor,e=t.moduleName;if(e&&function(t,e){return t instanceof HTMLElement&&t.hasAttribute(`data-${e}-init`)}(this.$root,e))throw new InitError(t)}static checkSupport(){if(!isSupported())throw new SupportError}}Component.elementType=HTMLElement;const t=Symbol.for("configOverride");class ConfigurableComponent extends Component{[t](t){return{}}get config(){return this._config}constructor(e,i){super(e),this._config=void 0;const n=this.constructor;if(!isObject(n.defaults))throw new ConfigError(formatErrorMessage(n,"Config passed as parameter into constructor but no defaults defined"));const s=function(Component,t){if(!isObject(Component.schema))throw new ConfigError(formatErrorMessage(Component,"Config passed as parameter into constructor but no schema defined"));const e={},i=Object.entries(Component.schema.properties);for(const n of i){const[i,s]=n,o=i.toString();o in t&&(e[o]=normaliseString(t[o],s)),"object"===(null==s?void 0:s.type)&&(e[o]=extractConfigByNamespace(Component.schema,t,i))}return e}(n,this._$root.dataset);this._config=mergeConfigs(n.defaults,null!=i?i:{},this[t](s),s)}}function normaliseString(t,e){const i=t?t.trim():"";let n,s=null==e?void 0:e.type;switch(s||(["true","false"].includes(i)&&(s="boolean"),i.length>0&&isFinite(Number(i))&&(s="number")),s){case"boolean":n="true"===i;break;case"number":n=Number(i);break;default:n=t}return n}function normaliseOptions(t){let e,i=document;if(isObject(t)){const n=t;(isScope(n.scope)||null===n.scope)&&(i=n.scope),"function"==typeof n.onError&&(e=n.onError)}return isScope(t)?i=t:null===t?i=null:"function"==typeof t&&(e=t),{scope:i,onError:e}}function mergeConfigs(...t){const e={};for(const i of t)for(const t of Object.keys(i)){const n=e[t],s=i[t];isObject(n)&&isObject(s)?e[t]=mergeConfigs(n,s):e[t]=s}return e}function extractConfigByNamespace(t,e,i){const n=t.properties[i];if("object"!==(null==n?void 0:n.type))return;const s={[i]:{}};for(const[o,r]of Object.entries(e)){let t=s;const e=o.split(".");for(const[n,s]of e.entries())isObject(t)&&(n<e.length-1?(isObject(t[s])||(t[s]={}),t=t[s]):o!==i&&(t[s]=normaliseString(r)))}return s[i]}class I18n{constructor(t={},e={}){var i;this.translations=void 0,this.locale=void 0,this.translations=t,this.locale=null!=(i=e.locale)?i:document.documentElement.lang||"en"}t(t,e){if(!t)throw new Error("i18n: lookup key missing");let i=this.translations[t];if("number"==typeof(null==e?void 0:e.count)&&isObject(i)){const n=i[this.getPluralSuffix(t,e.count)];n&&(i=n)}if("string"==typeof i){if(i.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(i,e)}return i}return t}replacePlaceholders(t,e){const i=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return t.replace(/%{(.\S+)}/g,(function(t,n){if(Object.prototype.hasOwnProperty.call(e,n)){const t=e[n];return!1===t||"number"!=typeof t&&"string"!=typeof t?"":"number"==typeof t?i?i.format(t):`${t}`:t}throw new Error(`i18n: no data found to replace ${t} placeholder in string`)}))}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(t,e){if(e=Number(e),!isFinite(e))return"other";const i=this.translations[t],n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):"other";if(isObject(i)){if(n in i)return n;if("other"in i)return console.warn(`i18n: Missing plural form ".${n}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class Accordion extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=void 0,this.$showAllButton=null,this.$showAllIcon=null,this.$showAllText=null,this.i18n=new I18n(this.config.i18n);const i=this.$root.querySelectorAll(`.${this.sectionClass}`);if(!i.length)throw new ElementError({component:Accordion,identifier:`Sections (\`<div class="${this.sectionClass}">\`)`});this.$sections=i,this.initControls(),this.initSectionHeaders(),this.updateShowAllButton(this.areAllSectionsOpen())}initControls(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);const t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$root.insertBefore(t,this.$root.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",(()=>this.onShowOrHideAllToggle())),"onbeforematch"in document&&document.addEventListener("beforematch",(t=>this.onBeforeMatch(t)))}initSectionHeaders(){this.$sections.forEach(((t,e)=>{const i=t.querySelector(`.${this.sectionHeaderClass}`);if(!i)throw new ElementError({component:Accordion,identifier:`Section headers (\`<div class="${this.sectionHeaderClass}">\`)`});this.constructHeaderMarkup(i,e),this.setExpanded(this.isExpanded(t),t),i.addEventListener("click",(()=>this.onSectionToggle(t))),this.setInitialState(t)}))}constructHeaderMarkup(t,e){const i=t.querySelector(`.${this.sectionButtonClass}`),n=t.querySelector(`.${this.sectionHeadingClass}`),s=t.querySelector(`.${this.sectionSummaryClass}`);if(!n)throw new ElementError({component:Accordion,identifier:`Section heading (\`.${this.sectionHeadingClass}\`)`});if(!i)throw new ElementError({component:Accordion,identifier:`Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`});const o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("aria-controls",`${this.$root.id}-content-${e+1}`);for(const d of Array.from(i.attributes))"id"!==d.name&&o.setAttribute(d.name,d.value);const r=document.createElement("span");r.classList.add(this.sectionHeadingTextClass),r.id=i.id;const a=document.createElement("span");a.classList.add(this.sectionHeadingTextFocusClass),r.appendChild(a),Array.from(i.childNodes).forEach((t=>a.appendChild(t)));const l=document.createElement("span");l.classList.add(this.sectionShowHideToggleClass),l.setAttribute("data-nosnippet","");const c=document.createElement("span");c.classList.add(this.sectionShowHideToggleFocusClass),l.appendChild(c);const u=document.createElement("span"),h=document.createElement("span");if(h.classList.add(this.upChevronIconClass),c.appendChild(h),u.classList.add(this.sectionShowHideTextClass),c.appendChild(u),o.appendChild(r),o.appendChild(this.getButtonPunctuationEl()),s){const t=document.createElement("span"),e=document.createElement("span");e.classList.add(this.sectionSummaryFocusClass),t.appendChild(e);for(const i of Array.from(s.attributes))t.setAttribute(i.name,i.value);Array.from(s.childNodes).forEach((t=>e.appendChild(t))),s.remove(),o.appendChild(t),o.appendChild(this.getButtonPunctuationEl())}o.appendChild(l),n.removeChild(i),n.appendChild(o)}onBeforeMatch(t){const e=t.target;if(!(e instanceof Element))return;const i=e.closest(`.${this.sectionClass}`);i&&this.setExpanded(!0,i)}onSectionToggle(t){const e=!this.isExpanded(t);this.setExpanded(e,t),this.storeState(t,e)}onShowOrHideAllToggle(){const t=!this.areAllSectionsOpen();this.$sections.forEach((e=>{this.setExpanded(t,e),this.storeState(e,t)})),this.updateShowAllButton(t)}setExpanded(t,e){const i=e.querySelector(`.${this.upChevronIconClass}`),n=e.querySelector(`.${this.sectionShowHideTextClass}`),s=e.querySelector(`.${this.sectionButtonClass}`),o=e.querySelector(`.${this.sectionContentClass}`);if(!o)throw new ElementError({component:Accordion,identifier:`Section content (\`<div class="${this.sectionContentClass}">\`)`});if(!i||!n||!s)return;const r=t?this.i18n.t("hideSection"):this.i18n.t("showSection");n.textContent=r,s.setAttribute("aria-expanded",`${t}`);const a=[],l=e.querySelector(`.${this.sectionHeadingTextClass}`);l&&a.push(l.textContent.trim());const c=e.querySelector(`.${this.sectionSummaryClass}`);c&&a.push(c.textContent.trim());const u=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");a.push(u),s.setAttribute("aria-label",a.join(" , ")),t?(o.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),i.classList.remove(this.downChevronIconClass)):(o.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),i.classList.add(this.downChevronIconClass)),this.updateShowAllButton(this.areAllSectionsOpen())}isExpanded(t){return t.classList.contains(this.sectionExpandedClass)}areAllSectionsOpen(){return Array.from(this.$sections).every((t=>this.isExpanded(t)))}updateShowAllButton(t){this.$showAllButton&&this.$showAllText&&this.$showAllIcon&&(this.$showAllButton.setAttribute("aria-expanded",t.toString()),this.$showAllText.textContent=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections"),this.$showAllIcon.classList.toggle(this.downChevronIconClass,!t))}getIdentifier(t){const e=t.querySelector(`.${this.sectionButtonClass}`);return null==e?void 0:e.getAttribute("aria-controls")}storeState(t,e){if(!this.config.rememberExpanded)return;const i=this.getIdentifier(t);if(i)try{window.sessionStorage.setItem(i,e.toString())}catch(n){}}setInitialState(t){if(!this.config.rememberExpanded)return;const e=this.getIdentifier(t);if(e)try{const i=window.sessionStorage.getItem(e);null!==i&&this.setExpanded("true"===i,t)}catch(i){}}getButtonPunctuationEl(){const t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.textContent=", ",t}}Accordion.moduleName="govuk-accordion",Accordion.defaults=Object.freeze({i18n:{hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"},rememberExpanded:!0}),Accordion.schema=Object.freeze({properties:{i18n:{type:"object"},rememberExpanded:{type:"boolean"}}});class Button extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",(t=>this.handleKeyDown(t))),this.$root.addEventListener("click",(t=>this.debounce(t)))}handleKeyDown(t){const e=t.target;" "===t.key&&e instanceof HTMLElement&&"button"===e.getAttribute("role")&&(t.preventDefault(),e.click())}debounce(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout((()=>{this.debounceFormSubmitTimer=null}),1e3))}}function closestAttributeValue(t,e){const i=t.closest(`[${e}]`);return i?i.getAttribute(e):null}Button.moduleName="govuk-button",Button.defaults=Object.freeze({preventDoubleClick:!1}),Button.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class CharacterCount extends ConfigurableComponent{[t](t){let e={};return("maxwords"in t||"maxlength"in t)&&(e={maxlength:void 0,maxwords:void 0}),e}constructor(t,e={}){var i,n;super(t,e),this.$textarea=void 0,this.count=0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const s=this.$root.querySelector(".govuk-js-character-count");if(!(s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement))throw new ElementError({component:CharacterCount,element:s,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const o=function(t,e){const i=[];for(const[n,s]of Object.entries(t)){const t=[];if(Array.isArray(s)){for(const{required:i,errorMessage:n}of s)i.every((t=>!!e[t]))||t.push(n);"anyOf"!==n||s.length-t.length>=1||i.push(...t)}}return i}(CharacterCount.schema,this.config);if(o[0])throw new ConfigError(formatErrorMessage(CharacterCount,o[0]));this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.maxLength=null!=(i=null!=(n=this.config.maxwords)?n:this.config.maxlength)?i:1/0,this.$textarea=s;const r=`${this.$textarea.id}-info`,a=document.getElementById(r);if(!a)throw new ElementError({component:CharacterCount,element:a,identifier:`Count message (\`id="${r}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),a.textContent.match(/^\s*$/)&&(a.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",a);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,a.insertAdjacentElement("afterend",l);const c=document.createElement("div");c.className=a.className,c.classList.add("govuk-character-count__status"),c.setAttribute("aria-hidden","true"),this.$visibleCountMessage=c,a.insertAdjacentElement("afterend",c),a.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>{this.$textarea.value!==this.$textarea.textContent&&(this.updateCount(),this.updateCountMessage())})),this.updateCount(),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("input",(()=>this.handleInput())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleInput(){this.updateCount(),this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const t=this.maxLength-this.count<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",t),this.$visibleCountMessage.classList.toggle("govuk-error-message",t),this.$visibleCountMessage.classList.toggle("govuk-hint",!t),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}updateCount(){const t=this.$textarea.value;if(this.config.maxwords){var e;const i=null!=(e=t.match(/\S+/g))?e:[];this.count=i.length}else this.count=t.length}getCountMessage(){const t=this.maxLength-this.count,e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)}formatCountMessage(t,e){if(0===t)return this.i18n.t(`${e}AtLimit`);const i=t<0?"OverLimit":"UnderLimit";return this.i18n.t(`${e}${i}`,{count:Math.abs(t)})}isOverThreshold(){if(!this.config.threshold)return!0;const t=this.count;return this.maxLength*this.config.threshold/100<=t}}CharacterCount.moduleName="govuk-character-count",CharacterCount.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),CharacterCount.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class Checkboxes extends Component{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="checkbox"]');if(!e.length)throw new ElementError({component:Checkboxes,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Checkboxes,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const i=document.getElementById(e);if(null!=i&&i.classList.contains("govuk-checkboxes__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),i.classList.toggle("govuk-checkboxes__conditional--hidden",!e)}}unCheckAllInputsExcept(t){document.querySelectorAll(`input[type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}unCheckExclusiveInputs(t){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"checkbox"!==e.type)return;if(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),!e.checked)return;"exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)}}Checkboxes.moduleName="govuk-checkboxes";class ErrorSummary extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.config.disableAutoFocus||setFocus(this.$root),this.$root.addEventListener("click",(t=>this.handleClick(t)))}handleClick(t){const e=t.target;e&&this.focusTarget(e)&&t.preventDefault()}focusTarget(t){if(!(t instanceof HTMLAnchorElement))return!1;const e=t.hash.replace("#","");if(!e)return!1;const i=document.getElementById(e);if(!i)return!1;const n=this.getAssociatedLegendOrLabel(i);return!!n&&(n.scrollIntoView(),i.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(t){var e;const i=t.closest("fieldset");if(i){const e=i.getElementsByTagName("legend");if(e.length){const i=e[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return i;const n=i.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight){if(s.top+s.height-n<window.innerHeight/2)return i}}}return null!=(e=document.querySelector(`label[for='${t.getAttribute("id")}']`))?e:t.closest("label")}}ErrorSummary.moduleName="govuk-error-summary",ErrorSummary.defaults=Object.freeze({disableAutoFocus:!1}),ErrorSummary.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class ExitThisPage extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.$button=void 0,this.$skiplinkButton=null,this.$updateSpan=null,this.$indicatorContainer=null,this.$overlay=null,this.keypressCounter=0,this.lastKeyWasModified=!1,this.timeoutTime=5e3,this.keypressTimeoutId=null,this.timeoutMessageId=null;const i=this.$root.querySelector(".govuk-exit-this-page__button");if(!(i instanceof HTMLAnchorElement))throw new ElementError({component:ExitThisPage,element:i,expectedType:"HTMLAnchorElement",identifier:"Button (`.govuk-exit-this-page__button`)"});this.i18n=new I18n(this.config.i18n),this.$button=i;const n=document.querySelector(".govuk-js-exit-this-page-skiplink");n instanceof HTMLAnchorElement&&(this.$skiplinkButton=n),this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("pageshow",this.resetPage.bind(this))}initUpdateSpan(){this.$updateSpan=document.createElement("span"),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.className="govuk-visually-hidden",this.$root.appendChild(this.$updateSpan)}initButtonClickHandler(){this.$button.addEventListener("click",this.handleClick.bind(this)),this.$skiplinkButton&&this.$skiplinkButton.addEventListener("click",this.handleClick.bind(this))}buildIndicator(){this.$indicatorContainer=document.createElement("div"),this.$indicatorContainer.className="govuk-exit-this-page__indicator",this.$indicatorContainer.setAttribute("aria-hidden","true");for(let t=0;t<3;t++){const t=document.createElement("div");t.className="govuk-exit-this-page__indicator-light",this.$indicatorContainer.appendChild(t)}this.$button.appendChild(this.$indicatorContainer)}updateIndicator(){if(!this.$indicatorContainer)return;this.$indicatorContainer.classList.toggle("govuk-exit-this-page__indicator--visible",this.keypressCounter>0);this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light").forEach(((t,e)=>{t.classList.toggle("govuk-exit-this-page__indicator-light--on",e<this.keypressCounter)}))}exitPage(){this.$updateSpan&&(this.$updateSpan.textContent="",document.body.classList.add("govuk-exit-this-page-hide-content"),this.$overlay=document.createElement("div"),this.$overlay.className="govuk-exit-this-page-overlay",this.$overlay.setAttribute("role","alert"),document.body.appendChild(this.$overlay),this.$overlay.textContent=this.i18n.t("activated"),window.location.href=this.$button.href)}handleClick(t){t.preventDefault(),this.exitPage()}handleKeypress(t){this.$updateSpan&&("Shift"!==t.key||this.lastKeyWasModified?this.keypressTimeoutId&&this.resetKeypressTimer():(this.keypressCounter+=1,this.updateIndicator(),this.timeoutMessageId&&(window.clearTimeout(this.timeoutMessageId),this.timeoutMessageId=null),this.keypressCounter>=3?(this.keypressCounter=0,this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.textContent=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.textContent=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey)}setKeypressTimer(){this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=window.setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)}resetKeypressTimer(){if(!this.$updateSpan)return;this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null);const t=this.$updateSpan;this.keypressCounter=0,t.textContent=this.i18n.t("timedOut"),this.timeoutMessageId=window.setTimeout((()=>{t.textContent=""}),this.timeoutTime),this.updateIndicator()}resetPage(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan&&(this.$updateSpan.setAttribute("role","status"),this.$updateSpan.textContent=""),this.updateIndicator(),this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&window.clearTimeout(this.timeoutMessageId)}}ExitThisPage.moduleName="govuk-exit-this-page",ExitThisPage.defaults=Object.freeze({i18n:{activated:"Loading.",timedOut:"Exit this page expired.",pressTwoMoreTimes:"Shift, press 2 more times to exit.",pressOneMoreTime:"Shift, press 1 more time to exit."}}),ExitThisPage.schema=Object.freeze({properties:{i18n:{type:"object"}}});class FileUpload extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.$label=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const i=this.$root.querySelector('input[type="file"]');if(null===i)throw new ElementError({component:FileUpload,identifier:'File inputs (`<input type="file">`)'});if(this.$input=i,!this.$input.id)throw new ElementError({component:FileUpload,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")});const n=this.findLabel();n.id||(n.id=`${this.id}-label`),this.$label=n,this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","hidden"),this.$status=this.createStatus(),this.$button=this.createButton(),this.$root.insertAdjacentElement("afterbegin",this.$button),this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.bindDraggingEvents()}createStatus(){const t=document.createElement("span");return t.className="govuk-body govuk-file-upload-button__status",t.setAttribute("aria-live","polite"),t.innerText=this.i18n.t("noFileChosen"),t}createButton(){const t=document.createElement("button");t.classList.add("govuk-file-upload-button"),t.type="button",t.id=this.id,t.classList.add("govuk-file-upload-button--empty");const e=this.$input.getAttribute("aria-describedby");e&&t.setAttribute("aria-describedby",e),t.appendChild(this.$status);const i=document.createElement("span");i.className="govuk-visually-hidden",i.innerText=", ",i.id=`${this.id}-comma`,t.appendChild(i);const n=document.createElement("span");n.className="govuk-file-upload-button__pseudo-button-container";const s=document.createElement("span");s.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",s.innerText=this.i18n.t("chooseFilesButton"),n.appendChild(s),n.insertAdjacentText("beforeend"," ");const o=document.createElement("span");return o.className="govuk-body govuk-file-upload-button__instruction",o.innerText=this.i18n.t("dropInstruction"),n.appendChild(o),t.appendChild(n),t.setAttribute("aria-labelledby",`${this.$label.id} ${i.id} ${t.id}`),t.addEventListener("click",this.onClick.bind(this)),t.addEventListener("dragover",(t=>{t.preventDefault()})),t}bindDraggingEvents(){this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",(()=>{this.enteredAnotherElement=!0})),document.addEventListener("dragleave",(()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1}))}updateDropzoneVisibility(t){this.$button.disabled||t.target instanceof Node&&(this.$root.contains(t.target)?t.dataTransfer&&this.canDrop(t.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(t){t.preventDefault(),t.dataTransfer&&this.canFillInput(t.dataTransfer)&&(this.$input.files=t.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(t){return this.matchesInputCapacity(t.files.length)}canDrop(t){return t.items.length?this.matchesInputCapacity(function(t){let e=0;for(let i=0;i<t.length;i++)"file"===t[i].kind&&e++;return e}(t.items)):!t.types.length||t.types.includes("Files")}matchesInputCapacity(t){return this.$input.multiple?t>0:1===t}onChange(){const t=this.$input.files.length;0===t?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===t?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:t}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const t=document.querySelector(`label[for="${this.$input.id}"]`);if(!t)throw new ElementError({component:FileUpload,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return t}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver((t=>{for(const e of t)"attributes"===e.type&&"disabled"===e.attributeName&&this.updateDisabledState()})).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-file-upload-wrapper--disabled",this.$button.disabled)}}FileUpload.moduleName="govuk-file-upload",FileUpload.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),FileUpload.schema=Object.freeze({properties:{i18n:{type:"object"}}});class NotificationBanner extends ConfigurableComponent{constructor(t,e={}){super(t,e),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||setFocus(this.$root)}}NotificationBanner.moduleName="govuk-notification-banner",NotificationBanner.defaults=Object.freeze({disableAutoFocus:!1}),NotificationBanner.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class PasswordInput extends ConfigurableComponent{constructor(t,e={}){super(t,e),this.i18n=void 0,this.$input=void 0,this.$showHideButton=void 0,this.$screenReaderStatusMessage=void 0;const i=this.$root.querySelector(".govuk-js-password-input-input");if(!(i instanceof HTMLInputElement))throw new ElementError({component:PasswordInput,element:i,expectedType:"HTMLInputElement",identifier:"Form field (`.govuk-js-password-input-input`)"});if("password"!==i.type)throw new ElementError("Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.");const n=this.$root.querySelector(".govuk-js-password-input-toggle");if(!(n instanceof HTMLButtonElement))throw new ElementError({component:PasswordInput,element:n,expectedType:"HTMLButtonElement",identifier:"Button (`.govuk-js-password-input-toggle`)"});if("button"!==n.type)throw new ElementError("Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.");this.$input=i,this.$showHideButton=n,this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.$showHideButton.removeAttribute("hidden");const s=document.createElement("div");s.className="govuk-password-input__sr-status govuk-visually-hidden",s.setAttribute("aria-live","polite"),this.$screenReaderStatusMessage=s,this.$input.insertAdjacentElement("afterend",s),this.$showHideButton.addEventListener("click",this.toggle.bind(this)),this.$input.form&&this.$input.form.addEventListener("submit",(()=>this.hide())),window.addEventListener("pageshow",(t=>{t.persisted&&"password"!==this.$input.type&&this.hide()})),this.hide()}toggle(t){t.preventDefault(),"password"!==this.$input.type?this.hide():this.show()}show(){this.setType("text")}hide(){this.setType("password")}setType(t){if(t===this.$input.type)return;this.$input.setAttribute("type",t);const e="password"===t,i=e?"show":"hide",n=e?"passwordHidden":"passwordShown";this.$showHideButton.innerText=this.i18n.t(`${i}Password`),this.$showHideButton.setAttribute("aria-label",this.i18n.t(`${i}PasswordAriaLabel`)),this.$screenReaderStatusMessage.innerText=this.i18n.t(`${n}Announcement`)}}PasswordInput.moduleName="govuk-password-input",PasswordInput.defaults=Object.freeze({i18n:{showPassword:"Show",hidePassword:"Hide",showPasswordAriaLabel:"Show password",hidePasswordAriaLabel:"Hide password",passwordShownAnnouncement:"Your password is visible",passwordHiddenAnnouncement:"Your password is hidden"}}),PasswordInput.schema=Object.freeze({properties:{i18n:{type:"object"}}});class Radios extends Component{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="radio"]');if(!e.length)throw new ElementError({component:Radios,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Radios,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const i=document.getElementById(e);if(null!=i&&i.classList.contains("govuk-radios__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),i.classList.toggle("govuk-radios__conditional--hidden",!e)}}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"radio"!==e.type)return;const i=document.querySelectorAll('input[type="radio"][aria-controls]'),n=e.form,s=e.name;i.forEach((t=>{const e=t.form===n;t.name===s&&e&&this.syncConditionalRevealWithInputState(t)}))}}Radios.moduleName="govuk-radios";class ServiceNavigation extends Component{constructor(t){super(t),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const e=this.$root.querySelector(".govuk-js-service-navigation-toggle");if(!e)return this;const i=e.getAttribute("aria-controls");if(!i)throw new ElementError({component:ServiceNavigation,identifier:'Navigation button (`<button class="govuk-js-service-navigation-toggle">`) attribute (`aria-controls`)'});const n=document.getElementById(i);if(!n)throw new ElementError({component:ServiceNavigation,element:n,identifier:`Navigation (\`<ul id="${i}">\`)`});this.$menu=n,this.$menuButton=e,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",(()=>this.handleMenuButtonClick()))}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:ServiceNavigation,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),function(t,e){for(const i in e)t.setAttribute(i,e[i])}(this.$menuButton,e)):(!function(t,e){for(const i of e)t.removeAttribute(i)}(this.$menuButton,Object.keys(e)),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}ServiceNavigation.moduleName="govuk-service-navigation";const e={hidden:"","aria-hidden":"true"};class SkipLink extends Component{constructor(t){var e;super(t);const i=this.$root.hash,n=null!=(e=this.$root.getAttribute("href"))?e:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const s=i.replace("#","");if(!s)throw new ElementError(`Skip link: Target link (\`href="${n}"\`) has no hash fragment`);const o=document.getElementById(s);if(!o)throw new ElementError({component:SkipLink,element:o,identifier:`Target content (\`id="${s}"\`)`});this.$root.addEventListener("click",(()=>setFocus(o,{onBeforeFocus(){o.classList.add("govuk-skip-link-focused-element")},onBlur(){o.classList.remove("govuk-skip-link-focused-element")}})))}}SkipLink.elementType=HTMLAnchorElement,SkipLink.moduleName="govuk-skip-link";class Tabs extends Component{constructor(t){super(t),this.$tabs=void 0,this.$tabList=void 0,this.$tabListItems=void 0,this.jsHiddenClass="govuk-tabs__panel--hidden",this.changingHash=!1,this.boundTabClick=void 0,this.boundTabKeydown=void 0,this.boundOnHashChange=void 0,this.mql=null;const e=this.$root.querySelectorAll("a.govuk-tabs__tab");if(!e.length)throw new ElementError({component:Tabs,identifier:'Links (`<a class="govuk-tabs__tab">`)'});this.$tabs=e,this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this);const i=this.$root.querySelector(".govuk-tabs__list"),n=this.$root.querySelectorAll("li.govuk-tabs__list-item");if(!i)throw new ElementError({component:Tabs,identifier:'List (`<ul class="govuk-tabs__list">`)'});if(!n.length)throw new ElementError({component:Tabs,identifier:'List items (`<li class="govuk-tabs__list-item">`)'});this.$tabList=i,this.$tabListItems=n,this.setupResponsiveChecks()}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:Tabs,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){var t;null!=(t=this.mql)&&t.matches?this.setup():this.teardown()}setup(){var t;this.$tabList.setAttribute("role","tablist"),this.$tabListItems.forEach((t=>{t.setAttribute("role","presentation")})),this.$tabs.forEach((t=>{this.setAttributes(t),t.addEventListener("click",this.boundTabClick,!0),t.addEventListener("keydown",this.boundTabKeydown,!0),this.hideTab(t)}));const e=null!=(t=this.getTab(window.location.hash))?t:this.$tabs[0];this.showTab(e),window.addEventListener("hashchange",this.boundOnHashChange,!0)}teardown(){this.$tabList.removeAttribute("role"),this.$tabListItems.forEach((t=>{t.removeAttribute("role")})),this.$tabs.forEach((t=>{t.removeEventListener("click",this.boundTabClick,!0),t.removeEventListener("keydown",this.boundTabKeydown,!0),this.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0)}onHashChange(){const t=window.location.hash,e=this.getTab(t);if(!e)return;if(this.changingHash)return void(this.changingHash=!1);const i=this.getCurrentTab();i&&(this.hideTab(i),this.showTab(e),e.focus())}hideTab(t){this.unhighlightTab(t),this.hidePanel(t)}showTab(t){this.highlightTab(t),this.showPanel(t)}getTab(t){return this.$root.querySelector(`a.govuk-tabs__tab[href="${t}"]`)}setAttributes(t){const e=t.hash.replace("#","");if(!e)return;t.setAttribute("id",`tab_${e}`),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");const i=this.getPanel(t);i&&(i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",t.id),i.classList.add(this.jsHiddenClass))}unsetAttributes(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");const e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))}onTabClick(t){const e=this.getCurrentTab(),i=t.currentTarget;e&&i instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(i),this.createHistoryEntry(i))}createHistoryEntry(t){const e=this.getPanel(t);if(!e)return;const i=e.id;e.id="",this.changingHash=!0,window.location.hash=i,e.id=i}onTabKeydown(t){switch(t.key){case"ArrowLeft":case"Left":this.activatePreviousTab(),t.preventDefault();break;case"ArrowRight":case"Right":this.activateNextTab(),t.preventDefault()}}activateNextTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.nextElementSibling;if(!e)return;const i=e.querySelector("a.govuk-tabs__tab");i&&(this.hideTab(t),this.showTab(i),i.focus(),this.createHistoryEntry(i))}activatePreviousTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.previousElementSibling;if(!e)return;const i=e.querySelector("a.govuk-tabs__tab");i&&(this.hideTab(t),this.showTab(i),i.focus(),this.createHistoryEntry(i))}getPanel(t){const e=t.hash.replace("#","");return e?this.$root.querySelector(`#${e}`):null}showPanel(t){const e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)}hidePanel(t){const e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)}unhighlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))}highlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))}getCurrentTab(){return this.$root.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")}}function initAll(t={}){const e=isObject(t)?t:{},i=normaliseOptions(t);try{if(!isSupported())throw new SupportError;if(null===i.scope)throw new ElementError({element:i.scope,identifier:"GOV.UK Frontend scope element (`$scope`)"})}catch(n){return void(i.onError?i.onError(n,{config:e}):console.log(n))}[[Accordion,e.accordion],[Button,e.button],[CharacterCount,e.characterCount],[Checkboxes],[ErrorSummary,e.errorSummary],[ExitThisPage,e.exitThisPage],[FileUpload,e.fileUpload],[NotificationBanner,e.notificationBanner],[PasswordInput,e.passwordInput],[Radios],[ServiceNavigation],[SkipLink],[Tabs]].forEach((([Component,t])=>{createAll(Component,t,i)}))}function createAll(Component,t,e){let i;const n=normaliseOptions(e);try{var s;if(!isSupported())throw new SupportError;if(null===n.scope)throw new ElementError({element:n.scope,component:Component,identifier:"Scope element (`$scope`)"});i=null==(s=n.scope)?void 0:s.querySelectorAll(`[data-module="${Component.moduleName}"]`)}catch(o){return n.onError?n.onError(o,{component:Component,config:t}):console.log(o),[]}return Array.from(null!=i?i:[]).map((e=>{try{return void 0!==t?new Component(e,t):new Component(e)}catch(o){return n.onError?n.onError(o,{element:e,component:Component,config:t}):console.log(o),null}})).filter(Boolean)}Tabs.moduleName="govuk-tabs";export{Accordion,Button,CharacterCount,Checkboxes,Component,ConfigurableComponent,ErrorSummary,ExitThisPage,FileUpload,NotificationBanner,PasswordInput,Radios,ServiceNavigation,SkipLink,Tabs,createAll,initAll,isSupported,version};//# sourceMappingURL=govuk-frontend.min.js.map
|
data/package-lock.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"name": "tech-docs-gem",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"govuk-frontend": "
|
|
10
|
+
"govuk-frontend": "6.5.0",
|
|
11
11
|
"nunjucks": "~3.2.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
@@ -259,9 +259,9 @@
|
|
|
259
259
|
"license": "MIT"
|
|
260
260
|
},
|
|
261
261
|
"node_modules/acorn": {
|
|
262
|
-
"version": "8.
|
|
263
|
-
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.
|
|
264
|
-
"integrity": "sha512-
|
|
262
|
+
"version": "8.19.0",
|
|
263
|
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz",
|
|
264
|
+
"integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==",
|
|
265
265
|
"dev": true,
|
|
266
266
|
"license": "MIT",
|
|
267
267
|
"bin": {
|
|
@@ -1470,14 +1470,14 @@
|
|
|
1470
1470
|
}
|
|
1471
1471
|
},
|
|
1472
1472
|
"node_modules/eslint-plugin-n/node_modules/resolve": {
|
|
1473
|
-
"version": "1.22.
|
|
1474
|
-
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.
|
|
1475
|
-
"integrity": "sha512-
|
|
1473
|
+
"version": "1.22.13",
|
|
1474
|
+
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz",
|
|
1475
|
+
"integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==",
|
|
1476
1476
|
"dev": true,
|
|
1477
1477
|
"license": "MIT",
|
|
1478
1478
|
"dependencies": {
|
|
1479
1479
|
"es-errors": "^1.3.0",
|
|
1480
|
-
"is-core-module": "^2.
|
|
1480
|
+
"is-core-module": "^2.17.0",
|
|
1481
1481
|
"path-parse": "^1.0.7",
|
|
1482
1482
|
"supports-preserve-symlinks-flag": "^1.0.0"
|
|
1483
1483
|
},
|
|
@@ -2079,9 +2079,9 @@
|
|
|
2079
2079
|
}
|
|
2080
2080
|
},
|
|
2081
2081
|
"node_modules/govuk-frontend": {
|
|
2082
|
-
"version": "6.5.
|
|
2083
|
-
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-6.5.
|
|
2084
|
-
"integrity": "sha512-
|
|
2082
|
+
"version": "6.5.0",
|
|
2083
|
+
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-6.5.0.tgz",
|
|
2084
|
+
"integrity": "sha512-yWZZCvv99Q0WzPC3+YszHk65Op1yowXpvbGGPi2bsoZiHKfwQGRxOoCaYBWTIOAiphp4QRTFgbGI3fpiFTfZww==",
|
|
2085
2085
|
"license": "MIT",
|
|
2086
2086
|
"engines": {
|
|
2087
2087
|
"node": ">= 4.2.0"
|
|
@@ -2386,13 +2386,13 @@
|
|
|
2386
2386
|
}
|
|
2387
2387
|
},
|
|
2388
2388
|
"node_modules/is-core-module": {
|
|
2389
|
-
"version": "2.
|
|
2390
|
-
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.
|
|
2391
|
-
"integrity": "sha512-
|
|
2389
|
+
"version": "2.17.0",
|
|
2390
|
+
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz",
|
|
2391
|
+
"integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==",
|
|
2392
2392
|
"dev": true,
|
|
2393
2393
|
"license": "MIT",
|
|
2394
2394
|
"dependencies": {
|
|
2395
|
-
"hasown": "^2.0.
|
|
2395
|
+
"hasown": "^2.0.4"
|
|
2396
2396
|
},
|
|
2397
2397
|
"engines": {
|
|
2398
2398
|
"node": ">= 0.4"
|
|
@@ -2966,9 +2966,9 @@
|
|
|
2966
2966
|
}
|
|
2967
2967
|
},
|
|
2968
2968
|
"node_modules/lru-cache": {
|
|
2969
|
-
"version": "11.5.
|
|
2970
|
-
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.
|
|
2971
|
-
"integrity": "sha512-
|
|
2969
|
+
"version": "11.5.3",
|
|
2970
|
+
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
|
|
2971
|
+
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
|
|
2972
2972
|
"dev": true,
|
|
2973
2973
|
"license": "BlueOak-1.0.0",
|
|
2974
2974
|
"engines": {
|
|
@@ -3899,9 +3899,9 @@
|
|
|
3899
3899
|
}
|
|
3900
3900
|
},
|
|
3901
3901
|
"node_modules/selenium-webdriver": {
|
|
3902
|
-
"version": "4.
|
|
3903
|
-
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.
|
|
3904
|
-
"integrity": "sha512-
|
|
3902
|
+
"version": "4.51.0",
|
|
3903
|
+
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.51.0.tgz",
|
|
3904
|
+
"integrity": "sha512-2FY/x+THHk9uWj+WLBib0r+53D1G0pidox796H5AfbRHhJdPc7CVQPNJi31ip1Tb9duBYRw0zX0wJovnbwSDHg==",
|
|
3905
3905
|
"dev": true,
|
|
3906
3906
|
"funding": [
|
|
3907
3907
|
{
|
|
@@ -3916,9 +3916,9 @@
|
|
|
3916
3916
|
"license": "Apache-2.0",
|
|
3917
3917
|
"dependencies": {
|
|
3918
3918
|
"@bazel/runfiles": "^6.5.0",
|
|
3919
|
-
"jszip": "^3.10.
|
|
3919
|
+
"jszip": "^3.10.2",
|
|
3920
3920
|
"tmp": "^0.2.7",
|
|
3921
|
-
"ws": "^8.
|
|
3921
|
+
"ws": "^8.22.0"
|
|
3922
3922
|
},
|
|
3923
3923
|
"engines": {
|
|
3924
3924
|
"node": ">= 22.0.0"
|
|
@@ -4508,19 +4508,18 @@
|
|
|
4508
4508
|
}
|
|
4509
4509
|
},
|
|
4510
4510
|
"node_modules/typed-array-byte-offset": {
|
|
4511
|
-
"version": "1.0.
|
|
4512
|
-
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.
|
|
4513
|
-
"integrity": "sha512-
|
|
4511
|
+
"version": "1.0.5",
|
|
4512
|
+
"resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.5.tgz",
|
|
4513
|
+
"integrity": "sha512-0FHJvLPqZ7KJzp17O13jfsAjsqazgrxBu2zEK95PmUz8lv2+GjRuxUInCr2Rk9Dms3ihN21zJ929ZO43yJ95QQ==",
|
|
4514
4514
|
"dev": true,
|
|
4515
4515
|
"license": "MIT",
|
|
4516
4516
|
"dependencies": {
|
|
4517
4517
|
"available-typed-arrays": "^1.0.7",
|
|
4518
|
-
"call-bind": "^1.0.
|
|
4519
|
-
"for-each": "^0.3.
|
|
4518
|
+
"call-bind": "^1.0.9",
|
|
4519
|
+
"for-each": "^0.3.5",
|
|
4520
4520
|
"gopd": "^1.2.0",
|
|
4521
|
-
"has-proto": "^1.2.0",
|
|
4522
4521
|
"is-typed-array": "^1.1.15",
|
|
4523
|
-
"reflect.getprototypeof": "^1.0.
|
|
4522
|
+
"reflect.getprototypeof": "^1.0.10"
|
|
4524
4523
|
},
|
|
4525
4524
|
"engines": {
|
|
4526
4525
|
"node": ">= 0.4"
|
|
@@ -4687,9 +4686,9 @@
|
|
|
4687
4686
|
}
|
|
4688
4687
|
},
|
|
4689
4688
|
"node_modules/which-typed-array": {
|
|
4690
|
-
"version": "1.1.
|
|
4691
|
-
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.
|
|
4692
|
-
"integrity": "sha512-
|
|
4689
|
+
"version": "1.1.24",
|
|
4690
|
+
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.24.tgz",
|
|
4691
|
+
"integrity": "sha512-wk4Mf4pR5mRP7eYuuTBCIQ9d0ud2Fv2jRLQpfgnRjbOxAFHmjKFValgTpitVKzJJS8ajnYQV2Du1SZ8j6b/EUQ==",
|
|
4693
4692
|
"dev": true,
|
|
4694
4693
|
"license": "MIT",
|
|
4695
4694
|
"dependencies": {
|
|
@@ -4726,9 +4725,9 @@
|
|
|
4726
4725
|
"license": "ISC"
|
|
4727
4726
|
},
|
|
4728
4727
|
"node_modules/ws": {
|
|
4729
|
-
"version": "8.
|
|
4730
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.
|
|
4731
|
-
"integrity": "sha512-
|
|
4728
|
+
"version": "8.22.0",
|
|
4729
|
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",
|
|
4730
|
+
"integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",
|
|
4732
4731
|
"dev": true,
|
|
4733
4732
|
"license": "MIT",
|
|
4734
4733
|
"engines": {
|
data/package.json
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_tech_docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.5.1.test
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Government Digital Service
|
|
@@ -543,6 +543,8 @@ files:
|
|
|
543
543
|
- lib/source/layouts/_analytics_ga4_gtm.erb
|
|
544
544
|
- lib/source/layouts/_cookie_banner.erb
|
|
545
545
|
- lib/source/layouts/_footer.erb
|
|
546
|
+
- lib/source/layouts/_govuk_footer.erb
|
|
547
|
+
- lib/source/layouts/_govuk_header.erb
|
|
546
548
|
- lib/source/layouts/_header.erb
|
|
547
549
|
- lib/source/layouts/_page_review.erb
|
|
548
550
|
- lib/source/layouts/_search.erb
|