@visitscotland/component-library 3.0.3 → 3.0.4

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +1695 -0
  2. package/dist/client/manifest.json +51 -54
  3. package/dist/client/scripts/54bee03d4647544c11f5.js +1 -0
  4. package/dist/client/scripts/{ce3e6734cb84e74451cd.js → 6207179e793d6e2f8d9e.js} +1 -1
  5. package/dist/client/scripts/6b53edbec946bee62d26.js +1 -0
  6. package/dist/client/scripts/{31f9d972fa4753eaee60.js → 8e0a1eb35d5006bcaf29.js} +1 -1
  7. package/dist/client/scripts/8e3fa387146c24502ada.js +1 -0
  8. package/dist/client/scripts/{83e6099b792b76d2ee7f.js → 9101e0f2b766ea15df2e.js} +1 -1
  9. package/dist/client/scripts/{b6a50a2b854d09970111.js → bef607c592b6cb0a9124.js} +1 -1
  10. package/dist/client/scripts/{1ce57deef9f60d08e168.js → dbefa7802bf2a65b8a37.js} +1 -1
  11. package/dist/client/scripts/{8751d1ac21308fc7e78b.js → ee1669cbdcce1bd4b354.js} +1 -1
  12. package/dist/client/scripts/{43310958bc4363082dd8.js → f35abe8b7b5ef124937e.js} +1 -1
  13. package/dist/client/scripts/{8fc24289899913dd4b9c.js → fea0e33760eef6a2afcc.js} +1 -1
  14. package/dist/client/styles/{37a9f1240efe0ca78ea6.css → 4b4417e0ec7c6d38af51.css} +1 -1
  15. package/dist/client/styles/{c01ba1121e07f8275c28.css → 54bee03d4647544c11f5.css} +1 -1
  16. package/dist/client/styles/{ce3e6734cb84e74451cd.css → 6207179e793d6e2f8d9e.css} +1 -1
  17. package/dist/client/styles/{f304d9429842a3472c24.css → 8e3fa387146c24502ada.css} +1 -1
  18. package/dist/client/styles/{7f0830b7d5e434d7a977.css → a4bf5693a18f72023719.css} +1 -1
  19. package/dist/client/styles/{1ce57deef9f60d08e168.css → dbefa7802bf2a65b8a37.css} +1 -1
  20. package/dist/client/styles/{70ed495c15ada9f41f04.css → ec0a9a2c688a656c0695.css} +1 -1
  21. package/dist/client/styles/third-party/_cludo-search-results.css +1 -1
  22. package/dist/client/styles/third-party/_font-awesome.css +1 -1
  23. package/dist/components/components/form/Form.vue.d.ts +1 -0
  24. package/dist/components/icons.css +1 -1
  25. package/dist/components/vs-component-library.css +1 -1
  26. package/dist/components/vs-component-library.js +215 -180
  27. package/dist/components/vs-component-library.mjs +18269 -10977
  28. package/dist/ssr/index.js +1 -1
  29. package/dist/ssr/manifest.json +1 -1
  30. package/dist/ssr/styles/{8d13415be9d7633cf1b5.css → 8df2da33c2482bedd1e8.css} +7 -7
  31. package/package.json +230 -231
  32. package/dist/client/scripts/5d2e8fcc89de9881e3f0.js +0 -1
  33. package/dist/client/scripts/86ef112affb6b291623a.js +0 -1
  34. package/dist/client/scripts/c01ba1121e07f8275c28.js +0 -1
  35. package/dist/client/scripts/f304d9429842a3472c24.js +0 -1
  36. package/dist/components/components/map/Map.vue.d.ts +0 -370
  37. package/dist/components/components/map/components/MapMarker.vue.d.ts +0 -87
  38. package/dist/components/components/map-marker-icon/MapMarkerIcon.vue.d.ts +0 -50
  39. package/dist/components/components/map-with-sidebar/MapWithSidebar.vue.d.ts +0 -366
  40. package/dist/components/components/map-with-sidebar/components/MapWithSidebarButtons.vue.d.ts +0 -39
  41. package/dist/components/components/map-with-sidebar/components/MapWithSidebarCategory.vue.d.ts +0 -57
  42. package/dist/components/components/map-with-sidebar/components/MapWithSidebarControls.vue.d.ts +0 -16
  43. package/dist/components/components/map-with-sidebar/components/MapWithSidebarDetail.vue.d.ts +0 -36
  44. package/dist/components/components/map-with-sidebar/components/MapWithSidebarListItem.vue.d.ts +0 -65
  45. package/dist/components/components/map-with-sidebar/components/MapWithSidebarPanel.vue.d.ts +0 -274
  46. package/dist/components/components/map-with-sidebar/components/MapWithSidebarSubcategory.vue.d.ts +0 -35
  47. package/dist/components/maps.css +0 -1
  48. package/dist/components/maps.js +0 -508
  49. package/dist/components/maps.mjs +0 -20815
  50. package/dist/components/v4-Dx4zqkIC.mjs +0 -7197
  51. package/dist/components/v4-tWlzORDj.js +0 -36
  52. package/dist/components/v4.css +0 -1
  53. /package/dist/client/scripts/{37a9f1240efe0ca78ea6.js → 4b4417e0ec7c6d38af51.js} +0 -0
  54. /package/dist/client/scripts/{7f0830b7d5e434d7a977.js → a4bf5693a18f72023719.js} +0 -0
  55. /package/dist/client/scripts/{70ed495c15ada9f41f04.js → ec0a9a2c688a656c0695.js} +0 -0
  56. /package/dist/client/styles/{5d2e8fcc89de9881e3f0.css → 6b53edbec946bee62d26.css} +0 -0
  57. /package/dist/client/styles/{31f9d972fa4753eaee60.css → 8e0a1eb35d5006bcaf29.css} +0 -0
  58. /package/dist/client/styles/{8751d1ac21308fc7e78b.css → ee1669cbdcce1bd4b354.css} +0 -0
  59. /package/dist/client/styles/{8fc24289899913dd4b9c.css → fea0e33760eef6a2afcc.css} +0 -0
package/package.json CHANGED
@@ -1,231 +1,230 @@
1
- {
2
- "name": "@visitscotland/component-library",
3
- "version": "3.0.3",
4
- "description": "VisitScotland Component Library",
5
- "author": "VisitScotland",
6
- "homepage": "https://github.com/visitscotland/vs-component-library#readme",
7
- "files": [
8
- "dist"
9
- ],
10
- "exports": {
11
- ".": {
12
- "require": "./dist/ssr/index.js"
13
- },
14
- "./components": {
15
- "import": "./dist/components/vs-component-library.mjs",
16
- "require": "./dist/components/vs-component-library.umd.js",
17
- "types": "./dist/components/component-entry.d.ts"
18
- },
19
- "./maps": {
20
- "import": "./dist/components/maps.mjs"
21
- },
22
- "./components/style.css": "./dist/components/vs-component-library.css",
23
- "./components/fonts.css": "./dist/components/fonts.css",
24
- "./components/icons.css": "./dist/components/icons.css"
25
- },
26
- "license": "MIT",
27
- "scripts": {
28
- "storybook": "yarn theo && storybook dev -p 6006",
29
- "build-storybook": "yarn theo && storybook build",
30
- "build": "yarn theo && npm-run-all build:library build:ssr third-party build:vite",
31
- "build:dev": "yarn theo && npm-run-all build:library:dev build:ssr:dev third-party",
32
- "build:library": "cross-env NODE_ENV=production webpack --config ./build/webpack.conf.js",
33
- "build:library:dev": "cross-env NODE_ENV=development webpack --config ./build/webpack.conf.js",
34
- "build:ssr": "cross-env NODE_ENV=production webpack --config ./build/webpack.ssr.conf.js",
35
- "build:ssr:dev": "cross-env NODE_ENV=development webpack --config ./build/webpack.ssr.conf.js",
36
- "build:vite": "yarn theo && vite build",
37
- "build:vite-no-theo": "vite build",
38
- "test": "yarn theo && jest --config ./test/unit/jest.conf.js",
39
- "test:no-theo": "jest --config ./test/unit/jest.conf.js",
40
- "lint": "eslint",
41
- "lint:all": "yarn lint:src && yarn lint:build && yarn lint:stories",
42
- "lint:src": "yarn lint \"src/**/*.{js,vue,ts}\"",
43
- "lint:build": "yarn lint \"build/*.{js,vue,ts}\"",
44
- "lint:stories": "yarn lint \"stories/**/*.{js,vue,ts}\"",
45
- "lint:fix": "yarn lint \"src/**/*.{js,vue,ts}\" \"stories/**/*.js\" --fix",
46
- "prettier": "prettier . --list-different",
47
- "theo": "theo ./src/tokens/tokens.yml --transform web --format map.scss,scss,raw.json,json --dest ./src/assets/tokens",
48
- "third-party": "webpack --config ./build/third-party.webpack.conf.js",
49
- "commit": "cz",
50
- "prepare": "husky install",
51
- "prepublishOnly": "yarn build",
52
- "release:patch": "standard-version --release-as patch",
53
- "release:minor": "standard-version --release-as minor",
54
- "release:major": "standard-version --release-as major"
55
- },
56
- "lint-staged": {
57
- "*.{js,vue,ts}": "eslint"
58
- },
59
- "repository": {
60
- "type": "git",
61
- "url": "https://github.com/visitscotland/vs-component-library.git"
62
- },
63
- "keywords": [
64
- "vue.js",
65
- "visit scotland",
66
- "vue",
67
- "design system",
68
- "design",
69
- "system"
70
- ],
71
- "devDependencies": {
72
- "@babel/core": "^7.23.2",
73
- "@babel/eslint-parser": "^7.21.8",
74
- "@babel/plugin-proposal-class-properties": "^7.10.4",
75
- "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
76
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
77
- "@babel/plugin-transform-runtime": "^7.23.2",
78
- "@babel/polyfill": "^7.10.4",
79
- "@babel/preset-env": "^7.23.2",
80
- "@babel/preset-react": "7.12.13",
81
- "@chromatic-com/storybook": "^1.3.4",
82
- "@originjs/vite-plugin-require-context": "^1.0.9",
83
- "@rushstack/eslint-patch": "^1.3.0",
84
- "@storybook/addon-a11y": "^8.0.10",
85
- "@storybook/addon-essentials": "^8.0.10",
86
- "@storybook/addon-interactions": "^8.0.10",
87
- "@storybook/addon-links": "^8.0.10",
88
- "@storybook/blocks": "8.0.10",
89
- "@storybook/vue3": "^8.0.10",
90
- "@storybook/vue3-vite": "^8.0.10",
91
- "@typescript-eslint/eslint-plugin": "^5.59.8",
92
- "@typescript-eslint/parser": "^5.59.8",
93
- "@vitejs/plugin-vue": "^5.0.4",
94
- "@vue/eslint-config-airbnb": "^7.0.0",
95
- "@vue/test-utils": "^2.3.2",
96
- "@vue/vue3-jest": "^29.2.4",
97
- "babel-jest": "^29.5.0",
98
- "babel-loader": "^9.1.2",
99
- "babel-plugin-macros": "^2.4.2",
100
- "bootstrap": "^5.3.2",
101
- "chromatic": "^6.17.3",
102
- "clean-webpack-plugin": "^4.0.0",
103
- "commitizen": "^4.3.0",
104
- "cross-env": "^7.0.3",
105
- "css-loader": "^6.7.3",
106
- "cz-conventional-changelog": "^3.3.0",
107
- "dotenv-webpack": "^8.0.1",
108
- "eslint": "^8.2.0",
109
- "eslint-import-resolver-webpack": "^0.13.2",
110
- "eslint-plugin-import": "^2.25.2",
111
- "eslint-plugin-storybook": "^0.8.0",
112
- "eslint-plugin-vue": "^9.11.1",
113
- "eslint-webpack-plugin": "^4.0.1",
114
- "file-loader": "^6.2.0",
115
- "husky": "^8.0.3",
116
- "jest": "^29.5.0",
117
- "jest-axe": "^8.0.0",
118
- "jest-environment-jsdom": "^29.5.0",
119
- "jest-serializer-vue": "^3.1.0",
120
- "lint-staged": "^15.2.2",
121
- "mini-css-extract-plugin": "^2.7.5",
122
- "moxios": "^0.4.0",
123
- "node-polyfill-webpack-plugin": "^2.0.1",
124
- "node-sass": "^8.0.0",
125
- "npm-run-all": "^4.1.5",
126
- "optimist": "^0.6.1",
127
- "path": "^0.12.7",
128
- "postcss-safe-parser": "^6.0.0",
129
- "prettier": "^3.2.5",
130
- "require-context.macro": "^1.2.2",
131
- "sass": "^1.62.1",
132
- "sass-loader": "^13.2.2",
133
- "speed-measure-webpack-plugin": "^1.5.0",
134
- "standard-version": "^9.5.0",
135
- "storybook": "^8.0.10",
136
- "storybook-addon-datalayer-watcher": "^1.0.2",
137
- "storybook-addon-mock": "^5.0.0",
138
- "style-loader": "^3.3.2",
139
- "svgo-loader": "^4.0.0",
140
- "theo": "^8.1.5",
141
- "time-analytics-webpack-plugin": "^0.1.20",
142
- "ts-jest": "^29.1.0",
143
- "ts-loader": "^9.4.3",
144
- "typescript": "^5.0.4",
145
- "upgrade": "^1.1.0",
146
- "vite": "^5.2.10",
147
- "vite-plugin-dts": "^3.7.2",
148
- "vite-plugin-turbosnap": "^1.0.2",
149
- "vue": "^3.4.19",
150
- "vue-jest": "^5.0.0-alpha.10",
151
- "vue-loader": "^17.1.0",
152
- "vue-style-loader": "^4.1.3",
153
- "webpack": "^5.81.0",
154
- "webpack-cli": "^5.0.2",
155
- "webpack-manifest-plugin": "^5.0.0",
156
- "webpack-merge": "^5.1.4",
157
- "webpack-node-externals": "^3.0.0"
158
- },
159
- "dependencies": {
160
- "@mapbox/geojson-extent": "^1.0.1",
161
- "@pinia/testing": "^0.1.3",
162
- "@storybook/addon-a11y": "^7.5.3",
163
- "@storybook/test": "^8.0.10",
164
- "@vuelidate/core": "^2.0.2",
165
- "@vuelidate/validators": "^2.0.2",
166
- "axios": "^1.4.0",
167
- "bootstrap-vue-next": "^0.9.20",
168
- "glob": "^8.1.0",
169
- "lodash": "^4.17.21",
170
- "mapbox-gl": "^1.11.1",
171
- "mitt": "^3.0.0",
172
- "pinia": "^2.1.3",
173
- "uuid": "^9.0.0",
174
- "vite": "^5.1.3",
175
- "vue": "^3.3.4",
176
- "vue-combo-blocks": "^2.1.1",
177
- "vue-recaptcha": "^2.0.1",
178
- "vue-youtube-vue-3": "^1.5.0",
179
- "vue3-charts": "^1.1.33",
180
- "vue3-lazy-hydration": "^1.2.1",
181
- "vue3-simple-typeahead": "^1.0.11",
182
- "vuelidate": "^0.7.7",
183
- "vuex": "^4.1.0",
184
- "webpack-merge": "^5.1.4",
185
- "webpack-node-externals": "^3.0.0"
186
- },
187
- "peerDependencies": {
188
- "@popperjs/core": "*",
189
- "postcss": "*"
190
- },
191
- "engines": {
192
- "node": ">= 16.20.0",
193
- "npm": ">= 6.14.5",
194
- "yarn": ">= 1.22.4"
195
- },
196
- "browserslist": [
197
- "> 1%",
198
- "last 2 versions",
199
- "not Explorer > 0",
200
- "IE 11",
201
- "not ExplorerMobile > 0",
202
- "not BlackBerry > 0",
203
- "not OperaMini all",
204
- "not OperaMobile > 0"
205
- ],
206
- "jest": {
207
- "testPathIgnorePatterns": [
208
- ".test",
209
- "node_modules"
210
- ],
211
- "jest.pathToJest": "node_modules/.bin/jest"
212
- },
213
- "config": {
214
- "commitizen": {
215
- "path": "./node_modules/cz-conventional-changelog"
216
- }
217
- },
218
- "bugs": {
219
- "url": "https://github.com/visitscotland/vs-component-library/issues"
220
- },
221
- "resolutions": {
222
- "minimist": "^0.2.4",
223
- "json5": "^1.0.2",
224
- "word-wrap": "^1.2.4",
225
- "highlight.js": "^10.4.1",
226
- "semver": "^7.5.4",
227
- "get-func-name": "^2.0.1",
228
- "svgo": "3.2.0"
229
- },
230
- "packageManager": "yarn@4.2.1"
231
- }
1
+ {
2
+ "name": "@visitscotland/component-library",
3
+ "version": "3.0.4",
4
+ "description": "VisitScotland Component Library",
5
+ "author": "VisitScotland",
6
+ "homepage": "https://github.com/visitscotland/vs-component-library#readme",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "require": "./dist/ssr/index.js"
13
+ },
14
+ "./components": {
15
+ "import": "./dist/components/vs-component-library.mjs",
16
+ "require": "./dist/components/vs-component-library.umd.js",
17
+ "types": "./dist/components/component-entry.d.ts"
18
+ },
19
+ "./maps": {
20
+ "import": "./dist/components/maps.mjs"
21
+ },
22
+ "./components/style.css": "./dist/components/vs-component-library.css",
23
+ "./components/fonts.css": "./dist/components/fonts.css",
24
+ "./components/icons.css": "./dist/components/icons.css"
25
+ },
26
+ "license": "MIT",
27
+ "scripts": {
28
+ "storybook": "yarn theo && storybook dev -p 6006",
29
+ "build-storybook": "yarn theo && storybook build",
30
+ "build": "yarn theo && npm-run-all build:library build:ssr third-party build:vite",
31
+ "build:dev": "yarn theo && npm-run-all build:library:dev build:ssr:dev third-party",
32
+ "build:library": "cross-env NODE_ENV=production webpack --config ./build/webpack.conf.js",
33
+ "build:library:dev": "cross-env NODE_ENV=development webpack --config ./build/webpack.conf.js",
34
+ "build:ssr": "cross-env NODE_ENV=production webpack --config ./build/webpack.ssr.conf.js",
35
+ "build:ssr:dev": "cross-env NODE_ENV=development webpack --config ./build/webpack.ssr.conf.js",
36
+ "build:vite": "yarn theo && vite build",
37
+ "build:vite-no-theo": "vite build",
38
+ "test": "yarn theo && jest --config ./test/unit/jest.conf.js",
39
+ "test:no-theo": "jest --config ./test/unit/jest.conf.js",
40
+ "lint": "eslint",
41
+ "lint:all": "yarn lint:src && yarn lint:build && yarn lint:stories",
42
+ "lint:src": "yarn lint \"src/**/*.{js,vue,ts}\"",
43
+ "lint:build": "yarn lint \"build/*.{js,vue,ts}\"",
44
+ "lint:stories": "yarn lint \"stories/**/*.{js,vue,ts}\"",
45
+ "lint:fix": "yarn lint \"src/**/*.{js,vue,ts}\" \"stories/**/*.js\" --fix",
46
+ "prettier": "prettier . --list-different",
47
+ "theo": "theo ./src/tokens/tokens.yml --transform web --format map.scss,scss,raw.json,json --dest ./src/assets/tokens",
48
+ "third-party": "webpack --config ./build/third-party.webpack.conf.js",
49
+ "commit": "cz",
50
+ "prepare": "husky install",
51
+ "prepublishOnly": "yarn build",
52
+ "release:patch": "standard-version --release-as patch",
53
+ "release:minor": "standard-version --release-as minor",
54
+ "release:major": "standard-version --release-as major"
55
+ },
56
+ "lint-staged": {
57
+ "*.{js,vue,ts}": "eslint"
58
+ },
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "https://github.com/visitscotland/vs-component-library.git"
62
+ },
63
+ "keywords": [
64
+ "vue.js",
65
+ "visit scotland",
66
+ "vue",
67
+ "design system",
68
+ "design",
69
+ "system"
70
+ ],
71
+ "devDependencies": {
72
+ "@babel/core": "^7.23.2",
73
+ "@babel/eslint-parser": "^7.21.8",
74
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
75
+ "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
76
+ "@babel/plugin-syntax-dynamic-import": "^7.0.0",
77
+ "@babel/plugin-transform-runtime": "^7.23.2",
78
+ "@babel/polyfill": "^7.10.4",
79
+ "@babel/preset-env": "^7.23.2",
80
+ "@babel/preset-react": "7.12.13",
81
+ "@chromatic-com/storybook": "^1.3.4",
82
+ "@originjs/vite-plugin-require-context": "^1.0.9",
83
+ "@rushstack/eslint-patch": "^1.3.0",
84
+ "@storybook/addon-a11y": "^8.0.10",
85
+ "@storybook/addon-essentials": "^8.0.10",
86
+ "@storybook/addon-interactions": "^8.0.10",
87
+ "@storybook/addon-links": "^8.0.10",
88
+ "@storybook/blocks": "8.0.10",
89
+ "@storybook/vue3": "^8.0.10",
90
+ "@storybook/vue3-vite": "^8.0.10",
91
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
92
+ "@typescript-eslint/parser": "^5.59.8",
93
+ "@vitejs/plugin-vue": "^5.0.4",
94
+ "@vue/eslint-config-airbnb": "^7.0.0",
95
+ "@vue/test-utils": "^2.3.2",
96
+ "@vue/vue3-jest": "^29.2.4",
97
+ "babel-jest": "^29.5.0",
98
+ "babel-loader": "^9.1.2",
99
+ "babel-plugin-macros": "^2.4.2",
100
+ "bootstrap": "^5.3.2",
101
+ "chromatic": "^6.17.3",
102
+ "clean-webpack-plugin": "^4.0.0",
103
+ "commitizen": "^4.3.0",
104
+ "cross-env": "^7.0.3",
105
+ "css-loader": "^6.7.3",
106
+ "cz-conventional-changelog": "^3.3.0",
107
+ "dotenv-webpack": "^8.0.1",
108
+ "eslint": "^8.2.0",
109
+ "eslint-import-resolver-webpack": "^0.13.2",
110
+ "eslint-plugin-import": "^2.25.2",
111
+ "eslint-plugin-storybook": "^0.8.0",
112
+ "eslint-plugin-vue": "^9.11.1",
113
+ "eslint-webpack-plugin": "^4.0.1",
114
+ "file-loader": "^6.2.0",
115
+ "husky": "^8.0.3",
116
+ "jest": "^29.5.0",
117
+ "jest-axe": "^8.0.0",
118
+ "jest-environment-jsdom": "^29.5.0",
119
+ "jest-serializer-vue": "^3.1.0",
120
+ "lint-staged": "^15.2.2",
121
+ "mini-css-extract-plugin": "^2.7.5",
122
+ "moxios": "^0.4.0",
123
+ "node-polyfill-webpack-plugin": "^2.0.1",
124
+ "node-sass": "^8.0.0",
125
+ "npm-run-all": "^4.1.5",
126
+ "optimist": "^0.6.1",
127
+ "path": "^0.12.7",
128
+ "postcss-safe-parser": "^6.0.0",
129
+ "prettier": "^3.2.5",
130
+ "require-context.macro": "^1.2.2",
131
+ "sass": "^1.62.1",
132
+ "sass-loader": "^13.2.2",
133
+ "speed-measure-webpack-plugin": "^1.5.0",
134
+ "standard-version": "^9.5.0",
135
+ "storybook": "^8.0.10",
136
+ "storybook-addon-datalayer-watcher": "^1.0.2",
137
+ "storybook-addon-mock": "^5.0.0",
138
+ "style-loader": "^3.3.2",
139
+ "svgo-loader": "^4.0.0",
140
+ "theo": "^8.1.5",
141
+ "time-analytics-webpack-plugin": "^0.1.20",
142
+ "ts-jest": "^29.1.0",
143
+ "ts-loader": "^9.4.3",
144
+ "typescript": "^5.0.4",
145
+ "upgrade": "^1.1.0",
146
+ "vite": "^5.2.10",
147
+ "vite-plugin-dts": "^3.7.2",
148
+ "vite-plugin-turbosnap": "^1.0.2",
149
+ "vue": "^3.4.19",
150
+ "vue-jest": "^5.0.0-alpha.10",
151
+ "vue-loader": "^17.1.0",
152
+ "vue-style-loader": "^4.1.3",
153
+ "webpack": "^5.81.0",
154
+ "webpack-cli": "^5.0.2",
155
+ "webpack-manifest-plugin": "^5.0.0",
156
+ "webpack-merge": "^5.1.4",
157
+ "webpack-node-externals": "^3.0.0"
158
+ },
159
+ "dependencies": {
160
+ "@mapbox/geojson-extent": "^1.0.1",
161
+ "@pinia/testing": "^0.1.3",
162
+ "@storybook/addon-a11y": "^7.5.3",
163
+ "@storybook/test": "^8.0.10",
164
+ "@vuelidate/core": "^2.0.2",
165
+ "@vuelidate/validators": "^2.0.2",
166
+ "axios": "^1.4.0",
167
+ "bootstrap-vue-next": "^0.9.20",
168
+ "glob": "^8.1.0",
169
+ "lodash": "^4.17.21",
170
+ "mapbox-gl": "^1.11.1",
171
+ "mitt": "^3.0.0",
172
+ "pinia": "^2.1.3",
173
+ "vite": "^5.1.3",
174
+ "vue": "^3.3.4",
175
+ "vue-combo-blocks": "^2.1.1",
176
+ "vue-recaptcha": "^2.0.1",
177
+ "vue-youtube-vue-3": "^1.5.0",
178
+ "vue3-charts": "^1.1.33",
179
+ "vue3-lazy-hydration": "^1.2.1",
180
+ "vue3-simple-typeahead": "^1.0.11",
181
+ "vuelidate": "^0.7.7",
182
+ "vuex": "^4.1.0",
183
+ "webpack-merge": "^5.1.4",
184
+ "webpack-node-externals": "^3.0.0"
185
+ },
186
+ "peerDependencies": {
187
+ "@popperjs/core": "*",
188
+ "postcss": "*"
189
+ },
190
+ "engines": {
191
+ "node": ">= 16.20.0",
192
+ "npm": ">= 6.14.5",
193
+ "yarn": ">= 1.22.4"
194
+ },
195
+ "browserslist": [
196
+ "> 1%",
197
+ "last 2 versions",
198
+ "not Explorer > 0",
199
+ "IE 11",
200
+ "not ExplorerMobile > 0",
201
+ "not BlackBerry > 0",
202
+ "not OperaMini all",
203
+ "not OperaMobile > 0"
204
+ ],
205
+ "jest": {
206
+ "testPathIgnorePatterns": [
207
+ ".test",
208
+ "node_modules"
209
+ ],
210
+ "jest.pathToJest": "node_modules/.bin/jest"
211
+ },
212
+ "config": {
213
+ "commitizen": {
214
+ "path": "./node_modules/cz-conventional-changelog"
215
+ }
216
+ },
217
+ "bugs": {
218
+ "url": "https://github.com/visitscotland/vs-component-library/issues"
219
+ },
220
+ "resolutions": {
221
+ "minimist": "^0.2.4",
222
+ "json5": "^1.0.2",
223
+ "word-wrap": "^1.2.4",
224
+ "highlight.js": "^10.4.1",
225
+ "semver": "^7.5.4",
226
+ "get-func-name": "^2.0.1",
227
+ "svgo": "3.2.0"
228
+ },
229
+ "packageManager": "yarn@4.2.1"
230
+ }
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VsForm=t():e.VsForm=t()}(self,(function(){return(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[1736],{91929:function(){},97272:function(e,t,n){"use strict";var i=n(64467),a=n(3453),r=n(34352),s=n(57536),o=n(88620),l=n(22142),d=n(51688),u=n(26358),f=n(88258),c=n(48836),g=n(13838),h=n(79122),m=n(98745);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,i.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.A={name:"VsForm",status:"prototype",release:"0.0.1",components:{VsInput:l.default,VsSelect:d.default,VsCheckbox:u.default,BFormGroup:r.a3,VsRecaptcha:f.default,VsButton:c.default,VsHeading:g.default,VsWarning:h.default},mixins:[m.default],props:{isMarketo:{type:Boolean,default:!0},submitUrl:{type:String,default:""},dataUrl:{type:String,required:!0},recaptchaKey:{type:String,default:(0,o.A)("RECAPTCHA_TOKEN")},recaptchaTextareaLabel:{type:String,default:"Does not need any text"},isProd:{type:Boolean,default:!1},munchkinId:{type:String,required:!0},marketoInstance:{type:String,required:!0},language:{type:String,default:"en"},messagingUrl:{type:String,required:!0},countryListUrl:{type:String,default:""},isTest:{type:Boolean,default:!0}},data:function(){return{submitted:!1,submitting:!1,submitError:!1,formData:{},messagingData:{},form:{},formIsInvalid:!1,showErrorMessage:!1,errorFields:[],triggerValidate:!1,recaptchaVerified:!1,conditionalFields:{},inputVal:"",reAlertErrors:!1}},computed:{formId:function(){return this.isProd?this.formData.formLiveId:this.formData.formSandboxId},showFormHeading:function(){return!this.isUndefined(this.getTranslatedContent)&&!this.isUndefined(this.getTranslatedContent("heading"))}},created:function(){this.getFormData(),this.getGlobalMessaging()},methods:{getFormData:function(){var e=this;s.A.get(this.dataUrl).then((function(t){e.formData=t.data,e.isMarketo&&window.MktoForms2&&window.MktoForms2.loadForm(e.marketoInstance,e.munchkinId,e.formId),t.data.fields.forEach((function(t){e.form[t.name]="",t.conditional&&(e.conditionalFields[t.name]=!1)}))})).catch((function(){}))},getGlobalMessaging:function(){var e=this;s.A.get(this.messagingUrl).then((function(t){e.messagingData=t.data})).catch((function(){}))},getLanguageObj:function(){return this.isUndefined(this.formData[this.language])?{}:this.formData[this.language]||void 0},getTranslatedLabel:function(e,t){var n=this.getLanguageObj(),i="";return i="en"===this.language||this.isUndefined(n[e])||this.isUndefined(n[e].label)?this.formData.fields[t].label:n[e].label,this.showOptionalText(this.formData.fields[t])&&!this.isUndefined(this.getMessagingData("optional",this.language))&&(i="".concat(i," (").concat(this.getMessagingData("optional",this.language),")")),i},getTranslatedLegend:function(e,t){var n=this.getLanguageObj();return"en"===this.language||this.isUndefined(n[e])||this.isUndefined(n[e].descriptor)?this.formData.fields[t].descriptor:n[e].descriptor},getTranslatedInfo:function(e,t){var n=this.getLanguageObj();return"en"===this.language||this.isUndefined(n[e])||this.isUndefined(n[e].info)?this.formData.fields[t].info:n[e].info},getTranslatedValidation:function(e,t){var n,i=this.getLanguageObj();return"en"!==this.language||this.isUndefined(this.formData.fields[t].validationMessages)?this.isUndefined(i[e])||this.isUndefined(i[e].validationMessages)?"en"===this.language&&(n=this.formData.fields[t].validationMessages):n=i[e].validationMessages:n=this.formData.fields[t].validationMessages,n},getTranslatedOptions:function(e,t){var n=this.getLanguageObj(),i=[];return void 0===(i="en"===this.language||this.isUndefined(n[e])||this.isUndefined([e].options)?this.formData.fields[t].options:n[e].options)&&(i=[]),i},getTranslatedHint:function(e,t){var n=this.getLanguageObj();return"en"===this.language||this.isUndefined(n[e])||this.isUndefined(n[e].hint)?this.isUndefined(this.formData.fields[t].hint)?"":this.formData.fields[t].hint:n[e].hint},getTranslatedContent:function(e){var t=this.getLanguageObj();return"en"!==this.language||this.isUndefined(this.formData.content)||this.isUndefined(this.formData.content[e])?this.isUndefined(t.content)||this.isUndefined(t.content[e])?this.getMessagingData(e,this.language):t.content[e]:this.formData.content[e]},getMessagingData:function(e,t){return Object.keys(this.messagingData).length>0?this.messagingData[t][e]:"validation"===e?{}:""},isUndefined:function(e){return void 0===e},updateFieldData:function(e){this.form[e.field]=e.value||"",Array.isArray(e.errors)?this.formIsInvalid=e.errors.length>0:this.formIsInvalid=null!==e.errors,this.manageErrorStatus(e.field,e.errors),this.checkConditionalFields()},manageErrorStatus:function(e,t){var n=this.errorFields.indexOf(e);-1!==n?(!t||t.length<1)&&this.errorFields.splice(n,1):t&&t.length>0&&this.errorFields.push(e)},showOptionalText:function(e){return!(!this.isUndefined(e.validation)&&!this.isUndefined(e.validation.required))},needsLabel:function(e){return"radio"!==e.element&&"submit"!==e.element&&"checkbox"!==e.element},preSubmit:function(e){var t=this;e.preventDefault(),this.isTest||this.onRecaptchaVerify(),this.triggerValidate=!0;var n=this.formData.fields.filter((function(e){return e.validation&&e.validation.required}));0===n.length?this.formIsInvalid=!1:n.forEach((function(e){""===t.form[e.name]&&(t.formIsInvalid=!0)})),this.showErrorMessage=this.formIsInvalid,Object.entries(this.conditionalFields).forEach((function(e){var n=(0,a.A)(e,2),i=n[0];n[1]||(t.form[i]="")})),this.errorFields.length>0&&(this.formIsInvalid=!0),!this.formIsInvalid&&this.recaptchaVerified?this.isMarketo?this.marketoSubmit():this.axiosSubmit():(this.showErrorMessage=!0,this.reAlertErrors=!0,setTimeout((function(){t.reAlertErrors=!1}),100))},marketoSubmit:function(){var e=this;this.createDataLayerObject("formsDataEvent");var t=window.MktoForms2.allForms()[0];t.addHiddenFields(this.form),window.grecaptcha&&t.addHiddenFields({lastReCAPTCHAUserFingerprint:window.grecaptcha.getResponse(),lastRecaptchaEnabledFormID:this.formId}),t.onSuccess((function(){return e.submitting=!1,e.submitted=!0,!1})),t.onSubmit((function(){e.submitting=!0})),t.submit()},axiosSubmit:function(){var e=this;this.submitting=!0;var t="";window.grecaptcha&&(t=window.grecaptcha.getResponse()),s.A.post(this.submitUrl,v(v({},this.form),{},{formType:this.formData.content?this.formData.content.formType:"","g-recaptcha-response":t})).then((function(){return e.submitting=!1,e.submitted=!0,!1})).catch((function(){}))},onRecaptchaVerify:function(){window.grecaptcha&&"function"==typeof window.grecaptcha.getResponse&&""!==window.grecaptcha.getResponse()?this.recaptchaVerified=!0:this.recaptchaVerified=!1},checkConditionalFields:function(){var e=this;Object.keys(this.conditionalFields).forEach((function(t){var n=e.formData.fields.find((function(e){return e.name===t})),i=!0;Object.keys(n.conditional).forEach((function(a){var r=n.conditional[a];Array.isArray(r)?-1===r.indexOf(e.form[a])&&(i=!1):e.form[a]!==r&&(i=!1),e.conditionalFields[t]=!!i}))}))},conditionalElementClass:function(e){return!0===this.conditionalFields[e]||void 0===this.conditionalFields[e]?"":"d-none"}}}},30809:function(e,t,n){"use strict";n.d(t,{X:function(){return h}});var i=n(20641),a=n(53751),r=n(90033),s={class:"vs-form","data-test":"vs-form"},o=(0,i.Lk)("form",{class:"d-none"},null,-1),l={class:"vs-form__main-heading vs-heading--style-level-2 float-none","data-test":"vs-form__main-heading"},d={key:0},u={"aria-live":"assertive"},f={key:0},c=["innerHTML"],g={key:2};function h(e,t,n,h,m,p){var v=(0,i.g2)("VsInput"),b=(0,i.g2)("VsSelect"),y=(0,i.g2)("VsCheckbox"),D=(0,i.g2)("BFormGroup"),k=(0,i.g2)("VsRecaptcha"),F=(0,i.g2)("VsButton"),O=(0,i.g2)("VsWarning"),T=(0,i.g2)("VsHeading");return(0,i.uX)(),(0,i.CE)("div",s,[o,m.submitted?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("form",{key:0,onSubmit:t[0]||(t[0]=(0,a.withModifiers)((function(){return p.preSubmit&&p.preSubmit.apply(p,arguments)}),["prevent"]))},[(0,i.Lk)("fieldset",null,[(0,i.Lk)("legend",l,(0,r.toDisplayString)(p.getTranslatedContent("heading")),1),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(m.formData.fields,(function(e,t){return(0,i.uX)(),(0,i.Wv)(D,{key:e.name,label:p.needsLabel(e)?p.getTranslatedLabel(e.name,t):"","label-for":p.needsLabel(e)?e.name:"",class:(0,r.normalizeClass)(p.conditionalElementClass(e.name))},{default:(0,i.k6)((function(){return[p.isUndefined(e.descriptor)||"checkbox"!==e.element?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("legend",d,(0,r.toDisplayString)(p.getTranslatedLegend(e.name,t)),1)),(0,i.Lk)("div",{class:(0,r.normalizeClass)(p.conditionalElementClass(e.name))},["input"===e.element?((0,i.uX)(),(0,i.Wv)(v,{key:0,ref_for:!0,ref:e.name,onStatusUpdate:p.updateFieldData,"field-name":e.name,type:e.type,"validation-rules":e.validation||{},"validation-messages":p.getTranslatedValidation(e.name,t)||{},"generic-validation":p.getMessagingData("validation",n.language),invalid:m.errorFields.indexOf(e.name)>-1,"trigger-validate":m.triggerValidate,"hint-text":p.getTranslatedHint(e.name,t),placeholder:e.placeholder||"","re-alert-errors":m.reAlertErrors},null,8,["onStatusUpdate","field-name","type","validation-rules","validation-messages","generic-validation","invalid","trigger-validate","hint-text","placeholder","re-alert-errors"])):(0,i.Q3)("",!0),"select"===e.element?((0,i.uX)(),(0,i.Wv)(b,{key:1,options:p.getTranslatedOptions(e.name,t),ref_for:!0,ref:e.name,onStatusUpdate:p.updateFieldData,"field-name":e.name,"validation-rules":e.validation||{},"validation-messages":p.getTranslatedValidation(e.name,t)||{},"generic-validation":p.getMessagingData("validation",n.language),invalid:m.errorFields.indexOf(e.name)>-1,"trigger-validate":m.triggerValidate,"country-list-url":n.countryListUrl,countries:e.countries,"hint-text":p.getTranslatedHint(e.name,t),"re-alert-errors":m.reAlertErrors},null,8,["options","onStatusUpdate","field-name","validation-rules","validation-messages","generic-validation","invalid","trigger-validate","country-list-url","countries","hint-text","re-alert-errors"])):(0,i.Q3)("",!0),"checkbox"===e.element?((0,i.uX)(),(0,i.Wv)(y,{key:e.name,ref_for:!0,ref:e.name,name:e.name,value:e.value,label:p.getTranslatedLabel(e.name,t),onStatusUpdate:p.updateFieldData,"field-name":e.name,"validation-rules":e.validation||{},"validation-messages":p.getTranslatedValidation(e.name,t)||{},"generic-validation":p.getMessagingData("validation",n.language),invalid:m.errorFields.indexOf(e.name)>-1,"trigger-validate":m.triggerValidate,"optional-text":p.getMessagingData("optional",n.language),"hint-text":p.getTranslatedHint(e.name,t),"info-text":p.getTranslatedInfo(e.name,t),"re-alert-errors":m.reAlertErrors},null,8,["name","value","label","onStatusUpdate","field-name","validation-rules","validation-messages","generic-validation","invalid","trigger-validate","optional-text","hint-text","info-text","re-alert-errors"])):(0,i.Q3)("",!0)],2)]})),_:2},1032,["label","label-for","class"])})),128))]),(0,i.RG)(e.$slots,"hidden-fields"),(0,i.bF)(k,{onVerified:p.onRecaptchaVerify,"site-key":n.recaptchaKey,invalid:!m.recaptchaVerified&&m.showErrorMessage,language:n.language,"error-msg":p.getMessagingData("recaptchaError",n.language),class:"mt-9","textarea-label":n.recaptchaTextareaLabel,"re-alert-errors":m.reAlertErrors},null,8,["onVerified","site-key","invalid","language","error-msg","textarea-label","re-alert-errors"]),(0,i.bF)(F,{variant:"primary",type:"submit",class:"vs-form__submit mt-9",onClick:p.preSubmit},{default:(0,i.k6)((function(){return[(0,i.eW)((0,r.toDisplayString)(p.getTranslatedContent("submit")),1)]})),_:1},8,["onClick"])],32)),(0,i.bF)(O,{class:"vs-form__no-js"},{default:(0,i.k6)((function(){return[(0,i.RG)(e.$slots,"no-js")]})),_:3}),(0,i.Lk)("div",u,[m.submitting?((0,i.uX)(),(0,i.CE)("p",f,[(0,i.RG)(e.$slots,"submitting")])):(0,i.Q3)("",!0),m.submitted?((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[p.getTranslatedContent("successHeading")?((0,i.uX)(),(0,i.Wv)(T,{key:0,level:"2"},{default:(0,i.k6)((function(){return[(0,i.eW)((0,r.toDisplayString)(p.getTranslatedContent("successHeading")),1)]})),_:1})):(0,i.Q3)("",!0),(0,i.Lk)("p",{class:"vs-form__content",innerHTML:p.getTranslatedContent("successContent")},null,8,c)],64)):(0,i.Q3)("",!0),m.submitError?((0,i.uX)(),(0,i.CE)("p",g,[(0,i.RG)(e.$slots,"submit-error")])):(0,i.Q3)("",!0)])])}},4131:function(e,t,n){"use strict";var i=n(85072),a=n.n(i),r=n(97825),s=n.n(r),o=n(77659),l=n.n(o),d=n(55056),u=n.n(d),f=n(10540),c=n.n(f),g=n(41113),h=n.n(g),m=n(91929),p=n.n(m),v={};v.styleTagTransform=h(),v.setAttributes=u(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=c(),a()(p(),v),p()&&p().locals&&p().locals},19464:function(e,t,n){"use strict";n.r(t);var i=n(38025),a=n(18668);n(24903);const r=(0,n(66262).A)(a.A,[["render",i.X]]);t.default=r},18668:function(e,t,n){"use strict";n.d(t,{A:function(){return i.A}});var i=n(97272)},38025:function(e,t,n){"use strict";n.d(t,{X:function(){return i.X}});var i=n(30809)},24903:function(e,t,n){"use strict";n(4131)}},function(e){return e.O(0,[641,6262,7510,3751,4352,4467,7527,8086,810,2543,3453,281,7536,7171,6422,8745,8836,3838,9122,4282,2142,1688,6358,8258],(function(){return 19464,e(e.s=19464)})),e.O()}])}));
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[2831],{22831:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return a.default}});var r=s(n(13518)),u=s(n(14948)),o=s(n(45073)),f=s(n(77186)),l=s(n(14808)),a=s(n(7775)),d=s(n(37037)),i=s(n(49910)),c=s(n(96792));function s(e){return e&&e.__esModule?e:{default:e}}},22311:function(e,t){function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function u(e,t,n,u,o,f){return r((l=r(r(t,e),r(u,f)))<<(a=o)|l>>>32-a,n);var l,a}function o(e,t,n,r,o,f,l){return u(t&n|~t&r,e,t,o,f,l)}function f(e,t,n,r,o,f,l){return u(t&r|n&~r,e,t,o,f,l)}function l(e,t,n,r,o,f,l){return u(t^n^r,e,t,o,f,l)}function a(e,t,n,r,o,f,l){return u(n^(t|~r),e,t,o,f,l)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let u=0;u<n;u+=8){const n=e[u>>5]>>>u%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let u=1732584193,d=-271733879,i=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){const n=u,s=d,p=i,v=c;u=o(u,d,i,c,e[t],7,-680876936),c=o(c,u,d,i,e[t+1],12,-389564586),i=o(i,c,u,d,e[t+2],17,606105819),d=o(d,i,c,u,e[t+3],22,-1044525330),u=o(u,d,i,c,e[t+4],7,-176418897),c=o(c,u,d,i,e[t+5],12,1200080426),i=o(i,c,u,d,e[t+6],17,-1473231341),d=o(d,i,c,u,e[t+7],22,-45705983),u=o(u,d,i,c,e[t+8],7,1770035416),c=o(c,u,d,i,e[t+9],12,-1958414417),i=o(i,c,u,d,e[t+10],17,-42063),d=o(d,i,c,u,e[t+11],22,-1990404162),u=o(u,d,i,c,e[t+12],7,1804603682),c=o(c,u,d,i,e[t+13],12,-40341101),i=o(i,c,u,d,e[t+14],17,-1502002290),d=o(d,i,c,u,e[t+15],22,1236535329),u=f(u,d,i,c,e[t+1],5,-165796510),c=f(c,u,d,i,e[t+6],9,-1069501632),i=f(i,c,u,d,e[t+11],14,643717713),d=f(d,i,c,u,e[t],20,-373897302),u=f(u,d,i,c,e[t+5],5,-701558691),c=f(c,u,d,i,e[t+10],9,38016083),i=f(i,c,u,d,e[t+15],14,-660478335),d=f(d,i,c,u,e[t+4],20,-405537848),u=f(u,d,i,c,e[t+9],5,568446438),c=f(c,u,d,i,e[t+14],9,-1019803690),i=f(i,c,u,d,e[t+3],14,-187363961),d=f(d,i,c,u,e[t+8],20,1163531501),u=f(u,d,i,c,e[t+13],5,-1444681467),c=f(c,u,d,i,e[t+2],9,-51403784),i=f(i,c,u,d,e[t+7],14,1735328473),d=f(d,i,c,u,e[t+12],20,-1926607734),u=l(u,d,i,c,e[t+5],4,-378558),c=l(c,u,d,i,e[t+8],11,-2022574463),i=l(i,c,u,d,e[t+11],16,1839030562),d=l(d,i,c,u,e[t+14],23,-35309556),u=l(u,d,i,c,e[t+1],4,-1530992060),c=l(c,u,d,i,e[t+4],11,1272893353),i=l(i,c,u,d,e[t+7],16,-155497632),d=l(d,i,c,u,e[t+10],23,-1094730640),u=l(u,d,i,c,e[t+13],4,681279174),c=l(c,u,d,i,e[t],11,-358537222),i=l(i,c,u,d,e[t+3],16,-722521979),d=l(d,i,c,u,e[t+6],23,76029189),u=l(u,d,i,c,e[t+9],4,-640364487),c=l(c,u,d,i,e[t+12],11,-421815835),i=l(i,c,u,d,e[t+15],16,530742520),d=l(d,i,c,u,e[t+2],23,-995338651),u=a(u,d,i,c,e[t],6,-198630844),c=a(c,u,d,i,e[t+7],10,1126891415),i=a(i,c,u,d,e[t+14],15,-1416354905),d=a(d,i,c,u,e[t+5],21,-57434055),u=a(u,d,i,c,e[t+12],6,1700485571),c=a(c,u,d,i,e[t+3],10,-1894986606),i=a(i,c,u,d,e[t+10],15,-1051523),d=a(d,i,c,u,e[t+1],21,-2054922799),u=a(u,d,i,c,e[t+8],6,1873313359),c=a(c,u,d,i,e[t+15],10,-30611744),i=a(i,c,u,d,e[t+6],15,-1560198380),d=a(d,i,c,u,e[t+13],21,1309151649),u=a(u,d,i,c,e[t+4],6,-145523070),c=a(c,u,d,i,e[t+11],10,-1120210379),i=a(i,c,u,d,e[t+2],15,718787259),d=a(d,i,c,u,e[t+9],21,-343485551),u=r(u,n),d=r(d,s),i=r(i,p),c=r(c,v)}return[u,d,i,c]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},46140:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},14808:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},96792:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(37037))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,u.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},27656:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},2858:function(e,t){let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},9042:function(e,t){function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],u=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,f=Math.ceil(o/16),l=new Array(f);for(let t=0;t<f;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];l[t]=n}l[f-1][14]=8*(e.length-1)/Math.pow(2,32),l[f-1][14]=Math.floor(l[f-1][14]),l[f-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<f;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=l[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let f=u[0],a=u[1],d=u[2],i=u[3],c=u[4];for(let e=0;e<80;++e){const u=Math.floor(e/20),l=r(f,5)+n(u,a,d,i)+c+t[u]+o[e]>>>0;c=i,i=d,d=r(a,30)>>>0,a=f,f=l}u[0]=u[0]+f>>>0,u[1]=u[1]+a>>>0,u[2]=u[2]+d>>>0,u[3]=u[3]+i>>>0,u[4]=u[4]+c>>>0}return[u[0]>>24&255,u[0]>>16&255,u[0]>>8&255,255&u[0],u[1]>>24&255,u[1]>>16&255,u[1]>>8&255,255&u[1],u[2]>>24&255,u[2]>>16&255,u[2]>>8&255,255&u[2],u[3]>>24&255,u[3]>>16&255,u[3]>>8&255,255&u[3],u[4]>>24&255,u[4]>>16&255,u[4]>>8&255,255&u[4]]}},49910:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=f;var r,u=(r=n(37037))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function f(e,t=0){return o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}t.default=function(e,t=0){const n=f(e,t);if(!(0,u.default)(n))throw TypeError("Stringified UUID is invalid");return n}},13518:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(2858))&&r.__esModule?r:{default:r},o=n(49910);let f,l,a=0,d=0;t.default=function(e,t,n){let r=t&&n||0;const i=t||new Array(16);let c=(e=e||{}).node||f,s=void 0!==e.clockseq?e.clockseq:l;if(null==c||null==s){const t=e.random||(e.rng||u.default)();null==c&&(c=f=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=l=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:d+1;const y=p-a+(v-d)/1e4;if(y<0&&void 0===e.clockseq&&(s=s+1&16383),(y<0||p>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,d=v,l=s,p+=122192928e5;const _=(1e4*(268435455&p)+v)%4294967296;i[r++]=_>>>24&255,i[r++]=_>>>16&255,i[r++]=_>>>8&255,i[r++]=255&_;const b=p/4294967296*1e4&268435455;i[r++]=b>>>8&255,i[r++]=255&b,i[r++]=b>>>24&15|16,i[r++]=b>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(let e=0;e<6;++e)i[r+e]=c[e];return t||(0,o.unsafeStringify)(i)}},14948:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(59025)),u=o(n(22311));function o(e){return e&&e.__esModule?e:{default:e}}var f=(0,r.default)("v3",48,u.default);t.default=f},59025:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,f,l){var a;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+e.length);if(d.set(r),d.set(e,r.length),d=n(d),d[6]=15&d[6]|t,d[8]=63&d[8]|128,f){l=l||0;for(let e=0;e<16;++e)f[l+e]=d[e];return f}return(0,u.unsafeStringify)(d)}try{r.name=e}catch(e){}return r.DNS=f,r.URL=l,r};var r,u=n(49910),o=(r=n(96792))&&r.__esModule?r:{default:r};const f="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=f;const l="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=l},45073:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=f(n(46140)),u=f(n(2858)),o=n(49910);function f(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const f=(e=e||{}).random||(e.rng||u.default)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=f[e];return t}return(0,o.unsafeStringify)(f)}},77186:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(59025)),u=o(n(9042));function o(e){return e&&e.__esModule?e:{default:e}}var f=(0,r.default)("v5",80,u.default);t.default=f},37037:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(27656))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&u.default.test(e)}},7775:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,u=(r=n(37037))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,u.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[4079],{74218:function(){},70146:function(t,e,o){"use strict";var i=o(64467),a=o(79122),s=o(35025),n=o(42904),r=o(18562),p=o(20641),u=o(53751),l=o(10810),d=o(79920),c=o(60842),m=o.n(c),h=o(25879),g=o.n(h),f=o(30681);function y(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,i)}return o}var v=null;e.A={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:a.default,VsLoading:s.default},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default:function(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:function(){}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0}},setup:function(){v=(0,d.A)()},data:function(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?y(Object(o),!0).forEach((function(e){(0,i.A)(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({getZoom:function(){return this.mapbox.map?this.mapbox.map.getZoom():null}},(0,l.aH)(d.A,{activeMarkerPostion:function(t){return this.mapbox.map?t.activeMarkerPos:null},highlightedPlace:function(t){return this.mapbox.map?t.getHoveredStop(this.mapId):null},activePlace:function(t){return this.mapbox.map?t.getActivePlace(this.mapId):null}})),watch:{isVisible:function(t){var e=this;t&&null!==this.mapbox.map&&setTimeout((function(){e.mapbox.map.resize()}),20)},places:{handler:function(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons:function(t){!0===t?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace:function(t){t&&(0===t.length?this.removeHoveredPolygon():"Point"!==t.geometry.type&&this.addHoveredPolygon(t))},selectedItem:function(t){t&&"Point"!==t.geometry.type&&this.polygons.features.filter((function(e){return e.properties.id===t.properties.id})).length>0&&this.addActivePolygon(t),t||this.removeActivePolygon()},activeMarkerPostion:function(t){this.checkPointIsVisible(t)||this.centreMapOnPoint(t)},showInfoMessage:function(t){this.showMapMessage=!!t},resetZoom:function(t){t&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted:function(){var t=this;v.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),window.addEventListener("DOMContentLoaded",(function(){n.A.init({div:t.mapId})}))},methods:{addMap:function(){var t=this,e=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new(m().Map)({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:e,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",(function(){t.mapbox.rotation=t.mapbox.map.transform.angle})),this.mapbox.map.resize(),this.mapbox.map.on("load",(function(){t.addMapPolygons(),t.showMapMessage=!1,t.isLoading=!1,t.$emit("map-ready",!0),t.mapbox.map.boxZoom.enable()})),this.mapbox.map.on("zoomend",(function(){4===t.mapbox.map.getZoom()?(t.showZoomMessage="too-far",t.showMapMessage=!0):18===t.mapbox.map.getZoom()?(t.showZoomMessage="too-close",t.showMapMessage=!0):t.showInfoMessage||(t.showZoomMessage=null,t.showMapMessage=!1)}))},addMapControls:function(){var t=new(m().NavigationControl);this.mapbox.map.addControl(t,"top-right"),this.mapbox.map.addControl(new(m().FullscreenControl))},initialiseMapFeatures:function(){var t=this;this.places.map((function(e){if(void 0!==e.geometry){var o=t.getCoordinateArray(e);return t.getMapFeatures(e,o)}return!(!e.latitude||!e.longitude)&&t.getItineraryMapFeatures(e)}))},getCoordinateArray:function(t){return"Polygon"===t.geometry.type?[t.geometry.coordinates[0]]:"MultiPolygon"===t.geometry.type?[t.geometry.coordinates]:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},getMapFeatures:function(t,e){return this.geojsonData.features.push({type:"Feature",geometry:{type:t.geometry.type,coordinates:e},properties:{title:t.properties.title,imageSrc:t.image,type:void 0!==t.properties.category?t.properties.category.id:"",id:t.properties.id},id:t.properties.id})},getItineraryMapFeatures:function(t){var e=(0,r.A)();return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(t.longitude),parseFloat(t.latitude)]},properties:{title:t.title,imageSrc:t.imageSrc,type:"itinerary-stop",stopCount:t.stopCount,id:e},id:e})},initialiseMapMarkers:function(){var t=this,e=0;this.initialLoad&&(e=1e3),setTimeout((function(){if(null!==t.markers){for(var e=t.markers.length-1;e>=0;e--)t.markers[e].remove();t.markers=[]}t.geojsonData.features.forEach((function(e){"Point"===e.geometry.type&&t.createMapMarker(e)}))}),e)},createMapMarker:function(t){var e=this,o=(0,p.h)(f.default,{feature:t,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:function(t){e.$emit("showDetail",t)},onSetCategory:function(t){e.$emit("setCategory",t)}}),i=document.createElement("div");this.$refs.mapboxOuter.appendChild(i),(0,u.render)(o,i),t&&this.showMarkerPopups&&this.addMapPopup(t);var a=new(m().Marker)(i.children[0]).setLngLat(t.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(a),this.markers.push(a),i.remove()},hideMapPolygons:function(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons:function(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons:function(){var t=this;this.geojsonData.features.forEach((function(e){"Polygon"===e.geometry.type?t.polygons.features.includes(e.properties.id)||t.polygons.features.push(e):"MultiPolygon"===e.geometry.type&&(t.polygons.features.includes(e.properties.id)||t.multiPolygons.push(e))})),this.multiPolygons.forEach((function(e){var o=e.properties;e.geometry.coordinates[0].forEach((function(e){t.polygons.features.push({geometry:{type:"Polygon",coordinates:e},id:o.id,properties:{id:o.id,imageSrc:o.imageSrc,title:o.title,type:o.type},type:"Feature"})}))})),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",(function(e){e.features.length>0&&(t.addMapPopup(e),t.removeHoveredPolygon(),t.addHoveredPolygon(e.features[0]))})),this.mapbox.map.on("mouseleave","regionFills",(function(e){t.removeMapPopup(e),t.removeHoveredPolygon()})),this.mapbox.map.on("click","regionFills",(function(e){t.removeActivePolygon(),t.addActivePolygon(e.features[0]),t.addMapPopup(e.features[0])})))},removeActivePolygon:function(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon:function(t){this.activeStateId=t.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),v.setActivePlace({mapId:this.mapId,activeFeature:t}),this.$emit("showDetail",t),this.$emit("setCategory","regions")},removeHoveredPolygon:function(){if(this.hoveredStateId){var t="";this.hoveredStateId===this.activeStateId&&(t="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":t})}v.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon:function(t){this.hoveredStateId=t.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(t),v.setHoveredPlace({mapId:this.mapId,hoveredFeature:t})},addMapPopup:function(t){var e;e=t.features?t.features[0]:t;var o=this.getCoordinates(e),i=this.getPopupHtml(e);e.properties.id&&(this.removeMapPopup(t),this.popup=new(m().Popup)({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(o).setHTML(i).addTo(this.mapbox.map))},removeMapPopup:function(t){this.popup&&(this.popup.remove(),this.popup=null),t._popup&&t._popup.remove()},getCoordinates:function(t){return"Polygon"===t.geometry.type?this.findFeatureCentre(t.geometry.coordinates):"MultiPolygon"===t.geometry.type?this.findFeatureCentre(t.geometry.coordinates[0]):t.geometry.coordinates},findFeatureCentre:function(t){var e=[],o=[];return t[0].forEach((function(t){e.push(t[1]),o.push(t[0])})),{lat:(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,lng:(Math.min.apply(Math,o)+Math.max.apply(Math,o))/2}},getPopupHtml:function(t){return t.properties.imageSrc&&t.properties.stopCount?'\n <img class="vs-map__popup-image" src="'.concat(t.properties.imageSrc,'" />\n <div>\n <h4 class="vs-map__popup-subtitle">Stop ').concat(t.properties.stopCount,'</h4>\n <p class="vs-map__popup-title">').concat(t.properties.title,"</p>\n </div>\n "):'\n <p class="vs-map__popup-title">'.concat(t.properties.title,"</p>\n ")},setupMarkerListeners:function(t){var e=this;document.body.addEventListener("keyup",(function(o){"Escape"!==o.key&&"Tab"!==o.key||(e.removeMapPopup(t),e.showMarkerPopups&&v.setActivePlace({mapId:e.mapId,activeFeature:null}))})),t.getElement().addEventListener("keyup",(function(o){"Enter"===o.key&&(t._popup.isOpen()||t._popup.addTo(e.mapbox.map))}))},fitToBounds:function(){this.mapbox.map.fitBounds(g()(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent:function(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent:function(){var t=this;m().supported({failIfMajorPerformanceCaveat:!0}),"IntersectionObserver"in window?(this.observer=new IntersectionObserver((function(e){e[0].intersectionRatio>0&&(t.observer.unobserve(t.$el),t.initialiseMapComponent())})),this.observer.observe(this.$el)):this.initialiseMapComponent()},onResize:function(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon:function(){var t=this.boundsData.coordinates[0];return t.reduce((function(t,e){return t.extend(e)}),new(m().LngLatBounds)(t[0],t[0]))},checkPointIsVisible:function(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint:function(t){this.mapbox.map.flyTo({center:t})},calculateBoundingBox:function(){var t;if(void 0===this.boundsData||"undefined"===this.boundsData.type)t=[[-7.555827,54.608836],[-.778285,60.880894]];else if("bounds"===this.boundsData.type){var e=new(m().LngLat)(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),o=new(m().LngLat)(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);t=new(m().LngLatBounds)(e,o)}else t="Polygon"===this.boundsData.type?this.getBoundsFromPolygon():[[-7.555827,54.608836],[-.778285,60.880894]];return t}}}},52374:function(t,e,o){"use strict";o.d(e,{X:function(){return l}});var i=o(20641),a=o(90033),s={class:"vs-map","data-test":"vs-map"},n={class:"vs-map__message-box"},r={class:"vs-map__message-text"},p={ref:"mapboxOuter",class:"vs-map__map-outer"},u=["id"];function l(t,e,o,l,d,c){var m=(0,i.g2)("VsLoading"),h=(0,i.g2)("VsWarning");return(0,i.uX)(),(0,i.CE)("div",s,[d.showMapMessage?((0,i.uX)(),(0,i.CE)("div",{key:0,class:(0,a.normalizeClass)(["vs-map__message",d.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[(0,i.Lk)("div",n,[d.isLoading?((0,i.uX)(),(0,i.Wv)(m,{key:0,class:"vs-map__loading"})):(0,i.Q3)("",!0),(0,i.Lk)("p",r,[d.isLoading?(0,i.RG)(t.$slots,"map-loading-text",{key:0}):o.showInfoMessage?(0,i.RG)(t.$slots,"info-message",{key:1}):"too-close"===d.showZoomMessage?(0,i.RG)(t.$slots,"zoom-too-close",{key:2}):"too-far"===d.showZoomMessage?(0,i.RG)(t.$slots,"zoom-too-far",{key:3}):(0,i.Q3)("",!0)])])],2)):(0,i.Q3)("",!0),(0,i.Lk)("div",p,[(0,i.Lk)("div",{id:o.mapId,class:"vs-map__map",ref:"mapbox"},null,8,u)],512),(0,i.bF)(h,{class:"vs-map__no-js"},{default:(0,i.k6)((function(){return[(0,i.RG)(t.$slots,"no-js")]})),_:3})])}},42904:function(t,e){"use strict";var o="";"undefined"!=typeof window&&(o=document.currentScript);var i={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data &copy; Crown copyright and database rights YYYY",prefix:"",suffix:""},init:function(t){if(""!==o){this.options.div=o.getAttribute("data-div")||this.options.div,this.options.logo=o.getAttribute("data-logo")||this.options.logo,this.options.statement=o.getAttribute("data-statement")||this.options.statement,this.options.prefix=o.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=o.getAttribute("data-suffix")||this.options.suffix,t=void 0!==t?t:{},Object.assign(this.options,t);var e=document.getElementById(this.options.div),i="os-api-branding logo";"os-logo-maps-white"===this.options.logo&&(i="os-api-branding logo white");var a=this.options.statement;a=a.replace("YYYY",(new Date).getFullYear()),""!==this.options.prefix&&(a="".concat(this.options.prefix,"<span>|</span>").concat(a)),""!==this.options.suffix&&(a="".concat(a,"<span>|</span>").concat(this.options.suffix)),document.querySelectorAll("#".concat(this.options.div," .os-api-branding")).forEach((function(t){return t.remove()}));var s=document.createElement("div");s.className=i,e.appendChild(s);var n=document.createElement("div");n.className="os-api-branding copyright",n.innerHTML=a,e.appendChild(n)}}};e.A=i},20364:function(t,e,o){"use strict";var i=o(85072),a=o.n(i),s=o(97825),n=o.n(s),r=o(77659),p=o.n(r),u=o(55056),l=o.n(u),d=o(10540),c=o.n(d),m=o(41113),h=o.n(m),g=o(74218),f=o.n(g),y={};y.styleTagTransform=h(),y.setAttributes=l(),y.insert=p().bind(null,"head"),y.domAPI=n(),y.insertStyleElement=c(),a()(f(),y),f()&&f().locals&&f().locals},81610:function(t,e,o){"use strict";o.r(e);var i=o(77510),a=o(3878);o(66544);const s=(0,o(66262).A)(a.A,[["render",i.X]]);e.default=s},3878:function(t,e,o){"use strict";o.d(e,{A:function(){return i.A}});var i=o(70146)},77510:function(t,e,o){"use strict";o.d(e,{X:function(){return i.X}});var i=o(52374)},66544:function(t,e,o){"use strict";o(20364)},42634:function(){}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[4900],{7202:function(){},7148:function(e,t,n){"use strict";var l=n(85072),a=n.n(l),o=n(97825),u=n.n(o),s=n(77659),r=n.n(s),i=n(55056),c=n.n(i),d=n(10540),v=n.n(d),m=n(41113),f=n.n(m),g=n(7202),p=n.n(g),b={};b.styleTagTransform=f(),b.setAttributes=c(),b.insert=r().bind(null,"head"),b.domAPI=u(),b.insertStyleElement=v(),a()(p(),b),p()&&p().locals&&p().locals},38300:function(e,t,n){"use strict";var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(17527),o=n(17527),u={class:"form-group vs-guest-selector","data-test":"vs-guest-selector"},s={class:"vs-guest-selector__label"},r=["disabled"],i={class:"visually-hidden"},c={class:"vs-guest-selector__button-row mb-3"},d={class:"d-flex justify-content-between"},v=["value","disabled"],m=["value","disabled"],f=n(17527),g=n(378),p=n(22831),b=l(n(26216)),_=l(n(48836));t.default=(0,a.defineComponent)({__name:"GuestSelector",props:{availability:{type:Boolean}},setup:function(e){var t=(0,g.getLabelText)("add_room_label","Add a Room","guests_rooms"),n=(0,g.getLabelText)("save_changes","Save","guests_rooms"),l=(0,f.ref)(2),a=(0,g.getLabelText)("guest","Guest","guests_rooms"),h=(0,g.getLabelText)("guests","Guests","guests_rooms"),C=(0,f.ref)(!1),k=(0,f.ref)(0),x=(0,f.ref)([{id:(0,p.v4)(),showRemoveBtn:!1,numberGroups:{adults:{minCount:1,maxCount:30,count:2,name:"r1a",unitLabel:(0,g.getLabelText)("adults","Adults","guests_rooms")},children:{minCount:0,maxCount:30,count:0,name:"r1children",unitLabel:(0,g.getLabelText)("children","Children","guests_rooms")},infants:{minCount:0,maxCount:30,count:0,name:"r1infants",unitLabel:(0,g.getLabelText)("infants","Infants","guests_rooms")}}}]),y=(0,f.ref)(1),L=(0,g.getLabelText)("room","Room","guests_rooms"),N=(0,g.getLabelText)("rooms","Rooms","guests_rooms"),T=(0,f.ref)(!1),V=(0,f.ref)(!1),B=function(){V.value=!1},w=function(){V.value=!V.value},E=function(){if(x.value.length<5){var e={id:(0,p.v4)(),showRemoveBtn:!0,numberGroups:{adults:{minCount:1,maxCount:30,count:1,name:"r"+(x.value.length+1)+"a",unitLabel:(0,g.getLabelText)("adults","Adults","guests_rooms")},children:{minCount:0,maxCount:30,count:0,name:"r"+(x.value.length+1)+"children",unitLabel:(0,g.getLabelText)("children","Children","guests_rooms")},infants:{minCount:0,maxCount:30,count:0,name:"r"+(x.value.length+1)+"infants",unitLabel:(0,g.getLabelText)("infants","Infants","guests_rooms")}}},t=x.value.slice();t.push(e),x.value=t,y.value=t.length,C.value=!0,l.value=l.value+1}},S=function(e,t,n){var a=x.value.findIndex((function(e){return e.id===n}));x.value.splice(a,1),y.value=x.value.length,T.value=!0,l.value=l.value-e,k.value=k.value-t,1===x.value.length&&(C.value=!1)},D=function(e,t,n){l.value="increase"===e?l.value+1:l.value-1,"adults"!==t&&(k.value="increase"===e?k.value+1:k.value-1);var a=x.value.findIndex((function(e){return e.id===n}));x.value[a].numberGroups[t].count="increase"===e?x.value[a].numberGroups[t].count+1:x.value[a].numberGroups[t].count-1};return function(e,f){return(0,o.openBlock)(),(0,o.createElementBlock)("div",u,[(0,o.createElementVNode)("span",s,(0,o.toDisplayString)((0,o.unref)(h)),1),(0,o.createElementVNode)("button",{tabIndex:"availability ? '0' : ''",class:"vs-guest-selector__trigger form-control vs-input",onClick:(0,o.withModifiers)(w,["prevent"]),disabled:!e.availability},[(0,o.createElementVNode)("span",null,(0,o.toDisplayString)(y.value)+" ",1),(0,o.createElementVNode)("span",null,(0,o.toDisplayString)(y.value>1?(0,o.unref)(N):(0,o.unref)(L)),1),(0,o.createTextVNode)(",  "),(0,o.createElementVNode)("span",null,(0,o.toDisplayString)(l.value)+" ",1),(0,o.createElementVNode)("span",null,(0,o.toDisplayString)(l.value>1?(0,o.unref)(h):(0,o.unref)(a)),1)],8,r),(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(["vs-guest-selector__modal",V.value?"vs-guest-selector__modal--visible":""])},[(0,o.createVNode)(_.default,{class:"align-self-end","data-test":"vs-guest-selector__close-btn",variant:"transparent",icon:"close-circle",size:"md","icon-only":"",onClick:(0,o.withModifiers)(B,["prevent"])},{default:(0,o.withCtx)((function(){return[(0,o.createElementVNode)("span",i,(0,o.toDisplayString)((0,o.unref)(g.getLabelText)("close","Close","guests_rooms")),1)]})),_:1}),(0,o.createElementVNode)("div",c,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(x.value,(function(e,t){return(0,o.openBlock)(),(0,o.createBlock)(b.default,{key:e.id,name:"r"+(t+1),"show-remove-btn":C.value,"unit-label":(0,o.unref)(g.getLabelText)("room","Room","guests_rooms")+" "+(t+1),"unit-options":e,"unit-removed":T.value,onNumberChange:D,onOnRemove:S},null,8,["name","show-remove-btn","unit-label","unit-options","unit-removed"])})),128))]),(0,o.createElementVNode)("div",d,[x.value.length<5?((0,o.openBlock)(),(0,o.createBlock)(_.default,{key:0,variant:"secondary",class:"c-search__popup__btn-link me-2 align-self-start",onClick:(0,o.withModifiers)(E,["prevent"])},{default:(0,o.withCtx)((function(){return[(0,o.createTextVNode)((0,o.toDisplayString)((0,o.unref)(t)),1)]})),_:1})):(0,o.createCommentVNode)("",!0),x.value.length<5?((0,o.openBlock)(),(0,o.createBlock)(_.default,{key:1,class:"c-search__popup__btn-link c-search__popup__btn-link--pull-right align-self-end",onClick:(0,o.withModifiers)(B,["prevent"])},{default:(0,o.withCtx)((function(){return[(0,o.createTextVNode)((0,o.toDisplayString)((0,o.unref)(n)),1)]})),_:1})):(0,o.createCommentVNode)("",!0)])],2),x.value?((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:0,type:"hidden",name:"rooms",id:"room-count",value:y.value,disabled:!e.availability},null,8,v)):(0,o.createCommentVNode)("",!0),x.value?((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:1,type:"hidden",name:"guests",id:"guest-count",value:l.value,disabled:!e.availability},null,8,m)):(0,o.createCommentVNode)("",!0)])}}})},34900:function(e,t,n){"use strict";n.r(t);var l=n(21726),a={};for(var o in l)"default"!==o&&(a[o]=function(e){return l[e]}.bind(0,o));n.d(t,a),n(7688);const u=l.default;t.default=u},7688:function(e,t,n){"use strict";n(7148)},21726:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return a.a}});var l=n(38300),a=n.n(l),o={};for(var u in l)"default"!==u&&(o[u]=function(e){return l[e]}.bind(0,u));n.d(t,o)}}]);