defra_ruby_template 3.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (479) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +20 -0
  5. data/README.md +71 -0
  6. data/Rakefile +50 -0
  7. data/app/views/layouts/defra_ruby_template.html.erb +83 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/defra_ruby_template.gemspec +24 -0
  11. data/lib/defra_ruby_template.rb +23 -0
  12. data/lib/defra_ruby_template/version.rb +3 -0
  13. data/node_modules/govuk-frontend/README.md +91 -0
  14. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +14 -0
  15. data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
  16. data/node_modules/govuk-frontend/govuk/all-ie8.scss +6 -0
  17. data/node_modules/govuk-frontend/govuk/all.js +2616 -0
  18. data/node_modules/govuk-frontend/govuk/all.scss +9 -0
  19. data/node_modules/govuk-frontend/govuk/assets/fonts/bold-affa96571d-v2.woff +0 -0
  20. data/node_modules/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  21. data/node_modules/govuk-frontend/govuk/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  22. data/node_modules/govuk-frontend/govuk/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  23. data/node_modules/govuk-frontend/govuk/assets/images/favicon.ico +0 -0
  24. data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
  25. data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
  26. data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
  27. data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon.png +0 -0
  28. data/node_modules/govuk-frontend/govuk/assets/images/govuk-crest-2x.png +0 -0
  29. data/node_modules/govuk-frontend/govuk/assets/images/govuk-crest.png +0 -0
  30. data/node_modules/govuk-frontend/govuk/assets/images/govuk-logotype-crown.png +0 -0
  31. data/node_modules/govuk-frontend/govuk/assets/images/govuk-mask-icon.svg +7 -0
  32. data/node_modules/govuk-frontend/govuk/assets/images/govuk-opengraph-image.png +0 -0
  33. data/node_modules/govuk-frontend/govuk/common.js +39 -0
  34. data/node_modules/govuk-frontend/govuk/components/_all.scss +33 -0
  35. data/node_modules/govuk-frontend/govuk/components/accordion/README.md +15 -0
  36. data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -0
  37. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +197 -0
  38. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1011 -0
  39. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +250 -0
  40. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +76 -0
  41. data/node_modules/govuk-frontend/govuk/components/accordion/macro.njk +3 -0
  42. data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +27 -0
  43. data/node_modules/govuk-frontend/govuk/components/back-link/README.md +15 -0
  44. data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -0
  45. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +99 -0
  46. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +62 -0
  47. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +32 -0
  48. data/node_modules/govuk-frontend/govuk/components/back-link/macro.njk +3 -0
  49. data/node_modules/govuk-frontend/govuk/components/back-link/template.njk +2 -0
  50. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/README.md +15 -0
  51. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -0
  52. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
  53. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +193 -0
  54. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +52 -0
  55. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro.njk +3 -0
  56. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +24 -0
  57. data/node_modules/govuk-frontend/govuk/components/button/README.md +15 -0
  58. data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -0
  59. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +288 -0
  60. data/node_modules/govuk-frontend/govuk/components/button/button.js +724 -0
  61. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +318 -0
  62. data/node_modules/govuk-frontend/govuk/components/button/macro-options.json +74 -0
  63. data/node_modules/govuk-frontend/govuk/components/button/macro.njk +3 -0
  64. data/node_modules/govuk-frontend/govuk/components/button/template.njk +60 -0
  65. data/node_modules/govuk-frontend/govuk/components/character-count/README.md +15 -0
  66. data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -0
  67. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +25 -0
  68. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1194 -0
  69. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +240 -0
  70. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +111 -0
  71. data/node_modules/govuk-frontend/govuk/components/character-count/macro.njk +3 -0
  72. data/node_modules/govuk-frontend/govuk/components/character-count/template.njk +37 -0
  73. data/node_modules/govuk-frontend/govuk/components/checkboxes/README.md +15 -0
  74. data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -0
  75. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +320 -0
  76. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +1192 -0
  77. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1189 -0
  78. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +161 -0
  79. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro.njk +3 -0
  80. data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +119 -0
  81. data/node_modules/govuk-frontend/govuk/components/cookie-banner/README.md +15 -0
  82. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  83. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
  84. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +443 -0
  85. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
  86. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
  87. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +73 -0
  88. data/node_modules/govuk-frontend/govuk/components/date-input/README.md +15 -0
  89. data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -0
  90. data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
  91. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +549 -0
  92. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +117 -0
  93. data/node_modules/govuk-frontend/govuk/components/date-input/macro.njk +3 -0
  94. data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +97 -0
  95. data/node_modules/govuk-frontend/govuk/components/details/README.md +15 -0
  96. data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -0
  97. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +87 -0
  98. data/node_modules/govuk-frontend/govuk/components/details/details.js +828 -0
  99. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +103 -0
  100. data/node_modules/govuk-frontend/govuk/components/details/implementation.md +43 -0
  101. data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +50 -0
  102. data/node_modules/govuk-frontend/govuk/components/details/macro.njk +3 -0
  103. data/node_modules/govuk-frontend/govuk/components/details/template.njk +10 -0
  104. data/node_modules/govuk-frontend/govuk/components/error-message/README.md +15 -0
  105. data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -0
  106. data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
  107. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +77 -0
  108. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +38 -0
  109. data/node_modules/govuk-frontend/govuk/components/error-message/macro.njk +3 -0
  110. data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +6 -0
  111. data/node_modules/govuk-frontend/govuk/components/error-summary/README.md +15 -0
  112. data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -0
  113. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +43 -0
  114. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +853 -0
  115. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +242 -0
  116. data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +70 -0
  117. data/node_modules/govuk-frontend/govuk/components/error-summary/macro.njk +3 -0
  118. data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +25 -0
  119. data/node_modules/govuk-frontend/govuk/components/fieldset/README.md +15 -0
  120. data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -0
  121. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
  122. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +103 -0
  123. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +70 -0
  124. data/node_modules/govuk-frontend/govuk/components/fieldset/macro.njk +3 -0
  125. data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +22 -0
  126. data/node_modules/govuk-frontend/govuk/components/file-upload/README.md +15 -0
  127. data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -0
  128. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +49 -0
  129. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +198 -0
  130. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +73 -0
  131. data/node_modules/govuk-frontend/govuk/components/file-upload/macro.njk +3 -0
  132. data/node_modules/govuk-frontend/govuk/components/file-upload/template.njk +44 -0
  133. data/node_modules/govuk-frontend/govuk/components/footer/README.md +15 -0
  134. data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -0
  135. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +241 -0
  136. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +501 -0
  137. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +118 -0
  138. data/node_modules/govuk-frontend/govuk/components/footer/macro.njk +3 -0
  139. data/node_modules/govuk-frontend/govuk/components/footer/template.njk +87 -0
  140. data/node_modules/govuk-frontend/govuk/components/header/README.md +15 -0
  141. data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -0
  142. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +331 -0
  143. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +378 -0
  144. data/node_modules/govuk-frontend/govuk/components/header/header.js +1066 -0
  145. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +106 -0
  146. data/node_modules/govuk-frontend/govuk/components/header/macro.njk +3 -0
  147. data/node_modules/govuk-frontend/govuk/components/header/template.njk +79 -0
  148. data/node_modules/govuk-frontend/govuk/components/hint/README.md +15 -0
  149. data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -0
  150. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +44 -0
  151. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +59 -0
  152. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +32 -0
  153. data/node_modules/govuk-frontend/govuk/components/hint/macro.njk +3 -0
  154. data/node_modules/govuk-frontend/govuk/components/hint/template.njk +4 -0
  155. data/node_modules/govuk-frontend/govuk/components/input/README.md +15 -0
  156. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +191 -0
  157. data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -0
  158. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +628 -0
  159. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +167 -0
  160. data/node_modules/govuk-frontend/govuk/components/input/macro.njk +3 -0
  161. data/node_modules/govuk-frontend/govuk/components/input/template.njk +65 -0
  162. data/node_modules/govuk-frontend/govuk/components/inset-text/README.md +15 -0
  163. data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
  164. data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -0
  165. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +58 -0
  166. data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +32 -0
  167. data/node_modules/govuk-frontend/govuk/components/inset-text/macro.njk +3 -0
  168. data/node_modules/govuk-frontend/govuk/components/inset-text/template.njk +4 -0
  169. data/node_modules/govuk-frontend/govuk/components/label/README.md +15 -0
  170. data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
  171. data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -0
  172. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +84 -0
  173. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +38 -0
  174. data/node_modules/govuk-frontend/govuk/components/label/macro.njk +3 -0
  175. data/node_modules/govuk-frontend/govuk/components/label/template.njk +15 -0
  176. data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
  177. data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
  178. data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
  179. data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
  180. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
  181. data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
  182. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
  183. data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
  184. data/node_modules/govuk-frontend/govuk/components/panel/README.md +15 -0
  185. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +44 -0
  186. data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -0
  187. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +91 -0
  188. data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +44 -0
  189. data/node_modules/govuk-frontend/govuk/components/panel/macro.njk +3 -0
  190. data/node_modules/govuk-frontend/govuk/components/panel/template.njk +13 -0
  191. data/node_modules/govuk-frontend/govuk/components/phase-banner/README.md +15 -0
  192. data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
  193. data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -0
  194. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +76 -0
  195. data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +33 -0
  196. data/node_modules/govuk-frontend/govuk/components/phase-banner/macro.njk +3 -0
  197. data/node_modules/govuk-frontend/govuk/components/phase-banner/template.njk +15 -0
  198. data/node_modules/govuk-frontend/govuk/components/radios/README.md +15 -0
  199. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
  200. data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -0
  201. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1183 -0
  202. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +143 -0
  203. data/node_modules/govuk-frontend/govuk/components/radios/macro.njk +3 -0
  204. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +1148 -0
  205. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +116 -0
  206. data/node_modules/govuk-frontend/govuk/components/select/README.md +15 -0
  207. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +49 -0
  208. data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -0
  209. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +327 -0
  210. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +105 -0
  211. data/node_modules/govuk-frontend/govuk/components/select/macro.njk +3 -0
  212. data/node_modules/govuk-frontend/govuk/components/select/template.njk +51 -0
  213. data/node_modules/govuk-frontend/govuk/components/skip-link/README.md +15 -0
  214. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +36 -0
  215. data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -0
  216. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +84 -0
  217. data/node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json +32 -0
  218. data/node_modules/govuk-frontend/govuk/components/skip-link/macro.njk +3 -0
  219. data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +3 -0
  220. data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +15 -0
  221. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +145 -0
  222. data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -0
  223. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +1084 -0
  224. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +113 -0
  225. data/node_modules/govuk-frontend/govuk/components/summary-list/macro.njk +3 -0
  226. data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +47 -0
  227. data/node_modules/govuk-frontend/govuk/components/table/README.md +15 -0
  228. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +71 -0
  229. data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -0
  230. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +538 -0
  231. data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +132 -0
  232. data/node_modules/govuk-frontend/govuk/components/table/macro.njk +3 -0
  233. data/node_modules/govuk-frontend/govuk/components/table/template.njk +45 -0
  234. data/node_modules/govuk-frontend/govuk/components/tabs/README.md +15 -0
  235. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +130 -0
  236. data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -0
  237. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +286 -0
  238. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +84 -0
  239. data/node_modules/govuk-frontend/govuk/components/tabs/macro.njk +3 -0
  240. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +1347 -0
  241. data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +32 -0
  242. data/node_modules/govuk-frontend/govuk/components/tag/README.md +15 -0
  243. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +86 -0
  244. data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -0
  245. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +131 -0
  246. data/node_modules/govuk-frontend/govuk/components/tag/macro-options.json +26 -0
  247. data/node_modules/govuk-frontend/govuk/components/tag/macro.njk +3 -0
  248. data/node_modules/govuk-frontend/govuk/components/tag/template.njk +3 -0
  249. data/node_modules/govuk-frontend/govuk/components/textarea/README.md +15 -0
  250. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +47 -0
  251. data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -0
  252. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +250 -0
  253. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +91 -0
  254. data/node_modules/govuk-frontend/govuk/components/textarea/macro.njk +3 -0
  255. data/node_modules/govuk-frontend/govuk/components/textarea/template.njk +45 -0
  256. data/node_modules/govuk-frontend/govuk/components/warning-text/README.md +15 -0
  257. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +66 -0
  258. data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -0
  259. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +73 -0
  260. data/node_modules/govuk-frontend/govuk/components/warning-text/macro-options.json +32 -0
  261. data/node_modules/govuk-frontend/govuk/components/warning-text/macro.njk +3 -0
  262. data/node_modules/govuk-frontend/govuk/components/warning-text/template.njk +9 -0
  263. data/node_modules/govuk-frontend/govuk/core/_all.scss +6 -0
  264. data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +25 -0
  265. data/node_modules/govuk-frontend/govuk/core/_links.scss +41 -0
  266. data/node_modules/govuk-frontend/govuk/core/_lists.scss +72 -0
  267. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +62 -0
  268. data/node_modules/govuk-frontend/govuk/core/_template.scss +36 -0
  269. data/node_modules/govuk-frontend/govuk/core/_typography.scss +192 -0
  270. data/node_modules/govuk-frontend/govuk/helpers/_all.scss +12 -0
  271. data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +15 -0
  272. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +95 -0
  273. data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +37 -0
  274. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +28 -0
  275. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
  276. data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +61 -0
  277. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +427 -0
  278. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +91 -0
  279. data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +80 -0
  280. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +153 -0
  281. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +207 -0
  282. data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +84 -0
  283. data/node_modules/govuk-frontend/govuk/objects/_all.scss +5 -0
  284. data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +101 -0
  285. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +23 -0
  286. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +24 -0
  287. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +68 -0
  288. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +88 -0
  289. data/node_modules/govuk-frontend/govuk/overrides/_all.scss +4 -0
  290. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +30 -0
  291. data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +64 -0
  292. data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +27 -0
  293. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +52 -0
  294. data/node_modules/govuk-frontend/govuk/settings/_all.scss +23 -0
  295. data/node_modules/govuk-frontend/govuk/settings/_assets.scss +82 -0
  296. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +155 -0
  297. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +139 -0
  298. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +108 -0
  299. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +74 -0
  300. data/node_modules/govuk-frontend/govuk/settings/_global-styles.scss +13 -0
  301. data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +18 -0
  302. data/node_modules/govuk-frontend/govuk/settings/_links.scss +62 -0
  303. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +105 -0
  304. data/node_modules/govuk-frontend/govuk/settings/_media-queries.scss +23 -0
  305. data/node_modules/govuk-frontend/govuk/settings/_spacing.scss +80 -0
  306. data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +32 -0
  307. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +89 -0
  308. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +183 -0
  309. data/node_modules/govuk-frontend/govuk/template.njk +60 -0
  310. data/node_modules/govuk-frontend/govuk/tools/_all.scss +8 -0
  311. data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +36 -0
  312. data/node_modules/govuk-frontend/govuk/tools/_exports.scss +33 -0
  313. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +25 -0
  314. data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +51 -0
  315. data/node_modules/govuk-frontend/govuk/tools/_iff.scss +17 -0
  316. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +25 -0
  317. data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +20 -0
  318. data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +20 -0
  319. data/node_modules/govuk-frontend/govuk/utilities/_all.scss +2 -0
  320. data/node_modules/govuk-frontend/govuk/utilities/_clearfix.scss +5 -0
  321. data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +9 -0
  322. data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +347 -0
  323. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +272 -0
  324. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +34 -0
  325. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +147 -0
  326. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +589 -0
  327. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +54 -0
  328. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +31 -0
  329. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +254 -0
  330. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +254 -0
  331. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +504 -0
  332. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +252 -0
  333. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +94 -0
  334. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +28 -0
  335. data/node_modules/govuk-frontend/package.json +56 -0
  336. data/package-lock.json +13 -0
  337. data/package.json +29 -0
  338. data/vendor/assets/fonts/bold-affa96571d-v2.woff +0 -0
  339. data/vendor/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  340. data/vendor/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  341. data/vendor/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  342. data/vendor/assets/images/favicon.ico +0 -0
  343. data/vendor/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
  344. data/vendor/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
  345. data/vendor/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
  346. data/vendor/assets/images/govuk-apple-touch-icon.png +0 -0
  347. data/vendor/assets/images/govuk-crest-2x.png +0 -0
  348. data/vendor/assets/images/govuk-crest.png +0 -0
  349. data/vendor/assets/images/govuk-logotype-crown.png +0 -0
  350. data/vendor/assets/images/govuk-mask-icon.svg +7 -0
  351. data/vendor/assets/images/govuk-opengraph-image.png +0 -0
  352. data/vendor/assets/javascripts/defra_ruby_template.js +2616 -0
  353. data/vendor/assets/stylesheets/_base.scss +3 -0
  354. data/vendor/assets/stylesheets/all-ie8.scss +6 -0
  355. data/vendor/assets/stylesheets/all.scss +9 -0
  356. data/vendor/assets/stylesheets/components/_all.scss +33 -0
  357. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -0
  358. data/vendor/assets/stylesheets/components/accordion/_index.scss +197 -0
  359. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -0
  360. data/vendor/assets/stylesheets/components/back-link/_index.scss +99 -0
  361. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -0
  362. data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +138 -0
  363. data/vendor/assets/stylesheets/components/button/_button.scss +2 -0
  364. data/vendor/assets/stylesheets/components/button/_index.scss +288 -0
  365. data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -0
  366. data/vendor/assets/stylesheets/components/character-count/_index.scss +25 -0
  367. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -0
  368. data/vendor/assets/stylesheets/components/checkboxes/_index.scss +320 -0
  369. data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +2 -0
  370. data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +51 -0
  371. data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -0
  372. data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
  373. data/vendor/assets/stylesheets/components/details/_details.scss +2 -0
  374. data/vendor/assets/stylesheets/components/details/_index.scss +87 -0
  375. data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -0
  376. data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
  377. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -0
  378. data/vendor/assets/stylesheets/components/error-summary/_index.scss +43 -0
  379. data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -0
  380. data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
  381. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -0
  382. data/vendor/assets/stylesheets/components/file-upload/_index.scss +49 -0
  383. data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -0
  384. data/vendor/assets/stylesheets/components/footer/_index.scss +241 -0
  385. data/vendor/assets/stylesheets/components/header/_header.scss +2 -0
  386. data/vendor/assets/stylesheets/components/header/_index.scss +331 -0
  387. data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -0
  388. data/vendor/assets/stylesheets/components/hint/_index.scss +44 -0
  389. data/vendor/assets/stylesheets/components/input/_index.scss +191 -0
  390. data/vendor/assets/stylesheets/components/input/_input.scss +2 -0
  391. data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
  392. data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -0
  393. data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
  394. data/vendor/assets/stylesheets/components/label/_label.scss +2 -0
  395. data/vendor/assets/stylesheets/components/notification-banner/_index.scss +89 -0
  396. data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +2 -0
  397. data/vendor/assets/stylesheets/components/panel/_index.scss +44 -0
  398. data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -0
  399. data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
  400. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -0
  401. data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
  402. data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -0
  403. data/vendor/assets/stylesheets/components/select/_index.scss +49 -0
  404. data/vendor/assets/stylesheets/components/select/_select.scss +2 -0
  405. data/vendor/assets/stylesheets/components/skip-link/_index.scss +36 -0
  406. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -0
  407. data/vendor/assets/stylesheets/components/summary-list/_index.scss +145 -0
  408. data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -0
  409. data/vendor/assets/stylesheets/components/table/_index.scss +71 -0
  410. data/vendor/assets/stylesheets/components/table/_table.scss +2 -0
  411. data/vendor/assets/stylesheets/components/tabs/_index.scss +130 -0
  412. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -0
  413. data/vendor/assets/stylesheets/components/tag/_index.scss +86 -0
  414. data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -0
  415. data/vendor/assets/stylesheets/components/textarea/_index.scss +47 -0
  416. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -0
  417. data/vendor/assets/stylesheets/components/warning-text/_index.scss +66 -0
  418. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -0
  419. data/vendor/assets/stylesheets/core/_all.scss +6 -0
  420. data/vendor/assets/stylesheets/core/_global-styles.scss +25 -0
  421. data/vendor/assets/stylesheets/core/_links.scss +41 -0
  422. data/vendor/assets/stylesheets/core/_lists.scss +72 -0
  423. data/vendor/assets/stylesheets/core/_section-break.scss +62 -0
  424. data/vendor/assets/stylesheets/core/_template.scss +36 -0
  425. data/vendor/assets/stylesheets/core/_typography.scss +192 -0
  426. data/vendor/assets/stylesheets/defra_ruby_template.scss +16 -0
  427. data/vendor/assets/stylesheets/helpers/_all.scss +12 -0
  428. data/vendor/assets/stylesheets/helpers/_clearfix.scss +15 -0
  429. data/vendor/assets/stylesheets/helpers/_colour.scss +95 -0
  430. data/vendor/assets/stylesheets/helpers/_device-pixels.scss +37 -0
  431. data/vendor/assets/stylesheets/helpers/_focused.scss +28 -0
  432. data/vendor/assets/stylesheets/helpers/_font-faces.scss +41 -0
  433. data/vendor/assets/stylesheets/helpers/_grid.scss +61 -0
  434. data/vendor/assets/stylesheets/helpers/_links.scss +427 -0
  435. data/vendor/assets/stylesheets/helpers/_media-queries.scss +91 -0
  436. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +80 -0
  437. data/vendor/assets/stylesheets/helpers/_spacing.scss +153 -0
  438. data/vendor/assets/stylesheets/helpers/_typography.scss +207 -0
  439. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +84 -0
  440. data/vendor/assets/stylesheets/objects/_all.scss +5 -0
  441. data/vendor/assets/stylesheets/objects/_button-group.scss +101 -0
  442. data/vendor/assets/stylesheets/objects/_form-group.scss +23 -0
  443. data/vendor/assets/stylesheets/objects/_grid.scss +24 -0
  444. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +68 -0
  445. data/vendor/assets/stylesheets/objects/_width-container.scss +88 -0
  446. data/vendor/assets/stylesheets/overrides/_all.scss +4 -0
  447. data/vendor/assets/stylesheets/overrides/_display.scss +30 -0
  448. data/vendor/assets/stylesheets/overrides/_spacing.scss +64 -0
  449. data/vendor/assets/stylesheets/overrides/_typography.scss +27 -0
  450. data/vendor/assets/stylesheets/overrides/_width.scss +52 -0
  451. data/vendor/assets/stylesheets/settings/_all.scss +23 -0
  452. data/vendor/assets/stylesheets/settings/_assets.scss +82 -0
  453. data/vendor/assets/stylesheets/settings/_colours-applied.scss +155 -0
  454. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +139 -0
  455. data/vendor/assets/stylesheets/settings/_colours-palette.scss +108 -0
  456. data/vendor/assets/stylesheets/settings/_compatibility.scss +74 -0
  457. data/vendor/assets/stylesheets/settings/_global-styles.scss +13 -0
  458. data/vendor/assets/stylesheets/settings/_ie8.scss +18 -0
  459. data/vendor/assets/stylesheets/settings/_links.scss +62 -0
  460. data/vendor/assets/stylesheets/settings/_measurements.scss +105 -0
  461. data/vendor/assets/stylesheets/settings/_media-queries.scss +23 -0
  462. data/vendor/assets/stylesheets/settings/_spacing.scss +80 -0
  463. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +32 -0
  464. data/vendor/assets/stylesheets/settings/_typography-font.scss +89 -0
  465. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +183 -0
  466. data/vendor/assets/stylesheets/tools/_all.scss +8 -0
  467. data/vendor/assets/stylesheets/tools/_compatibility.scss +36 -0
  468. data/vendor/assets/stylesheets/tools/_exports.scss +33 -0
  469. data/vendor/assets/stylesheets/tools/_font-url.scss +25 -0
  470. data/vendor/assets/stylesheets/tools/_ie8.scss +51 -0
  471. data/vendor/assets/stylesheets/tools/_iff.scss +17 -0
  472. data/vendor/assets/stylesheets/tools/_image-url.scss +25 -0
  473. data/vendor/assets/stylesheets/tools/_px-to-em.scss +20 -0
  474. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +20 -0
  475. data/vendor/assets/stylesheets/utilities/_all.scss +2 -0
  476. data/vendor/assets/stylesheets/utilities/_clearfix.scss +5 -0
  477. data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +9 -0
  478. data/vendor/assets/stylesheets/vendor/_sass-mq.scss +347 -0
  479. metadata +520 -0
@@ -0,0 +1,84 @@
1
+ [
2
+ {
3
+ "name": "id",
4
+ "type": "string",
5
+ "required": false,
6
+ "description": "This is used for the main component and to compose id attribute for each item."
7
+ },
8
+ {
9
+ "name": "idPrefix",
10
+ "type": "string",
11
+ "required": false,
12
+ "description": "String to prefix id for each tab item if no id is specified on each item"
13
+ },
14
+ {
15
+ "name": "title",
16
+ "type": "string",
17
+ "required": false,
18
+ "description": "Title for the tabs table of contents"
19
+ },
20
+ {
21
+ "name": "items",
22
+ "type": "array",
23
+ "required": true,
24
+ "description": "Array of tab items.",
25
+ "params": [
26
+ {
27
+ "name": "id",
28
+ "type": "string",
29
+ "required": true,
30
+ "description": "Specific id attribute for the tab item. If omitted, then `idPrefix` string is required instead."
31
+ },
32
+ {
33
+ "name": "label",
34
+ "type": "string",
35
+ "required": true,
36
+ "description": "The text label of a tab item."
37
+ },
38
+ {
39
+ "name": "attributes",
40
+ "type": "object",
41
+ "required": false,
42
+ "description": "HTML attributes (for example data attributes) to add to the tab."
43
+ },
44
+ {
45
+ "name": "panel",
46
+ "description": "Content for the panel",
47
+ "type": "object",
48
+ "required": true,
49
+ "params": [
50
+ {
51
+ "name": "text",
52
+ "type": "string",
53
+ "required": true,
54
+ "description": "If `html` is set, this is not required. Text to use within each tab panel. If `html` is provided, the `text` argument will be ignored."
55
+ },
56
+ {
57
+ "name": "html",
58
+ "type": "string",
59
+ "required": true,
60
+ "description": "If `text` is set, this is not required. HTML to use within the each tab panel. If `html` is provided, the `text` argument will be ignored."
61
+ },
62
+ {
63
+ "name": "attributes",
64
+ "type": "object",
65
+ "required": false,
66
+ "description": "HTML attributes (for example data attributes) to add to the tab panel."
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "name": "classes",
74
+ "type": "string",
75
+ "required": false,
76
+ "description": "Classes to add to the tabs component."
77
+ },
78
+ {
79
+ "name": "attributes",
80
+ "type": "object",
81
+ "required": false,
82
+ "description": "HTML attributes (for example data attributes) to add to the tabs component."
83
+ }
84
+ ]
@@ -0,0 +1,3 @@
1
+ {% macro govukTabs(params) %}
2
+ {%- include "./template.njk" -%}
3
+ {% endmacro %}
@@ -0,0 +1,1347 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
4
+ (global.GOVUKFrontend = factory());
5
+ }(this, (function () { 'use strict';
6
+
7
+ (function(undefined) {
8
+
9
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Object/defineProperty/detect.js
10
+ var detect = (
11
+ // In IE8, defineProperty could only act on DOM elements, so full support
12
+ // for the feature requires the ability to set a property on an arbitrary object
13
+ 'defineProperty' in Object && (function() {
14
+ try {
15
+ var a = {};
16
+ Object.defineProperty(a, 'test', {value:42});
17
+ return true;
18
+ } catch(e) {
19
+ return false
20
+ }
21
+ }())
22
+ );
23
+
24
+ if (detect) return
25
+
26
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Object.defineProperty&flags=always
27
+ (function (nativeDefineProperty) {
28
+
29
+ var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__');
30
+ var ERR_ACCESSORS_NOT_SUPPORTED = 'Getters & setters cannot be defined on this javascript engine';
31
+ var ERR_VALUE_ACCESSORS = 'A property cannot both have accessors and be writable or have a value';
32
+
33
+ Object.defineProperty = function defineProperty(object, property, descriptor) {
34
+
35
+ // Where native support exists, assume it
36
+ if (nativeDefineProperty && (object === window || object === document || object === Element.prototype || object instanceof Element)) {
37
+ return nativeDefineProperty(object, property, descriptor);
38
+ }
39
+
40
+ if (object === null || !(object instanceof Object || typeof object === 'object')) {
41
+ throw new TypeError('Object.defineProperty called on non-object');
42
+ }
43
+
44
+ if (!(descriptor instanceof Object)) {
45
+ throw new TypeError('Property description must be an object');
46
+ }
47
+
48
+ var propertyString = String(property);
49
+ var hasValueOrWritable = 'value' in descriptor || 'writable' in descriptor;
50
+ var getterType = 'get' in descriptor && typeof descriptor.get;
51
+ var setterType = 'set' in descriptor && typeof descriptor.set;
52
+
53
+ // handle descriptor.get
54
+ if (getterType) {
55
+ if (getterType !== 'function') {
56
+ throw new TypeError('Getter must be a function');
57
+ }
58
+ if (!supportsAccessors) {
59
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
60
+ }
61
+ if (hasValueOrWritable) {
62
+ throw new TypeError(ERR_VALUE_ACCESSORS);
63
+ }
64
+ Object.__defineGetter__.call(object, propertyString, descriptor.get);
65
+ } else {
66
+ object[propertyString] = descriptor.value;
67
+ }
68
+
69
+ // handle descriptor.set
70
+ if (setterType) {
71
+ if (setterType !== 'function') {
72
+ throw new TypeError('Setter must be a function');
73
+ }
74
+ if (!supportsAccessors) {
75
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
76
+ }
77
+ if (hasValueOrWritable) {
78
+ throw new TypeError(ERR_VALUE_ACCESSORS);
79
+ }
80
+ Object.__defineSetter__.call(object, propertyString, descriptor.set);
81
+ }
82
+
83
+ // OK to define value unconditionally - if a getter has been specified as well, an error would be thrown above
84
+ if ('value' in descriptor) {
85
+ object[propertyString] = descriptor.value;
86
+ }
87
+
88
+ return object;
89
+ };
90
+ }(Object.defineProperty));
91
+ })
92
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
93
+
94
+ (function(undefined) {
95
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Function/prototype/bind/detect.js
96
+ var detect = 'bind' in Function.prototype;
97
+
98
+ if (detect) return
99
+
100
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Function.prototype.bind&flags=always
101
+ Object.defineProperty(Function.prototype, 'bind', {
102
+ value: function bind(that) { // .length is 1
103
+ // add necessary es5-shim utilities
104
+ var $Array = Array;
105
+ var $Object = Object;
106
+ var ObjectPrototype = $Object.prototype;
107
+ var ArrayPrototype = $Array.prototype;
108
+ var Empty = function Empty() {};
109
+ var to_string = ObjectPrototype.toString;
110
+ var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
111
+ var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, tryFunctionObject = function tryFunctionObject(value) { try { fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]'; isCallable = function isCallable(value) { if (typeof value !== 'function') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
112
+ var array_slice = ArrayPrototype.slice;
113
+ var array_concat = ArrayPrototype.concat;
114
+ var array_push = ArrayPrototype.push;
115
+ var max = Math.max;
116
+ // /add necessary es5-shim utilities
117
+
118
+ // 1. Let Target be the this value.
119
+ var target = this;
120
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
121
+ if (!isCallable(target)) {
122
+ throw new TypeError('Function.prototype.bind called on incompatible ' + target);
123
+ }
124
+ // 3. Let A be a new (possibly empty) internal list of all of the
125
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
126
+ // XXX slicedArgs will stand in for "A" if used
127
+ var args = array_slice.call(arguments, 1); // for normal call
128
+ // 4. Let F be a new native ECMAScript object.
129
+ // 11. Set the [[Prototype]] internal property of F to the standard
130
+ // built-in Function prototype object as specified in 15.3.3.1.
131
+ // 12. Set the [[Call]] internal property of F as described in
132
+ // 15.3.4.5.1.
133
+ // 13. Set the [[Construct]] internal property of F as described in
134
+ // 15.3.4.5.2.
135
+ // 14. Set the [[HasInstance]] internal property of F as described in
136
+ // 15.3.4.5.3.
137
+ var bound;
138
+ var binder = function () {
139
+
140
+ if (this instanceof bound) {
141
+ // 15.3.4.5.2 [[Construct]]
142
+ // When the [[Construct]] internal method of a function object,
143
+ // F that was created using the bind function is called with a
144
+ // list of arguments ExtraArgs, the following steps are taken:
145
+ // 1. Let target be the value of F's [[TargetFunction]]
146
+ // internal property.
147
+ // 2. If target has no [[Construct]] internal method, a
148
+ // TypeError exception is thrown.
149
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
150
+ // property.
151
+ // 4. Let args be a new list containing the same values as the
152
+ // list boundArgs in the same order followed by the same
153
+ // values as the list ExtraArgs in the same order.
154
+ // 5. Return the result of calling the [[Construct]] internal
155
+ // method of target providing args as the arguments.
156
+
157
+ var result = target.apply(
158
+ this,
159
+ array_concat.call(args, array_slice.call(arguments))
160
+ );
161
+ if ($Object(result) === result) {
162
+ return result;
163
+ }
164
+ return this;
165
+
166
+ } else {
167
+ // 15.3.4.5.1 [[Call]]
168
+ // When the [[Call]] internal method of a function object, F,
169
+ // which was created using the bind function is called with a
170
+ // this value and a list of arguments ExtraArgs, the following
171
+ // steps are taken:
172
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
173
+ // property.
174
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
175
+ // property.
176
+ // 3. Let target be the value of F's [[TargetFunction]] internal
177
+ // property.
178
+ // 4. Let args be a new list containing the same values as the
179
+ // list boundArgs in the same order followed by the same
180
+ // values as the list ExtraArgs in the same order.
181
+ // 5. Return the result of calling the [[Call]] internal method
182
+ // of target providing boundThis as the this value and
183
+ // providing args as the arguments.
184
+
185
+ // equiv: target.call(this, ...boundArgs, ...args)
186
+ return target.apply(
187
+ that,
188
+ array_concat.call(args, array_slice.call(arguments))
189
+ );
190
+
191
+ }
192
+
193
+ };
194
+
195
+ // 15. If the [[Class]] internal property of Target is "Function", then
196
+ // a. Let L be the length property of Target minus the length of A.
197
+ // b. Set the length own property of F to either 0 or L, whichever is
198
+ // larger.
199
+ // 16. Else set the length own property of F to 0.
200
+
201
+ var boundLength = max(0, target.length - args.length);
202
+
203
+ // 17. Set the attributes of the length own property of F to the values
204
+ // specified in 15.3.5.1.
205
+ var boundArgs = [];
206
+ for (var i = 0; i < boundLength; i++) {
207
+ array_push.call(boundArgs, '$' + i);
208
+ }
209
+
210
+ // XXX Build a dynamic function with desired amount of arguments is the only
211
+ // way to set the length property of a function.
212
+ // In environments where Content Security Policies enabled (Chrome extensions,
213
+ // for ex.) all use of eval or Function costructor throws an exception.
214
+ // However in all of these environments Function.prototype.bind exists
215
+ // and so this code will never be executed.
216
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
217
+
218
+ if (target.prototype) {
219
+ Empty.prototype = target.prototype;
220
+ bound.prototype = new Empty();
221
+ // Clean up dangling references.
222
+ Empty.prototype = null;
223
+ }
224
+
225
+ // TODO
226
+ // 18. Set the [[Extensible]] internal property of F to true.
227
+
228
+ // TODO
229
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
230
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
231
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
232
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
233
+ // false.
234
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
235
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
236
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
237
+ // and false.
238
+
239
+ // TODO
240
+ // NOTE Function objects created using Function.prototype.bind do not
241
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
242
+ // [[Scope]] internal properties.
243
+ // XXX can't delete prototype in pure-js.
244
+
245
+ // 22. Return F.
246
+ return bound;
247
+ }
248
+ });
249
+ })
250
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
251
+
252
+ (function(undefined) {
253
+
254
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/detect.js
255
+ var detect = (
256
+ 'DOMTokenList' in this && (function (x) {
257
+ return 'classList' in x ? !x.classList.toggle('x', false) && !x.className : true;
258
+ })(document.createElement('x'))
259
+ );
260
+
261
+ if (detect) return
262
+
263
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/polyfill.js
264
+ (function (global) {
265
+ var nativeImpl = "DOMTokenList" in global && global.DOMTokenList;
266
+
267
+ if (
268
+ !nativeImpl ||
269
+ (
270
+ !!document.createElementNS &&
271
+ !!document.createElementNS('http://www.w3.org/2000/svg', 'svg') &&
272
+ !(document.createElementNS("http://www.w3.org/2000/svg", "svg").classList instanceof DOMTokenList)
273
+ )
274
+ ) {
275
+ global.DOMTokenList = (function() { // eslint-disable-line no-unused-vars
276
+ var dpSupport = true;
277
+ var defineGetter = function (object, name, fn, configurable) {
278
+ if (Object.defineProperty)
279
+ Object.defineProperty(object, name, {
280
+ configurable: false === dpSupport ? true : !!configurable,
281
+ get: fn
282
+ });
283
+
284
+ else object.__defineGetter__(name, fn);
285
+ };
286
+
287
+ /** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */
288
+ try {
289
+ defineGetter({}, "support");
290
+ }
291
+ catch (e) {
292
+ dpSupport = false;
293
+ }
294
+
295
+
296
+ var _DOMTokenList = function (el, prop) {
297
+ var that = this;
298
+ var tokens = [];
299
+ var tokenMap = {};
300
+ var length = 0;
301
+ var maxLength = 0;
302
+ var addIndexGetter = function (i) {
303
+ defineGetter(that, i, function () {
304
+ preop();
305
+ return tokens[i];
306
+ }, false);
307
+
308
+ };
309
+ var reindex = function () {
310
+
311
+ /** Define getter functions for array-like access to the tokenList's contents. */
312
+ if (length >= maxLength)
313
+ for (; maxLength < length; ++maxLength) {
314
+ addIndexGetter(maxLength);
315
+ }
316
+ };
317
+
318
+ /** Helper function called at the start of each class method. Internal use only. */
319
+ var preop = function () {
320
+ var error;
321
+ var i;
322
+ var args = arguments;
323
+ var rSpace = /\s+/;
324
+
325
+ /** Validate the token/s passed to an instance method, if any. */
326
+ if (args.length)
327
+ for (i = 0; i < args.length; ++i)
328
+ if (rSpace.test(args[i])) {
329
+ error = new SyntaxError('String "' + args[i] + '" ' + "contains" + ' an invalid character');
330
+ error.code = 5;
331
+ error.name = "InvalidCharacterError";
332
+ throw error;
333
+ }
334
+
335
+
336
+ /** Split the new value apart by whitespace*/
337
+ if (typeof el[prop] === "object") {
338
+ tokens = ("" + el[prop].baseVal).replace(/^\s+|\s+$/g, "").split(rSpace);
339
+ } else {
340
+ tokens = ("" + el[prop]).replace(/^\s+|\s+$/g, "").split(rSpace);
341
+ }
342
+
343
+ /** Avoid treating blank strings as single-item token lists */
344
+ if ("" === tokens[0]) tokens = [];
345
+
346
+ /** Repopulate the internal token lists */
347
+ tokenMap = {};
348
+ for (i = 0; i < tokens.length; ++i)
349
+ tokenMap[tokens[i]] = true;
350
+ length = tokens.length;
351
+ reindex();
352
+ };
353
+
354
+ /** Populate our internal token list if the targeted attribute of the subject element isn't empty. */
355
+ preop();
356
+
357
+ /** Return the number of tokens in the underlying string. Read-only. */
358
+ defineGetter(that, "length", function () {
359
+ preop();
360
+ return length;
361
+ });
362
+
363
+ /** Override the default toString/toLocaleString methods to return a space-delimited list of tokens when typecast. */
364
+ that.toLocaleString =
365
+ that.toString = function () {
366
+ preop();
367
+ return tokens.join(" ");
368
+ };
369
+
370
+ that.item = function (idx) {
371
+ preop();
372
+ return tokens[idx];
373
+ };
374
+
375
+ that.contains = function (token) {
376
+ preop();
377
+ return !!tokenMap[token];
378
+ };
379
+
380
+ that.add = function () {
381
+ preop.apply(that, args = arguments);
382
+
383
+ for (var args, token, i = 0, l = args.length; i < l; ++i) {
384
+ token = args[i];
385
+ if (!tokenMap[token]) {
386
+ tokens.push(token);
387
+ tokenMap[token] = true;
388
+ }
389
+ }
390
+
391
+ /** Update the targeted attribute of the attached element if the token list's changed. */
392
+ if (length !== tokens.length) {
393
+ length = tokens.length >>> 0;
394
+ if (typeof el[prop] === "object") {
395
+ el[prop].baseVal = tokens.join(" ");
396
+ } else {
397
+ el[prop] = tokens.join(" ");
398
+ }
399
+ reindex();
400
+ }
401
+ };
402
+
403
+ that.remove = function () {
404
+ preop.apply(that, args = arguments);
405
+
406
+ /** Build a hash of token names to compare against when recollecting our token list. */
407
+ for (var args, ignore = {}, i = 0, t = []; i < args.length; ++i) {
408
+ ignore[args[i]] = true;
409
+ delete tokenMap[args[i]];
410
+ }
411
+
412
+ /** Run through our tokens list and reassign only those that aren't defined in the hash declared above. */
413
+ for (i = 0; i < tokens.length; ++i)
414
+ if (!ignore[tokens[i]]) t.push(tokens[i]);
415
+
416
+ tokens = t;
417
+ length = t.length >>> 0;
418
+
419
+ /** Update the targeted attribute of the attached element. */
420
+ if (typeof el[prop] === "object") {
421
+ el[prop].baseVal = tokens.join(" ");
422
+ } else {
423
+ el[prop] = tokens.join(" ");
424
+ }
425
+ reindex();
426
+ };
427
+
428
+ that.toggle = function (token, force) {
429
+ preop.apply(that, [token]);
430
+
431
+ /** Token state's being forced. */
432
+ if (undefined !== force) {
433
+ if (force) {
434
+ that.add(token);
435
+ return true;
436
+ } else {
437
+ that.remove(token);
438
+ return false;
439
+ }
440
+ }
441
+
442
+ /** Token already exists in tokenList. Remove it, and return FALSE. */
443
+ if (tokenMap[token]) {
444
+ that.remove(token);
445
+ return false;
446
+ }
447
+
448
+ /** Otherwise, add the token and return TRUE. */
449
+ that.add(token);
450
+ return true;
451
+ };
452
+
453
+ return that;
454
+ };
455
+
456
+ return _DOMTokenList;
457
+ }());
458
+ }
459
+
460
+ // Add second argument to native DOMTokenList.toggle() if necessary
461
+ (function () {
462
+ var e = document.createElement('span');
463
+ if (!('classList' in e)) return;
464
+ e.classList.toggle('x', false);
465
+ if (!e.classList.contains('x')) return;
466
+ e.classList.constructor.prototype.toggle = function toggle(token /*, force*/) {
467
+ var force = arguments[1];
468
+ if (force === undefined) {
469
+ var add = !this.contains(token);
470
+ this[add ? 'add' : 'remove'](token);
471
+ return add;
472
+ }
473
+ force = !!force;
474
+ this[force ? 'add' : 'remove'](token);
475
+ return force;
476
+ };
477
+ }());
478
+
479
+ // Add multiple arguments to native DOMTokenList.add() if necessary
480
+ (function () {
481
+ var e = document.createElement('span');
482
+ if (!('classList' in e)) return;
483
+ e.classList.add('a', 'b');
484
+ if (e.classList.contains('b')) return;
485
+ var native = e.classList.constructor.prototype.add;
486
+ e.classList.constructor.prototype.add = function () {
487
+ var args = arguments;
488
+ var l = arguments.length;
489
+ for (var i = 0; i < l; i++) {
490
+ native.call(this, args[i]);
491
+ }
492
+ };
493
+ }());
494
+
495
+ // Add multiple arguments to native DOMTokenList.remove() if necessary
496
+ (function () {
497
+ var e = document.createElement('span');
498
+ if (!('classList' in e)) return;
499
+ e.classList.add('a');
500
+ e.classList.add('b');
501
+ e.classList.remove('a', 'b');
502
+ if (!e.classList.contains('b')) return;
503
+ var native = e.classList.constructor.prototype.remove;
504
+ e.classList.constructor.prototype.remove = function () {
505
+ var args = arguments;
506
+ var l = arguments.length;
507
+ for (var i = 0; i < l; i++) {
508
+ native.call(this, args[i]);
509
+ }
510
+ };
511
+ }());
512
+
513
+ }(this));
514
+
515
+ }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
516
+
517
+ (function(undefined) {
518
+
519
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Document/detect.js
520
+ var detect = ("Document" in this);
521
+
522
+ if (detect) return
523
+
524
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Document&flags=always
525
+ if ((typeof WorkerGlobalScope === "undefined") && (typeof importScripts !== "function")) {
526
+
527
+ if (this.HTMLDocument) { // IE8
528
+
529
+ // HTMLDocument is an extension of Document. If the browser has HTMLDocument but not Document, the former will suffice as an alias for the latter.
530
+ this.Document = this.HTMLDocument;
531
+
532
+ } else {
533
+
534
+ // Create an empty function to act as the missing constructor for the document object, attach the document object as its prototype. The function needs to be anonymous else it is hoisted and causes the feature detect to prematurely pass, preventing the assignments below being made.
535
+ this.Document = this.HTMLDocument = document.constructor = (new Function('return function Document() {}')());
536
+ this.Document.prototype = document;
537
+ }
538
+ }
539
+
540
+
541
+ })
542
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
543
+
544
+ (function(undefined) {
545
+
546
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Element/detect.js
547
+ var detect = ('Element' in this && 'HTMLElement' in this);
548
+
549
+ if (detect) return
550
+
551
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Element&flags=always
552
+ (function () {
553
+
554
+ // IE8
555
+ if (window.Element && !window.HTMLElement) {
556
+ window.HTMLElement = window.Element;
557
+ return;
558
+ }
559
+
560
+ // create Element constructor
561
+ window.Element = window.HTMLElement = new Function('return function Element() {}')();
562
+
563
+ // generate sandboxed iframe
564
+ var vbody = document.appendChild(document.createElement('body'));
565
+ var frame = vbody.appendChild(document.createElement('iframe'));
566
+
567
+ // use sandboxed iframe to replicate Element functionality
568
+ var frameDocument = frame.contentWindow.document;
569
+ var prototype = Element.prototype = frameDocument.appendChild(frameDocument.createElement('*'));
570
+ var cache = {};
571
+
572
+ // polyfill Element.prototype on an element
573
+ var shiv = function (element, deep) {
574
+ var
575
+ childNodes = element.childNodes || [],
576
+ index = -1,
577
+ key, value, childNode;
578
+
579
+ if (element.nodeType === 1 && element.constructor !== Element) {
580
+ element.constructor = Element;
581
+
582
+ for (key in cache) {
583
+ value = cache[key];
584
+ element[key] = value;
585
+ }
586
+ }
587
+
588
+ while (childNode = deep && childNodes[++index]) {
589
+ shiv(childNode, deep);
590
+ }
591
+
592
+ return element;
593
+ };
594
+
595
+ var elements = document.getElementsByTagName('*');
596
+ var nativeCreateElement = document.createElement;
597
+ var interval;
598
+ var loopLimit = 100;
599
+
600
+ prototype.attachEvent('onpropertychange', function (event) {
601
+ var
602
+ propertyName = event.propertyName,
603
+ nonValue = !cache.hasOwnProperty(propertyName),
604
+ newValue = prototype[propertyName],
605
+ oldValue = cache[propertyName],
606
+ index = -1,
607
+ element;
608
+
609
+ while (element = elements[++index]) {
610
+ if (element.nodeType === 1) {
611
+ if (nonValue || element[propertyName] === oldValue) {
612
+ element[propertyName] = newValue;
613
+ }
614
+ }
615
+ }
616
+
617
+ cache[propertyName] = newValue;
618
+ });
619
+
620
+ prototype.constructor = Element;
621
+
622
+ if (!prototype.hasAttribute) {
623
+ // <Element>.hasAttribute
624
+ prototype.hasAttribute = function hasAttribute(name) {
625
+ return this.getAttribute(name) !== null;
626
+ };
627
+ }
628
+
629
+ // Apply Element prototype to the pre-existing DOM as soon as the body element appears.
630
+ function bodyCheck() {
631
+ if (!(loopLimit--)) clearTimeout(interval);
632
+ if (document.body && !document.body.prototype && /(complete|interactive)/.test(document.readyState)) {
633
+ shiv(document, true);
634
+ if (interval && document.body.prototype) clearTimeout(interval);
635
+ return (!!document.body.prototype);
636
+ }
637
+ return false;
638
+ }
639
+ if (!bodyCheck()) {
640
+ document.onreadystatechange = bodyCheck;
641
+ interval = setInterval(bodyCheck, 25);
642
+ }
643
+
644
+ // Apply to any new elements created after load
645
+ document.createElement = function createElement(nodeName) {
646
+ var element = nativeCreateElement(String(nodeName).toLowerCase());
647
+ return shiv(element);
648
+ };
649
+
650
+ // remove sandboxed iframe
651
+ document.removeChild(vbody);
652
+ }());
653
+
654
+ })
655
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
656
+
657
+ (function(undefined) {
658
+
659
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-service/8717a9e04ac7aff99b4980fbedead98036b0929a/packages/polyfill-library/polyfills/Element/prototype/classList/detect.js
660
+ var detect = (
661
+ 'document' in this && "classList" in document.documentElement && 'Element' in this && 'classList' in Element.prototype && (function () {
662
+ var e = document.createElement('span');
663
+ e.classList.add('a', 'b');
664
+ return e.classList.contains('b');
665
+ }())
666
+ );
667
+
668
+ if (detect) return
669
+
670
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Element.prototype.classList&flags=always
671
+ (function (global) {
672
+ var dpSupport = true;
673
+ var defineGetter = function (object, name, fn, configurable) {
674
+ if (Object.defineProperty)
675
+ Object.defineProperty(object, name, {
676
+ configurable: false === dpSupport ? true : !!configurable,
677
+ get: fn
678
+ });
679
+
680
+ else object.__defineGetter__(name, fn);
681
+ };
682
+ /** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */
683
+ try {
684
+ defineGetter({}, "support");
685
+ }
686
+ catch (e) {
687
+ dpSupport = false;
688
+ }
689
+ /** Polyfills a property with a DOMTokenList */
690
+ var addProp = function (o, name, attr) {
691
+
692
+ defineGetter(o.prototype, name, function () {
693
+ var tokenList;
694
+
695
+ var THIS = this,
696
+
697
+ /** Prevent this from firing twice for some reason. What the hell, IE. */
698
+ gibberishProperty = "__defineGetter__" + "DEFINE_PROPERTY" + name;
699
+ if(THIS[gibberishProperty]) return tokenList;
700
+ THIS[gibberishProperty] = true;
701
+
702
+ /**
703
+ * IE8 can't define properties on native JavaScript objects, so we'll use a dumb hack instead.
704
+ *
705
+ * What this is doing is creating a dummy element ("reflection") inside a detached phantom node ("mirror")
706
+ * that serves as the target of Object.defineProperty instead. While we could simply use the subject HTML
707
+ * element instead, this would conflict with element types which use indexed properties (such as forms and
708
+ * select lists).
709
+ */
710
+ if (false === dpSupport) {
711
+
712
+ var visage;
713
+ var mirror = addProp.mirror || document.createElement("div");
714
+ var reflections = mirror.childNodes;
715
+ var l = reflections.length;
716
+
717
+ for (var i = 0; i < l; ++i)
718
+ if (reflections[i]._R === THIS) {
719
+ visage = reflections[i];
720
+ break;
721
+ }
722
+
723
+ /** Couldn't find an element's reflection inside the mirror. Materialise one. */
724
+ visage || (visage = mirror.appendChild(document.createElement("div")));
725
+
726
+ tokenList = DOMTokenList.call(visage, THIS, attr);
727
+ } else tokenList = new DOMTokenList(THIS, attr);
728
+
729
+ defineGetter(THIS, name, function () {
730
+ return tokenList;
731
+ });
732
+ delete THIS[gibberishProperty];
733
+
734
+ return tokenList;
735
+ }, true);
736
+ };
737
+
738
+ addProp(global.Element, "classList", "className");
739
+ addProp(global.HTMLElement, "classList", "className");
740
+ addProp(global.HTMLLinkElement, "relList", "rel");
741
+ addProp(global.HTMLAnchorElement, "relList", "rel");
742
+ addProp(global.HTMLAreaElement, "relList", "rel");
743
+ }(this));
744
+
745
+ }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
746
+
747
+ (function(undefined) {
748
+
749
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/detect.js
750
+ var detect = (
751
+ 'document' in this && "nextElementSibling" in document.documentElement
752
+ );
753
+
754
+ if (detect) return
755
+
756
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/nextElementSibling/polyfill.js
757
+ Object.defineProperty(Element.prototype, "nextElementSibling", {
758
+ get: function(){
759
+ var el = this.nextSibling;
760
+ while (el && el.nodeType !== 1) { el = el.nextSibling; }
761
+ return el;
762
+ }
763
+ });
764
+
765
+ }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
766
+
767
+ (function(undefined) {
768
+
769
+ // Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/detect.js
770
+ var detect = (
771
+ 'document' in this && "previousElementSibling" in document.documentElement
772
+ );
773
+
774
+ if (detect) return
775
+
776
+ // Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-library/master/polyfills/Element/prototype/previousElementSibling/polyfill.js
777
+ Object.defineProperty(Element.prototype, 'previousElementSibling', {
778
+ get: function(){
779
+ var el = this.previousSibling;
780
+ while (el && el.nodeType !== 1) { el = el.previousSibling; }
781
+ return el;
782
+ }
783
+ });
784
+
785
+ }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
786
+
787
+ (function(undefined) {
788
+
789
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Window/detect.js
790
+ var detect = ('Window' in this);
791
+
792
+ if (detect) return
793
+
794
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Window&flags=always
795
+ if ((typeof WorkerGlobalScope === "undefined") && (typeof importScripts !== "function")) {
796
+ (function (global) {
797
+ if (global.constructor) {
798
+ global.Window = global.constructor;
799
+ } else {
800
+ (global.Window = global.constructor = new Function('return function Window() {}')()).prototype = this;
801
+ }
802
+ }(this));
803
+ }
804
+
805
+ })
806
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
807
+
808
+ (function(undefined) {
809
+
810
+ // Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Event/detect.js
811
+ var detect = (
812
+ (function(global) {
813
+
814
+ if (!('Event' in global)) return false;
815
+ if (typeof global.Event === 'function') return true;
816
+
817
+ try {
818
+
819
+ // In IE 9-11, the Event object exists but cannot be instantiated
820
+ new Event('click');
821
+ return true;
822
+ } catch(e) {
823
+ return false;
824
+ }
825
+ }(this))
826
+ );
827
+
828
+ if (detect) return
829
+
830
+ // Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Event&flags=always
831
+ (function () {
832
+ var unlistenableWindowEvents = {
833
+ click: 1,
834
+ dblclick: 1,
835
+ keyup: 1,
836
+ keypress: 1,
837
+ keydown: 1,
838
+ mousedown: 1,
839
+ mouseup: 1,
840
+ mousemove: 1,
841
+ mouseover: 1,
842
+ mouseenter: 1,
843
+ mouseleave: 1,
844
+ mouseout: 1,
845
+ storage: 1,
846
+ storagecommit: 1,
847
+ textinput: 1
848
+ };
849
+
850
+ // This polyfill depends on availability of `document` so will not run in a worker
851
+ // However, we asssume there are no browsers with worker support that lack proper
852
+ // support for `Event` within the worker
853
+ if (typeof document === 'undefined' || typeof window === 'undefined') return;
854
+
855
+ function indexOf(array, element) {
856
+ var
857
+ index = -1,
858
+ length = array.length;
859
+
860
+ while (++index < length) {
861
+ if (index in array && array[index] === element) {
862
+ return index;
863
+ }
864
+ }
865
+
866
+ return -1;
867
+ }
868
+
869
+ var existingProto = (window.Event && window.Event.prototype) || null;
870
+ window.Event = Window.prototype.Event = function Event(type, eventInitDict) {
871
+ if (!type) {
872
+ throw new Error('Not enough arguments');
873
+ }
874
+
875
+ var event;
876
+ // Shortcut if browser supports createEvent
877
+ if ('createEvent' in document) {
878
+ event = document.createEvent('Event');
879
+ var bubbles = eventInitDict && eventInitDict.bubbles !== undefined ? eventInitDict.bubbles : false;
880
+ var cancelable = eventInitDict && eventInitDict.cancelable !== undefined ? eventInitDict.cancelable : false;
881
+
882
+ event.initEvent(type, bubbles, cancelable);
883
+
884
+ return event;
885
+ }
886
+
887
+ event = document.createEventObject();
888
+
889
+ event.type = type;
890
+ event.bubbles = eventInitDict && eventInitDict.bubbles !== undefined ? eventInitDict.bubbles : false;
891
+ event.cancelable = eventInitDict && eventInitDict.cancelable !== undefined ? eventInitDict.cancelable : false;
892
+
893
+ return event;
894
+ };
895
+ if (existingProto) {
896
+ Object.defineProperty(window.Event, 'prototype', {
897
+ configurable: false,
898
+ enumerable: false,
899
+ writable: true,
900
+ value: existingProto
901
+ });
902
+ }
903
+
904
+ if (!('createEvent' in document)) {
905
+ window.addEventListener = Window.prototype.addEventListener = Document.prototype.addEventListener = Element.prototype.addEventListener = function addEventListener() {
906
+ var
907
+ element = this,
908
+ type = arguments[0],
909
+ listener = arguments[1];
910
+
911
+ if (element === window && type in unlistenableWindowEvents) {
912
+ throw new Error('In IE8 the event: ' + type + ' is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.');
913
+ }
914
+
915
+ if (!element._events) {
916
+ element._events = {};
917
+ }
918
+
919
+ if (!element._events[type]) {
920
+ element._events[type] = function (event) {
921
+ var
922
+ list = element._events[event.type].list,
923
+ events = list.slice(),
924
+ index = -1,
925
+ length = events.length,
926
+ eventElement;
927
+
928
+ event.preventDefault = function preventDefault() {
929
+ if (event.cancelable !== false) {
930
+ event.returnValue = false;
931
+ }
932
+ };
933
+
934
+ event.stopPropagation = function stopPropagation() {
935
+ event.cancelBubble = true;
936
+ };
937
+
938
+ event.stopImmediatePropagation = function stopImmediatePropagation() {
939
+ event.cancelBubble = true;
940
+ event.cancelImmediate = true;
941
+ };
942
+
943
+ event.currentTarget = element;
944
+ event.relatedTarget = event.fromElement || null;
945
+ event.target = event.target || event.srcElement || element;
946
+ event.timeStamp = new Date().getTime();
947
+
948
+ if (event.clientX) {
949
+ event.pageX = event.clientX + document.documentElement.scrollLeft;
950
+ event.pageY = event.clientY + document.documentElement.scrollTop;
951
+ }
952
+
953
+ while (++index < length && !event.cancelImmediate) {
954
+ if (index in events) {
955
+ eventElement = events[index];
956
+
957
+ if (indexOf(list, eventElement) !== -1 && typeof eventElement === 'function') {
958
+ eventElement.call(element, event);
959
+ }
960
+ }
961
+ }
962
+ };
963
+
964
+ element._events[type].list = [];
965
+
966
+ if (element.attachEvent) {
967
+ element.attachEvent('on' + type, element._events[type]);
968
+ }
969
+ }
970
+
971
+ element._events[type].list.push(listener);
972
+ };
973
+
974
+ window.removeEventListener = Window.prototype.removeEventListener = Document.prototype.removeEventListener = Element.prototype.removeEventListener = function removeEventListener() {
975
+ var
976
+ element = this,
977
+ type = arguments[0],
978
+ listener = arguments[1],
979
+ index;
980
+
981
+ if (element._events && element._events[type] && element._events[type].list) {
982
+ index = indexOf(element._events[type].list, listener);
983
+
984
+ if (index !== -1) {
985
+ element._events[type].list.splice(index, 1);
986
+
987
+ if (!element._events[type].list.length) {
988
+ if (element.detachEvent) {
989
+ element.detachEvent('on' + type, element._events[type]);
990
+ }
991
+ delete element._events[type];
992
+ }
993
+ }
994
+ }
995
+ };
996
+
997
+ window.dispatchEvent = Window.prototype.dispatchEvent = Document.prototype.dispatchEvent = Element.prototype.dispatchEvent = function dispatchEvent(event) {
998
+ if (!arguments.length) {
999
+ throw new Error('Not enough arguments');
1000
+ }
1001
+
1002
+ if (!event || typeof event.type !== 'string') {
1003
+ throw new Error('DOM Events Exception 0');
1004
+ }
1005
+
1006
+ var element = this, type = event.type;
1007
+
1008
+ try {
1009
+ if (!event.bubbles) {
1010
+ event.cancelBubble = true;
1011
+
1012
+ var cancelBubbleEvent = function (event) {
1013
+ event.cancelBubble = true;
1014
+
1015
+ (element || window).detachEvent('on' + type, cancelBubbleEvent);
1016
+ };
1017
+
1018
+ this.attachEvent('on' + type, cancelBubbleEvent);
1019
+ }
1020
+
1021
+ this.fireEvent('on' + type, event);
1022
+ } catch (error) {
1023
+ event.target = element;
1024
+
1025
+ do {
1026
+ event.currentTarget = element;
1027
+
1028
+ if ('_events' in element && typeof element._events[type] === 'function') {
1029
+ element._events[type].call(element, event);
1030
+ }
1031
+
1032
+ if (typeof element['on' + type] === 'function') {
1033
+ element['on' + type].call(element, event);
1034
+ }
1035
+
1036
+ element = element.nodeType === 9 ? element.parentWindow : element.parentNode;
1037
+ } while (element && !event.cancelBubble);
1038
+ }
1039
+
1040
+ return true;
1041
+ };
1042
+
1043
+ // Add the DOMContentLoaded Event
1044
+ document.attachEvent('onreadystatechange', function() {
1045
+ if (document.readyState === 'complete') {
1046
+ document.dispatchEvent(new Event('DOMContentLoaded', {
1047
+ bubbles: true
1048
+ }));
1049
+ }
1050
+ });
1051
+ }
1052
+ }());
1053
+
1054
+ })
1055
+ .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
1056
+
1057
+ /**
1058
+ * TODO: Ideally this would be a NodeList.prototype.forEach polyfill
1059
+ * This seems to fail in IE8, requires more investigation.
1060
+ * See: https://github.com/imagitama/nodelist-foreach-polyfill
1061
+ */
1062
+ function nodeListForEach (nodes, callback) {
1063
+ if (window.NodeList.prototype.forEach) {
1064
+ return nodes.forEach(callback)
1065
+ }
1066
+ for (var i = 0; i < nodes.length; i++) {
1067
+ callback.call(window, nodes[i], i, nodes);
1068
+ }
1069
+ }
1070
+
1071
+ function Tabs ($module) {
1072
+ this.$module = $module;
1073
+ this.$tabs = $module.querySelectorAll('.govuk-tabs__tab');
1074
+
1075
+ this.keys = { left: 37, right: 39, up: 38, down: 40 };
1076
+ this.jsHiddenClass = 'govuk-tabs__panel--hidden';
1077
+ }
1078
+
1079
+ Tabs.prototype.init = function () {
1080
+ if (typeof window.matchMedia === 'function') {
1081
+ this.setupResponsiveChecks();
1082
+ } else {
1083
+ this.setup();
1084
+ }
1085
+ };
1086
+
1087
+ Tabs.prototype.setupResponsiveChecks = function () {
1088
+ this.mql = window.matchMedia('(min-width: 40.0625em)');
1089
+ this.mql.addListener(this.checkMode.bind(this));
1090
+ this.checkMode();
1091
+ };
1092
+
1093
+ Tabs.prototype.checkMode = function () {
1094
+ if (this.mql.matches) {
1095
+ this.setup();
1096
+ } else {
1097
+ this.teardown();
1098
+ }
1099
+ };
1100
+
1101
+ Tabs.prototype.setup = function () {
1102
+ var $module = this.$module;
1103
+ var $tabs = this.$tabs;
1104
+ var $tabList = $module.querySelector('.govuk-tabs__list');
1105
+ var $tabListItems = $module.querySelectorAll('.govuk-tabs__list-item');
1106
+
1107
+ if (!$tabs || !$tabList || !$tabListItems) {
1108
+ return
1109
+ }
1110
+
1111
+ $tabList.setAttribute('role', 'tablist');
1112
+
1113
+ nodeListForEach($tabListItems, function ($item) {
1114
+ $item.setAttribute('role', 'presentation');
1115
+ });
1116
+
1117
+ nodeListForEach($tabs, function ($tab) {
1118
+ // Set HTML attributes
1119
+ this.setAttributes($tab);
1120
+
1121
+ // Save bounded functions to use when removing event listeners during teardown
1122
+ $tab.boundTabClick = this.onTabClick.bind(this);
1123
+ $tab.boundTabKeydown = this.onTabKeydown.bind(this);
1124
+
1125
+ // Handle events
1126
+ $tab.addEventListener('click', $tab.boundTabClick, true);
1127
+ $tab.addEventListener('keydown', $tab.boundTabKeydown, true);
1128
+
1129
+ // Remove old active panels
1130
+ this.hideTab($tab);
1131
+ }.bind(this));
1132
+
1133
+ // Show either the active tab according to the URL's hash or the first tab
1134
+ var $activeTab = this.getTab(window.location.hash) || this.$tabs[0];
1135
+ this.showTab($activeTab);
1136
+
1137
+ // Handle hashchange events
1138
+ $module.boundOnHashChange = this.onHashChange.bind(this);
1139
+ window.addEventListener('hashchange', $module.boundOnHashChange, true);
1140
+ };
1141
+
1142
+ Tabs.prototype.teardown = function () {
1143
+ var $module = this.$module;
1144
+ var $tabs = this.$tabs;
1145
+ var $tabList = $module.querySelector('.govuk-tabs__list');
1146
+ var $tabListItems = $module.querySelectorAll('.govuk-tabs__list-item');
1147
+
1148
+ if (!$tabs || !$tabList || !$tabListItems) {
1149
+ return
1150
+ }
1151
+
1152
+ $tabList.removeAttribute('role');
1153
+
1154
+ nodeListForEach($tabListItems, function ($item) {
1155
+ $item.removeAttribute('role', 'presentation');
1156
+ });
1157
+
1158
+ nodeListForEach($tabs, function ($tab) {
1159
+ // Remove events
1160
+ $tab.removeEventListener('click', $tab.boundTabClick, true);
1161
+ $tab.removeEventListener('keydown', $tab.boundTabKeydown, true);
1162
+
1163
+ // Unset HTML attributes
1164
+ this.unsetAttributes($tab);
1165
+ }.bind(this));
1166
+
1167
+ // Remove hashchange event handler
1168
+ window.removeEventListener('hashchange', $module.boundOnHashChange, true);
1169
+ };
1170
+
1171
+ Tabs.prototype.onHashChange = function (e) {
1172
+ var hash = window.location.hash;
1173
+ var $tabWithHash = this.getTab(hash);
1174
+ if (!$tabWithHash) {
1175
+ return
1176
+ }
1177
+
1178
+ // Prevent changing the hash
1179
+ if (this.changingHash) {
1180
+ this.changingHash = false;
1181
+ return
1182
+ }
1183
+
1184
+ // Show either the active tab according to the URL's hash or the first tab
1185
+ var $previousTab = this.getCurrentTab();
1186
+
1187
+ this.hideTab($previousTab);
1188
+ this.showTab($tabWithHash);
1189
+ $tabWithHash.focus();
1190
+ };
1191
+
1192
+ Tabs.prototype.hideTab = function ($tab) {
1193
+ this.unhighlightTab($tab);
1194
+ this.hidePanel($tab);
1195
+ };
1196
+
1197
+ Tabs.prototype.showTab = function ($tab) {
1198
+ this.highlightTab($tab);
1199
+ this.showPanel($tab);
1200
+ };
1201
+
1202
+ Tabs.prototype.getTab = function (hash) {
1203
+ return this.$module.querySelector('.govuk-tabs__tab[href="' + hash + '"]')
1204
+ };
1205
+
1206
+ Tabs.prototype.setAttributes = function ($tab) {
1207
+ // set tab attributes
1208
+ var panelId = this.getHref($tab).slice(1);
1209
+ $tab.setAttribute('id', 'tab_' + panelId);
1210
+ $tab.setAttribute('role', 'tab');
1211
+ $tab.setAttribute('aria-controls', panelId);
1212
+ $tab.setAttribute('aria-selected', 'false');
1213
+ $tab.setAttribute('tabindex', '-1');
1214
+
1215
+ // set panel attributes
1216
+ var $panel = this.getPanel($tab);
1217
+ $panel.setAttribute('role', 'tabpanel');
1218
+ $panel.setAttribute('aria-labelledby', $tab.id);
1219
+ $panel.classList.add(this.jsHiddenClass);
1220
+ };
1221
+
1222
+ Tabs.prototype.unsetAttributes = function ($tab) {
1223
+ // unset tab attributes
1224
+ $tab.removeAttribute('id');
1225
+ $tab.removeAttribute('role');
1226
+ $tab.removeAttribute('aria-controls');
1227
+ $tab.removeAttribute('aria-selected');
1228
+ $tab.removeAttribute('tabindex');
1229
+
1230
+ // unset panel attributes
1231
+ var $panel = this.getPanel($tab);
1232
+ $panel.removeAttribute('role');
1233
+ $panel.removeAttribute('aria-labelledby');
1234
+ $panel.classList.remove(this.jsHiddenClass);
1235
+ };
1236
+
1237
+ Tabs.prototype.onTabClick = function (e) {
1238
+ if (!e.target.classList.contains('govuk-tabs__tab')) {
1239
+ // Allow events on child DOM elements to bubble up to tab parent
1240
+ return false
1241
+ }
1242
+ e.preventDefault();
1243
+ var $newTab = e.target;
1244
+ var $currentTab = this.getCurrentTab();
1245
+ this.hideTab($currentTab);
1246
+ this.showTab($newTab);
1247
+ this.createHistoryEntry($newTab);
1248
+ };
1249
+
1250
+ Tabs.prototype.createHistoryEntry = function ($tab) {
1251
+ var $panel = this.getPanel($tab);
1252
+
1253
+ // Save and restore the id
1254
+ // so the page doesn't jump when a user clicks a tab (which changes the hash)
1255
+ var id = $panel.id;
1256
+ $panel.id = '';
1257
+ this.changingHash = true;
1258
+ window.location.hash = this.getHref($tab).slice(1);
1259
+ $panel.id = id;
1260
+ };
1261
+
1262
+ Tabs.prototype.onTabKeydown = function (e) {
1263
+ switch (e.keyCode) {
1264
+ case this.keys.left:
1265
+ case this.keys.up:
1266
+ this.activatePreviousTab();
1267
+ e.preventDefault();
1268
+ break
1269
+ case this.keys.right:
1270
+ case this.keys.down:
1271
+ this.activateNextTab();
1272
+ e.preventDefault();
1273
+ break
1274
+ }
1275
+ };
1276
+
1277
+ Tabs.prototype.activateNextTab = function () {
1278
+ var currentTab = this.getCurrentTab();
1279
+ var nextTabListItem = currentTab.parentNode.nextElementSibling;
1280
+ if (nextTabListItem) {
1281
+ var nextTab = nextTabListItem.querySelector('.govuk-tabs__tab');
1282
+ }
1283
+ if (nextTab) {
1284
+ this.hideTab(currentTab);
1285
+ this.showTab(nextTab);
1286
+ nextTab.focus();
1287
+ this.createHistoryEntry(nextTab);
1288
+ }
1289
+ };
1290
+
1291
+ Tabs.prototype.activatePreviousTab = function () {
1292
+ var currentTab = this.getCurrentTab();
1293
+ var previousTabListItem = currentTab.parentNode.previousElementSibling;
1294
+ if (previousTabListItem) {
1295
+ var previousTab = previousTabListItem.querySelector('.govuk-tabs__tab');
1296
+ }
1297
+ if (previousTab) {
1298
+ this.hideTab(currentTab);
1299
+ this.showTab(previousTab);
1300
+ previousTab.focus();
1301
+ this.createHistoryEntry(previousTab);
1302
+ }
1303
+ };
1304
+
1305
+ Tabs.prototype.getPanel = function ($tab) {
1306
+ var $panel = this.$module.querySelector(this.getHref($tab));
1307
+ return $panel
1308
+ };
1309
+
1310
+ Tabs.prototype.showPanel = function ($tab) {
1311
+ var $panel = this.getPanel($tab);
1312
+ $panel.classList.remove(this.jsHiddenClass);
1313
+ };
1314
+
1315
+ Tabs.prototype.hidePanel = function (tab) {
1316
+ var $panel = this.getPanel(tab);
1317
+ $panel.classList.add(this.jsHiddenClass);
1318
+ };
1319
+
1320
+ Tabs.prototype.unhighlightTab = function ($tab) {
1321
+ $tab.setAttribute('aria-selected', 'false');
1322
+ $tab.parentNode.classList.remove('govuk-tabs__list-item--selected');
1323
+ $tab.setAttribute('tabindex', '-1');
1324
+ };
1325
+
1326
+ Tabs.prototype.highlightTab = function ($tab) {
1327
+ $tab.setAttribute('aria-selected', 'true');
1328
+ $tab.parentNode.classList.add('govuk-tabs__list-item--selected');
1329
+ $tab.setAttribute('tabindex', '0');
1330
+ };
1331
+
1332
+ Tabs.prototype.getCurrentTab = function () {
1333
+ return this.$module.querySelector('.govuk-tabs__list-item--selected .govuk-tabs__tab')
1334
+ };
1335
+
1336
+ // this is because IE doesn't always return the actual value but a relative full path
1337
+ // should be a utility function most prob
1338
+ // http://labs.thesedays.com/blog/2010/01/08/getting-the-href-value-with-jquery-in-ie/
1339
+ Tabs.prototype.getHref = function ($tab) {
1340
+ var href = $tab.getAttribute('href');
1341
+ var hash = href.slice(href.indexOf('#'), href.length);
1342
+ return hash
1343
+ };
1344
+
1345
+ return Tabs;
1346
+
1347
+ })));