@nationalarchives/frontend 0.1.30 → 0.1.32

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 (115) hide show
  1. package/nationalarchives/all.css +1 -1
  2. package/nationalarchives/all.css.map +1 -1
  3. package/nationalarchives/all.js +1 -1
  4. package/nationalarchives/all.js.map +1 -1
  5. package/nationalarchives/assets/images/tna-square-logo.svg +3 -1
  6. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  7. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  8. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  9. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  10. package/nationalarchives/components/button/button.css +1 -1
  11. package/nationalarchives/components/button/button.css.map +1 -1
  12. package/nationalarchives/components/button/template.njk +4 -4
  13. package/nationalarchives/components/card/card.css +1 -1
  14. package/nationalarchives/components/card/card.css.map +1 -1
  15. package/nationalarchives/components/card/template.njk +2 -2
  16. package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
  17. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  18. package/nationalarchives/components/checkboxes/checkboxes.scss +2 -0
  19. package/nationalarchives/components/cookie-banner/README.md +77 -0
  20. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -1
  21. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  22. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  23. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  24. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +3 -1
  25. package/nationalarchives/components/cookie-banner/fixtures.json +10 -10
  26. package/nationalarchives/components/cookie-banner/template.njk +3 -2
  27. package/nationalarchives/components/date-input/date-input.css +1 -1
  28. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  29. package/nationalarchives/components/date-input/date-input.scss +1 -0
  30. package/nationalarchives/components/date-search/date-search.css +1 -1
  31. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  32. package/nationalarchives/components/date-search/date-search.scss +1 -0
  33. package/nationalarchives/components/featured-records/featured-records.css +1 -1
  34. package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
  35. package/nationalarchives/components/filters/filters.css +1 -1
  36. package/nationalarchives/components/filters/filters.css.map +1 -1
  37. package/nationalarchives/components/footer/fixtures.json +1 -1
  38. package/nationalarchives/components/footer/footer.css +1 -1
  39. package/nationalarchives/components/footer/footer.css.map +1 -1
  40. package/nationalarchives/components/gallery/gallery.css +1 -1
  41. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  42. package/nationalarchives/components/gallery/gallery.js +1 -1
  43. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  44. package/nationalarchives/components/grid/grid.css +1 -1
  45. package/nationalarchives/components/grid/grid.css.map +1 -1
  46. package/nationalarchives/components/header/header.css +1 -1
  47. package/nationalarchives/components/header/header.css.map +1 -1
  48. package/nationalarchives/components/header/header.js +1 -1
  49. package/nationalarchives/components/header/header.js.map +1 -1
  50. package/nationalarchives/components/hero/fixtures.json +8 -8
  51. package/nationalarchives/components/hero/hero.css +1 -1
  52. package/nationalarchives/components/hero/hero.css.map +1 -1
  53. package/nationalarchives/components/hero/hero.scss +1 -1
  54. package/nationalarchives/components/hero/template.njk +2 -4
  55. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  56. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  57. package/nationalarchives/components/message/fixtures.json +1 -1
  58. package/nationalarchives/components/message/message.css +1 -1
  59. package/nationalarchives/components/message/message.css.map +1 -1
  60. package/nationalarchives/components/message/template.njk +2 -2
  61. package/nationalarchives/components/pagination/fixtures.json +1 -1
  62. package/nationalarchives/components/pagination/pagination.css +1 -1
  63. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  64. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  65. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  66. package/nationalarchives/components/picture/fixtures.json +74 -4
  67. package/nationalarchives/components/picture/macro-options.json +30 -4
  68. package/nationalarchives/components/picture/picture.css +1 -1
  69. package/nationalarchives/components/picture/picture.css.map +1 -1
  70. package/nationalarchives/components/picture/picture.js +1 -1
  71. package/nationalarchives/components/picture/picture.js.map +1 -1
  72. package/nationalarchives/components/picture/picture.mjs +10 -4
  73. package/nationalarchives/components/picture/picture.scss +32 -3
  74. package/nationalarchives/components/picture/picture.stories.js +21 -8
  75. package/nationalarchives/components/picture/template.njk +6 -19
  76. package/nationalarchives/components/radios/radios.css +1 -1
  77. package/nationalarchives/components/radios/radios.css.map +1 -1
  78. package/nationalarchives/components/radios/radios.scss +5 -3
  79. package/nationalarchives/components/search-field/fixtures.json +3 -3
  80. package/nationalarchives/components/search-field/search-field.css +1 -1
  81. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  82. package/nationalarchives/components/search-field/search-field.scss +17 -4
  83. package/nationalarchives/components/search-field/template.njk +0 -2
  84. package/nationalarchives/components/select/select.css +1 -1
  85. package/nationalarchives/components/select/select.css.map +1 -1
  86. package/nationalarchives/components/select/select.scss +1 -0
  87. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  88. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  89. package/nationalarchives/components/sensitive-image/sensitive-image.js +1 -1
  90. package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -1
  91. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  92. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  93. package/nationalarchives/components/skip-link/skip-link.js +1 -1
  94. package/nationalarchives/components/skip-link/skip-link.js.map +1 -1
  95. package/nationalarchives/components/tabs/tabs.css +1 -1
  96. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  97. package/nationalarchives/components/tabs/tabs.js +1 -1
  98. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  99. package/nationalarchives/components/text-input/text-input.css +1 -1
  100. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  101. package/nationalarchives/components/text-input/text-input.scss +1 -0
  102. package/nationalarchives/components/textarea/textarea.css +1 -1
  103. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  104. package/nationalarchives/components/textarea/textarea.scss +1 -0
  105. package/nationalarchives/prototype-kit.css +1 -1
  106. package/nationalarchives/prototype-kit.css.map +1 -1
  107. package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +195 -0
  108. package/nationalarchives/stories/utilities/colour-schemes/{colour-schemes.stories.js → colour-themes.stories.js} +24 -124
  109. package/nationalarchives/tools/_colour.scss +16 -0
  110. package/nationalarchives/utilities/_typography.scss +7 -10
  111. package/package.json +16 -20
  112. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +0 -107
  113. package/nationalarchives/stories/utilities/lists/lists.mdx +0 -18
  114. package/nationalarchives/stories/utilities/tables/tables.mdx +0 -8
  115. package/nationalarchives/stories/utilities/typography/typography.mdx +0 -27
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,(()=>(()=>{"use strict";var e={774:(e,t,i)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){u(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i<t;i++)o[i]=e[i];return o}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,h(o.key),o)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,i){return(t=h(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}i.d(t,{Z:()=>p});var f=function(){function e(){if(s(this,e),u(this,"events",{}),e._instance)return e._instance;e._instance=this}return l(e,[{key:"on",value:function(e,t){var i;Object.prototype.hasOwnProperty.call(this.events,e)||(this.events[e]=[]),this.events[e]=[].concat(function(e){if(Array.isArray(e))return c(e)}(i=this.events[e])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[t])}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.prototype.hasOwnProperty.call(this.events,e)&&this.events[e].forEach((function(e){return e.call(t,i)}))}}]),e}(),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),u(this,"extraPolicies",[]),u(this,"domain",""),u(this,"path",""),u(this,"secure",!0),u(this,"policiesKey","");var i=t.extraPolicies,o=void 0===i?[]:i,r=t.domain,n=void 0===r?"":r,c=t.path,a=void 0===c?"/":c,l=t.secure,h=void 0===l||l,p=t.policiesKey,y=void 0===p?"cookies_policy":p;this.extraPolicies=o,this.domain=n,this.path=a,this.secure=h,this.policiesKey=y,this.events=new f,this.init()}return l(e,[{key:"init",value:function(){this.savePolicies(n(n(n({},Object.fromEntries(this.extraPolicies.map((function(e){return[e.toLowerCase(),!1]})))),{},{usage:!1,settings:!1},this.policies),{},{essential:!0}))}},{key:"all",get:function(){var e={};return document.cookie.split("; ").filter((function(e){return e})).forEach((function(t){var i=t.trim().split("=");i[0]&&(e[i[0]]=i[1])})),e}},{key:"policies",get:function(){try{return JSON.parse(this.get(this.policiesKey)||"{}")}catch(e){return{}}}},{key:"exists",value:function(e){return Object.prototype.hasOwnProperty.call(this.all,e)}},{key:"hasValue",value:function(e,t){return this.get(e)==t}},{key:"get",value:function(e){return this.exists(e)?decodeURIComponent(this.all[e]):null}},{key:"set",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.maxAge,r=void 0===o?31536e3:o,n=i.sameSite,c=void 0===n?"Lax":n,s=i.domain,a=void 0===s?this.domain:s,l=i.path,u=void 0===l?this.path:l,h=i.secure,f=void 0===h?this.secure:h;if(e){var p="".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t),";").concat(a?" domain=".concat(a,"; "):""," samesite=").concat(c,"; path=").concat(u,"; max-age=").concat(r).concat(f?"; secure":"");document.cookie=p,this.events.trigger("setCookie",{key:e,value:t,maxAge:r,path:u,sameSite:c,domain:a,secure:f,cookie:p})}}},{key:"delete",value:function(e){var t={maxAge:-1,path:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",domain:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||void 0};this.set(e,"",t),this.events.trigger("deleteCookie",n({key:e},t))}},{key:"deleteAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Object.keys(this.all).forEach((function(o){e.delete(o,t,i)})),this.events.trigger("deleteAllCookies",{path:t,domain:i})}},{key:"acceptPolicy",value:function(e){this.setPolicy(e,!0),this.events.trigger("acceptPolicy",e),this.events.trigger("changePolicy",u({},e,!0))}},{key:"rejectPolicy",value:function(e){this.setPolicy(e,!1),this.events.trigger("rejectPolicy",e),this.events.trigger("changePolicy",u({},e,!1))}},{key:"setPolicy",value:function(e,t){"essential"!==e&&(this.savePolicies(n(n({},this.policies),{},u(u({},e,t),"essential",!0))),this.events.trigger("changePolicy",u({},e,t)))}},{key:"acceptAllPolicies",value:function(){var e=Object.fromEntries(Object.keys(this.policies).map((function(e){return[e.toLowerCase(),!0]})));this.savePolicies(e),this.events.trigger("acceptAllPolicies"),this.events.trigger("changePolicy",e)}},{key:"rejectAllPolicies",value:function(){var e=n(n({},Object.fromEntries(Object.keys(this.policies).map((function(e){return[e.toLowerCase(),!1]})))),{},{essential:!0});this.savePolicies(e),this.events.trigger("rejectAllPolicies"),this.events.trigger("changePolicy",e)}},{key:"savePolicies",value:function(e){this.set(this.policiesKey,JSON.stringify(e))}},{key:"isPolicyAccepted",value:function(e){return Object.prototype.hasOwnProperty.call(this.policies,e)?!0===this.policies[e]:null}},{key:"on",value:function(e,t){this.events.on(e,t)}}]),e}()}},t={};function i(o){var r=t[o];if(void 0!==r)return r.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{i.r(o),i.d(o,{CookieBanner:()=>n});var e=i(774);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,i){for(var o=0;o<i.length;o++){var r=i[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,n=function(e,i){if("object"!==t(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===t(n)?n:String(n)),r)}var n}var n=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$acceptButton=e&&e.querySelector('[value="accept"]'),this.$rejectButton=e&&e.querySelector('[value="reject"]'),this.$prompt=e&&e.querySelector(".tna-cookie-banner__message--prompt"),this.$acceptedMessage=e&&e.querySelector(".tna-cookie-banner__message--accepted"),this.$rejectedMessage=e&&e.querySelector(".tna-cookie-banner__message--rejected"),this.$closeButtons=e&&e.querySelectorAll('[value="close"]')}var i,o;return i=t,(o=[{key:"init",value:function(){var t,i=this;if(this.$module&&this.$acceptButton&&this.$rejectButton&&this.$prompt&&this.$acceptedMessage&&this.$rejectedMessage&&this.$closeButtons){var o=(this.$module.getAttribute("data-policies")||"").split(",").filter((function(e){return e})).map((function(e){return e.trim()})),r=this.$module.getAttribute("data-domain")||void 0,n=this.$module.getAttribute("data-path")||void 0,c=this.$module.getAttribute("data-secure")||void 0,s=this.$module.getAttribute("data-policies-key")||void 0;this.cookies=new((null===(t=window.TNAFrontend)||void 0===t?void 0:t.Cookies)||e.Z)({extraPolicies:o,domain:r,path:n,secure:c,policiesKey:s}),this.cookiePreferencesSet=this.$module.getAttribute("data-preferenceskey")||"cookie_preferences_set",this.cookies.hasValue(this.cookiePreferencesSet,"true")||(this.$module.removeAttribute("hidden"),this.$acceptButton.addEventListener("click",(function(){return i.accept()})),this.$rejectButton.addEventListener("click",(function(){return i.reject()})))}}},{key:"accept",value:function(){this.$prompt.setAttribute("hidden",!0),this.complete(),this.$acceptedMessage.removeAttribute("hidden"),this.$acceptedMessage.focus(),this.$acceptedMessage.setAttribute("tabindex","-1"),this.cookies.acceptAllPolicies()}},{key:"reject",value:function(){this.$prompt.setAttribute("hidden",!0),this.complete(),this.$rejectedMessage.removeAttribute("hidden"),this.$rejectedMessage.focus(),this.$rejectedMessage.setAttribute("tabindex","-1"),this.cookies.rejectAllPolicies()}},{key:"complete",value:function(){var e=this;this.cookies.set(this.cookiePreferencesSet,!0),this.$closeButtons.forEach((function(t){t.addEventListener("click",(function(){return e.close()}))}))}},{key:"close",value:function(){this.$module.setAttribute("hidden",!0)}}])&&r(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),t}()})(),o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,(()=>(()=>{"use strict";var e={774:(e,t,i)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){u(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i<t;i++)o[i]=e[i];return o}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,h(o.key),o)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,i){return(t=h(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:String(t)}i.d(t,{Z:()=>p});var f=function(){function e(){if(s(this,e),u(this,"events",{}),e._instance)return e._instance;e._instance=this}return l(e,[{key:"on",value:function(e,t){var i;Object.prototype.hasOwnProperty.call(this.events,e)||(this.events[e]=[]),this.events[e]=[].concat(function(e){if(Array.isArray(e))return c(e)}(i=this.events[e])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[t])}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.prototype.hasOwnProperty.call(this.events,e)&&this.events[e].forEach((function(e){return e.call(t,i)}))}}]),e}(),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),u(this,"extraPolicies",[]),u(this,"domain",""),u(this,"path",""),u(this,"secure",!0),u(this,"policiesKey","");var i=t.extraPolicies,o=void 0===i?[]:i,r=t.domain,n=void 0===r?"":r,c=t.path,a=void 0===c?"/":c,l=t.secure,h=void 0===l||l,p=t.policiesKey,y=void 0===p?"cookies_policy":p;this.extraPolicies=o,this.domain=n,this.path=a,this.secure=h,this.policiesKey=y,this.events=new f,this.init()}return l(e,[{key:"init",value:function(){this.savePolicies(n(n(n({},Object.fromEntries(this.extraPolicies.map((function(e){return[e.toLowerCase(),!1]})))),{},{usage:!1,settings:!1},this.policies),{},{essential:!0}))}},{key:"all",get:function(){var e={};return document.cookie.split("; ").filter((function(e){return e})).forEach((function(t){var i=t.trim().split("=");i[0]&&(e[i[0]]=i[1])})),e}},{key:"policies",get:function(){try{return JSON.parse(this.get(this.policiesKey)||"{}")}catch(e){return{}}}},{key:"exists",value:function(e){return Object.prototype.hasOwnProperty.call(this.all,e)}},{key:"hasValue",value:function(e,t){return this.get(e)==t}},{key:"get",value:function(e){return this.exists(e)?decodeURIComponent(this.all[e]):null}},{key:"set",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.maxAge,r=void 0===o?31536e3:o,n=i.sameSite,c=void 0===n?"Lax":n,s=i.domain,a=void 0===s?this.domain:s,l=i.path,u=void 0===l?this.path:l,h=i.secure,f=void 0===h?this.secure:h;if(e){var p="".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t),";").concat(a?" domain=".concat(a,"; "):""," samesite=").concat(c,"; path=").concat(u,"; max-age=").concat(r).concat(f?"; secure":"");document.cookie=p,this.events.trigger("setCookie",{key:e,value:t,maxAge:r,path:u,sameSite:c,domain:a,secure:f,cookie:p})}}},{key:"delete",value:function(e){var t={maxAge:-1,path:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",domain:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||void 0};this.set(e,"",t),this.events.trigger("deleteCookie",n({key:e},t))}},{key:"deleteAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Object.keys(this.all).forEach((function(o){e.delete(o,t,i)})),this.events.trigger("deleteAllCookies",{path:t,domain:i})}},{key:"acceptPolicy",value:function(e){this.setPolicy(e,!0),this.events.trigger("acceptPolicy",e),this.events.trigger("changePolicy",u({},e,!0))}},{key:"rejectPolicy",value:function(e){this.setPolicy(e,!1),this.events.trigger("rejectPolicy",e),this.events.trigger("changePolicy",u({},e,!1))}},{key:"setPolicy",value:function(e,t){"essential"!==e&&(this.savePolicies(n(n({},this.policies),{},u(u({},e,t),"essential",!0))),this.events.trigger("changePolicy",u({},e,t)))}},{key:"acceptAllPolicies",value:function(){var e=Object.fromEntries(Object.keys(this.policies).map((function(e){return[e.toLowerCase(),!0]})));this.savePolicies(e),this.events.trigger("acceptAllPolicies"),this.events.trigger("changePolicy",e)}},{key:"rejectAllPolicies",value:function(){var e=n(n({},Object.fromEntries(Object.keys(this.policies).map((function(e){return[e.toLowerCase(),!1]})))),{},{essential:!0});this.savePolicies(e),this.events.trigger("rejectAllPolicies"),this.events.trigger("changePolicy",e)}},{key:"savePolicies",value:function(e){this.set(this.policiesKey,JSON.stringify(e))}},{key:"isPolicyAccepted",value:function(e){return Object.prototype.hasOwnProperty.call(this.policies,e)?!0===this.policies[e]:null}},{key:"on",value:function(e,t){this.events.on(e,t)}}]),e}()}},t={};function i(o){var r=t[o];if(void 0!==r)return r.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{i.r(o),i.d(o,{CookieBanner:()=>c,Cookies:()=>e.Z});var e=i(774);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var i=function(e,i){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(i)?i:String(i)}var c=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$acceptButton=e&&e.querySelector('[value="accept"]'),this.$rejectButton=e&&e.querySelector('[value="reject"]'),this.$prompt=e&&e.querySelector(".tna-cookie-banner__message--prompt"),this.$acceptedMessage=e&&e.querySelector(".tna-cookie-banner__message--accepted"),this.$rejectedMessage=e&&e.querySelector(".tna-cookie-banner__message--rejected"),this.$closeButtons=e&&e.querySelectorAll('[value="close"]')}var i,o;return i=t,(o=[{key:"init",value:function(){var t,i=this;if(this.$module&&this.$acceptButton&&this.$rejectButton&&this.$prompt&&this.$acceptedMessage&&this.$rejectedMessage&&this.$closeButtons){var o=(this.$module.getAttribute("data-policies")||"").split(",").filter((function(e){return e})).map((function(e){return e.trim()})),r=this.$module.getAttribute("data-domain")||void 0,n=this.$module.getAttribute("data-path")||void 0,c=this.$module.getAttribute("data-secure")||void 0,s=this.$module.getAttribute("data-policieskey")||void 0;this.cookies=new((null===(t=window.TNAFrontend)||void 0===t?void 0:t.Cookies)||e.Z)({extraPolicies:o,domain:r,path:n,secure:c,policiesKey:s}),this.cookiePreferencesSet=this.$module.getAttribute("data-preferenceskey")||"cookie_preferences_set",this.cookies.hasValue(this.cookiePreferencesSet,"true")||(this.$module.removeAttribute("hidden"),this.$acceptButton.addEventListener("click",(function(){return i.accept()})),this.$rejectButton.addEventListener("click",(function(){return i.reject()})))}}},{key:"accept",value:function(){this.$prompt.setAttribute("hidden",!0),this.complete(),this.$acceptedMessage.removeAttribute("hidden"),this.$acceptedMessage.focus(),this.$acceptedMessage.setAttribute("tabindex","-1"),this.cookies.acceptAllPolicies()}},{key:"reject",value:function(){this.$prompt.setAttribute("hidden",!0),this.complete(),this.$rejectedMessage.removeAttribute("hidden"),this.$rejectedMessage.focus(),this.$rejectedMessage.setAttribute("tabindex","-1"),this.cookies.rejectAllPolicies()}},{key:"complete",value:function(){var e=this;this.cookies.set(this.cookiePreferencesSet,!0),this.$closeButtons.forEach((function(t){t.addEventListener("click",(function(){return e.close()}))}))}},{key:"close",value:function(){this.$module.setAttribute("hidden",!0)}}])&&r(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),t}()})(),o})()));
2
2
  //# sourceMappingURL=cookie-banner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/cookie-banner/cookie-banner.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,MAAM,I,2tDCTF,IAAMC,EAAkB,WAG7B,SAAAA,IACE,GADYC,EAAA,KAAAD,GAAAE,EAAA,cAFL,CAAC,GAGJF,EAAmBG,UACrB,OAAOH,EAAmBG,UAE5BH,EAAmBG,UAAYC,IACjC,CAqBC,OAnBD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ClE,CAmCF,GAAC,CAAA5G,IAAA,SAAAC,MAED,WACEH,KAAK+F,QAAQgB,aAAa,UAAU,GACpC/G,KAAKgH,WACLhH,KAAKgG,iBAAiBW,gBAAgB,UACtC3G,KAAKgG,iBAAiBiB,QACtBjH,KAAKgG,iBAAiBe,aAAa,WAAY,MAC/C/G,KAAKsG,QAAQY,mBACf,GAAC,CAAAhH,IAAA,SAAAC,MAED,WACEH,KAAK+F,QAAQgB,aAAa,UAAU,GACpC/G,KAAKgH,WACLhH,KAAKiG,iBAAiBU,gBAAgB,UACtC3G,KAAKiG,iBAAiBgB,QACtBjH,KAAKiG,iBAAiBc,aAAa,WAAY,MAC/C/G,KAAKsG,QAAQa,mBACf,GAAC,CAAAjH,IAAA,WAAAC,MAED,WAAW,IAAAgE,EAAA,KACTnE,KAAKsG,QAAQpC,IAAIlE,KAAKyG,sBAAsB,GAC5CzG,KAAKkG,cAAcjF,SAAQ,SAACmG,GAC1BA,EAAaR,iBAAiB,SAAS,kBAAMzC,EAAKkD,OAAO,GAC3D,GACF,GAAC,CAAAnH,IAAA,QAAAC,MAED,WACEH,KAAK2F,QAAQoB,aAAa,UAAU,EACtC,M,oEAACrB,CAAA,CAzFsB,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/cookie-banner/cookie-banner.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","export class CookieEventHandler {\n events = {};\n\n constructor() {\n if (CookieEventHandler._instance) {\n return CookieEventHandler._instance;\n }\n CookieEventHandler._instance = this;\n }\n\n /**\n * Add an event listener.\n * @param {string} event - The event to add a listener for.\n * @param {function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n if (!Object.prototype.hasOwnProperty.call(this.events, event)) {\n this.events[event] = [];\n }\n this.events[event] = [...this.events[event], callback];\n }\n\n /** @protected */\n trigger(event, data = {}) {\n if (Object.prototype.hasOwnProperty.call(this.events, event)) {\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n }\n}\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n extraPolicies = [];\n /** @protected */\n domain = \"\";\n /** @protected */\n path = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n\n /**\n * Create a cookie handler.\n * @param {string} [options.extraPolicies=[]] - The extra cookie policies to manage in addition to essential, settings and usage.\n * @param {string} [options.domain=\"\"] - The domain to register the cookie with.\n * @param {string} [options.path=\"\"] - The domain to register the cookie with.\n * @param {string} [options.secure=true] - Only set cookie in HTTPS environments.\n * @param {string} [options.policiesKey=cookies_policy] - The name of the cookie.\n */\n constructor(options = {}) {\n const {\n extraPolicies = [],\n domain = \"\",\n path = \"/\",\n secure = true,\n policiesKey = \"cookies_policy\",\n } = options;\n this.extraPolicies = extraPolicies;\n this.domain = domain;\n this.path = path;\n this.secure = secure;\n this.policiesKey = policiesKey;\n this.events = new CookieEventHandler();\n this.init();\n }\n\n /** @protected */\n init() {\n this.savePolicies({\n ...Object.fromEntries(\n this.extraPolicies.map((k) => [k.toLowerCase(), false]),\n ),\n usage: false,\n settings: false,\n ...this.policies,\n essential: true,\n });\n }\n\n get all() {\n const deserialised = {};\n document.cookie\n .split(\"; \")\n .filter((x) => x)\n .forEach((cookie) => {\n const parts = cookie.trim().split(\"=\");\n if (parts[0]) {\n deserialised[parts[0]] = parts[1];\n }\n });\n return deserialised;\n }\n\n get policies() {\n try {\n return JSON.parse(this.get(this.policiesKey) || \"{}\");\n } catch (e) {\n return {};\n }\n }\n\n /**\n * Check to see whether a cookie exists or not.\n * @param {string} key - The cookie name.\n * @returns {boolean}\n */\n exists(key) {\n return Object.prototype.hasOwnProperty.call(this.all, key);\n }\n\n /**\n * Check to see whether a cookie has a particular value.\n * @param {string} key - The cookie name.\n * @param {string|number|boolean} value - The value to check against.\n * @returns\n */\n hasValue(key, value) {\n return this.get(key) == value;\n }\n\n /**\n * Get a cookie.\n * @param {string} key - The cookie name.\n * @returns {string|number|boolean}\n */\n get(key) {\n return this.exists(key) ? decodeURIComponent(this.all[key]) : null;\n }\n\n /**\n * Set a cookie.\n * @param {string} key - The cookie name.\n * @param {string|number|boolean} value - The cookie value.\n * @param {Object} options\n * @param {number} [options.maxAge=31536000] - The maximum age of the cookie in seconds.\n * @param {string} [options.path=/] - The path to register the cookie for.\n * @param {string} [options.sameSite=Lax] - The sameSite attribute.\n * @param {string} [options.domain=this.domain] - The domain to register the cookie with.\n * @param {string} [options.path=this.path] - The path to register the cookie with.\n * @param {string} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n */\n set(key, value, options = {}) {\n const {\n maxAge = 60 * 60 * 24 * 365,\n sameSite = \"Lax\",\n domain = this.domain,\n path = this.path,\n secure = this.secure,\n } = options;\n if (!key) {\n return;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)};${\n domain ? ` domain=${domain}; ` : \"\"\n } samesite=${sameSite}; path=${path}; max-age=${maxAge}${\n secure ? \"; secure\" : \"\"\n }`;\n document.cookie = cookie;\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n cookie,\n });\n }\n\n /**\n * Delete a cookie.\n * @param {string} key - The cookie name.\n * @param {string} [path=/] - The path to the cookie is registered on.\n */\n delete(key, path = \"/\", domain = null) {\n const options = { maxAge: -1, path, domain: domain || undefined };\n this.set(key, \"\", options);\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = null) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.events.trigger(\"deleteAllCookies\", { path, domain });\n }\n\n /**\n * Accept a policy.\n * @param {string} policy - The name of the policy.\n */\n acceptPolicy(policy) {\n this.setPolicy(policy, true);\n this.events.trigger(\"acceptPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: true });\n }\n\n /**\n * Reject a policy.\n * @param {string} policy - The name of the policy.\n */\n rejectPolicy(policy) {\n this.setPolicy(policy, false);\n this.events.trigger(\"rejectPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: false });\n }\n\n /**\n * Set a policy.\n * @param {string} policy - The name of the policy.\n * @param {boolean} accepted - Whether the policy is accepted or not.\n */\n setPolicy(policy, accepted) {\n if (policy === \"essential\") {\n return;\n }\n this.savePolicies({\n ...this.policies,\n [policy]: accepted,\n essential: true,\n });\n this.events.trigger(\"changePolicy\", { [policy]: accepted });\n }\n\n /**\n * Accept all the cookie policies.\n */\n acceptAllPolicies() {\n const allPolicies = Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), true]),\n );\n this.savePolicies(allPolicies);\n this.events.trigger(\"acceptAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Reject all the cookie policies.\n */\n rejectAllPolicies() {\n const allPolicies = {\n ...Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), false]),\n ),\n essential: true,\n };\n this.savePolicies(allPolicies);\n this.events.trigger(\"rejectAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Commit policy preferences to the browser.\n * @param {object} policies - The policies to commit.\n */\n savePolicies(policies) {\n this.set(this.policiesKey, JSON.stringify(policies));\n }\n\n /**\n * Get the acceptance status of a policy.\n * @param {string} policy - The name of the policy.\n * @returns {boolean}\n */\n isPolicyAccepted(policy) {\n return Object.prototype.hasOwnProperty.call(this.policies, policy)\n ? this.policies[policy] === true\n : null;\n }\n\n /**\n * Add an event listener.\n * @param {string} event - The event to add a listener for.\n * @param {function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n this.events.on(event, callback);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import Cookies from \"../../lib/cookies.mjs\";\n\nexport class CookieBanner {\n constructor($module) {\n this.$module = $module;\n this.$acceptButton = $module && $module.querySelector('[value=\"accept\"]');\n this.$rejectButton = $module && $module.querySelector('[value=\"reject\"]');\n this.$prompt =\n $module && $module.querySelector(\".tna-cookie-banner__message--prompt\");\n this.$acceptedMessage =\n $module && $module.querySelector(\".tna-cookie-banner__message--accepted\");\n this.$rejectedMessage =\n $module && $module.querySelector(\".tna-cookie-banner__message--rejected\");\n this.$closeButtons = $module && $module.querySelectorAll('[value=\"close\"]');\n }\n\n init() {\n if (\n !this.$module ||\n !this.$acceptButton ||\n !this.$rejectButton ||\n !this.$prompt ||\n !this.$acceptedMessage ||\n !this.$rejectedMessage ||\n !this.$closeButtons\n ) {\n return;\n }\n\n const policies = this.$module.getAttribute(\"data-policies\") || \"\";\n const extraPolicies = policies\n .split(\",\")\n .filter((x) => x)\n .map((policy) => policy.trim());\n const domain = this.$module.getAttribute(\"data-domain\") || undefined;\n const path = this.$module.getAttribute(\"data-path\") || undefined;\n const secure = this.$module.getAttribute(\"data-secure\") || undefined;\n const policiesKey =\n this.$module.getAttribute(\"data-policies-key\") || undefined;\n\n this.cookies = new (window.TNAFrontend?.Cookies || Cookies)({\n extraPolicies,\n domain,\n path,\n secure,\n policiesKey,\n });\n\n this.cookiePreferencesSet =\n this.$module.getAttribute(\"data-preferenceskey\") ||\n \"cookie_preferences_set\";\n const cookiePreferencesSet = this.cookies.hasValue(\n this.cookiePreferencesSet,\n \"true\",\n );\n\n if (!cookiePreferencesSet) {\n this.$module.removeAttribute(\"hidden\");\n\n this.$acceptButton.addEventListener(\"click\", () => this.accept());\n this.$rejectButton.addEventListener(\"click\", () => this.reject());\n }\n }\n\n accept() {\n this.$prompt.setAttribute(\"hidden\", true);\n this.complete();\n this.$acceptedMessage.removeAttribute(\"hidden\");\n this.$acceptedMessage.focus();\n this.$acceptedMessage.setAttribute(\"tabindex\", \"-1\");\n this.cookies.acceptAllPolicies();\n }\n\n reject() {\n this.$prompt.setAttribute(\"hidden\", true);\n this.complete();\n this.$rejectedMessage.removeAttribute(\"hidden\");\n this.$rejectedMessage.focus();\n this.$rejectedMessage.setAttribute(\"tabindex\", \"-1\");\n this.cookies.rejectAllPolicies();\n }\n\n complete() {\n this.cookies.set(this.cookiePreferencesSet, true);\n this.$closeButtons.forEach(($closeButton) => {\n $closeButton.addEventListener(\"click\", () => this.close());\n });\n }\n\n close() {\n this.$module.setAttribute(\"hidden\", true);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","CookieEventHandler","_classCallCheck","_defineProperty","_instance","this","_createClass","key","value","event","callback","Object","prototype","hasOwnProperty","call","events","concat","_this","data","arguments","length","undefined","forEach","eventToTrigger","Cookies","options","_options$extraPolicie","extraPolicies","_options$domain","domain","_options$path","path","_options$secure","secure","_options$policiesKey","policiesKey","init","savePolicies","_objectSpread","fromEntries","map","k","toLowerCase","usage","settings","policies","essential","get","deserialised","document","cookie","split","filter","x","parts","trim","JSON","parse","e","all","exists","decodeURIComponent","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain2","_options$path2","_options$secure2","encodeURIComponent","trigger","set","_this2","keys","policy","setPolicy","accepted","allPolicies","stringify","on","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","o","defineProperty","enumerable","obj","prop","r","Symbol","toStringTag","CookieBanner","$module","$acceptButton","querySelector","$rejectButton","$prompt","$acceptedMessage","$rejectedMessage","$closeButtons","querySelectorAll","_window$TNAFrontend","getAttribute","cookies","window","TNAFrontend","cookiePreferencesSet","hasValue","removeAttribute","addEventListener","accept","reject","setAttribute","complete","focus","acceptAllPolicies","rejectAllPolicies","$closeButton","close"],"sourceRoot":""}
1
+ {"version":3,"file":"components/cookie-banner/cookie-banner.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,MAAM,I,ktDCTF,IAAMC,EAAkB,WAG7B,SAAAA,IACE,GADYC,EAAA,KAAAD,GAAAE,EAAA,cAFL,CAAC,GAGJF,EAAmBG,UACrB,OAAOH,EAAmBG,UAE5BH,EAAmBG,UAAYC,IACj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KkG,QAAQ,IAjClE,CAmCF,GAAC,CAAA5G,IAAA,SAAAC,MAED,WACEH,KAAK+F,QAAQgB,aAAa,UAAU,GACpC/G,KAAKgH,WACLhH,KAAKgG,iBAAiBW,gBAAgB,UACtC3G,KAAKgG,iBAAiBiB,QACtBjH,KAAKgG,iBAAiBe,aAAa,WAAY,MAC/C/G,KAAKsG,QAAQY,mBACf,GAAC,CAAAhH,IAAA,SAAAC,MAED,WACEH,KAAK+F,QAAQgB,aAAa,UAAU,GACpC/G,KAAKgH,WACLhH,KAAKiG,iBAAiBU,gBAAgB,UACtC3G,KAAKiG,iBAAiBgB,QACtBjH,KAAKiG,iBAAiBc,aAAa,WAAY,MAC/C/G,KAAKsG,QAAQa,mBACf,GAAC,CAAAjH,IAAA,WAAAC,MAED,WAAW,IAAAgE,EAAA,KACTnE,KAAKsG,QAAQpC,IAAIlE,KAAKyG,sBAAsB,GAC5CzG,KAAKkG,cAAcjF,SAAQ,SAACmG,GAC1BA,EAAaR,iBAAiB,SAAS,kBAAMzC,EAAKkD,OAAO,GAC3D,GACF,GAAC,CAAAnH,IAAA,QAAAC,MAED,WACEH,KAAK2F,QAAQoB,aAAa,UAAU,EACtC,M,oEAACrB,CAAA,CAzFsB,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/cookie-banner/cookie-banner.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","export class CookieEventHandler {\n events = {};\n\n constructor() {\n if (CookieEventHandler._instance) {\n return CookieEventHandler._instance;\n }\n CookieEventHandler._instance = this;\n }\n\n /**\n * Add an event listener.\n * @param {string} event - The event to add a listener for.\n * @param {function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n if (!Object.prototype.hasOwnProperty.call(this.events, event)) {\n this.events[event] = [];\n }\n this.events[event] = [...this.events[event], callback];\n }\n\n /** @protected */\n trigger(event, data = {}) {\n if (Object.prototype.hasOwnProperty.call(this.events, event)) {\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n }\n}\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n extraPolicies = [];\n /** @protected */\n domain = \"\";\n /** @protected */\n path = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n\n /**\n * Create a cookie handler.\n * @param {string} [options.extraPolicies=[]] - The extra cookie policies to manage in addition to essential, settings and usage.\n * @param {string} [options.domain=\"\"] - The domain to register the cookie with.\n * @param {string} [options.path=\"\"] - The domain to register the cookie with.\n * @param {string} [options.secure=true] - Only set cookie in HTTPS environments.\n * @param {string} [options.policiesKey=cookies_policy] - The name of the cookie.\n */\n constructor(options = {}) {\n const {\n extraPolicies = [],\n domain = \"\",\n path = \"/\",\n secure = true,\n policiesKey = \"cookies_policy\",\n } = options;\n this.extraPolicies = extraPolicies;\n this.domain = domain;\n this.path = path;\n this.secure = secure;\n this.policiesKey = policiesKey;\n this.events = new CookieEventHandler();\n this.init();\n }\n\n /** @protected */\n init() {\n this.savePolicies({\n ...Object.fromEntries(\n this.extraPolicies.map((k) => [k.toLowerCase(), false]),\n ),\n usage: false,\n settings: false,\n ...this.policies,\n essential: true,\n });\n }\n\n get all() {\n const deserialised = {};\n document.cookie\n .split(\"; \")\n .filter((x) => x)\n .forEach((cookie) => {\n const parts = cookie.trim().split(\"=\");\n if (parts[0]) {\n deserialised[parts[0]] = parts[1];\n }\n });\n return deserialised;\n }\n\n get policies() {\n try {\n return JSON.parse(this.get(this.policiesKey) || \"{}\");\n } catch (e) {\n return {};\n }\n }\n\n /**\n * Check to see whether a cookie exists or not.\n * @param {string} key - The cookie name.\n * @returns {boolean}\n */\n exists(key) {\n return Object.prototype.hasOwnProperty.call(this.all, key);\n }\n\n /**\n * Check to see whether a cookie has a particular value.\n * @param {string} key - The cookie name.\n * @param {string|number|boolean} value - The value to check against.\n * @returns\n */\n hasValue(key, value) {\n return this.get(key) == value;\n }\n\n /**\n * Get a cookie.\n * @param {string} key - The cookie name.\n * @returns {string|number|boolean}\n */\n get(key) {\n return this.exists(key) ? decodeURIComponent(this.all[key]) : null;\n }\n\n /**\n * Set a cookie.\n * @param {string} key - The cookie name.\n * @param {string|number|boolean} value - The cookie value.\n * @param {Object} options\n * @param {number} [options.maxAge=31536000] - The maximum age of the cookie in seconds.\n * @param {string} [options.path=/] - The path to register the cookie for.\n * @param {string} [options.sameSite=Lax] - The sameSite attribute.\n * @param {string} [options.domain=this.domain] - The domain to register the cookie with.\n * @param {string} [options.path=this.path] - The path to register the cookie with.\n * @param {string} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n */\n set(key, value, options = {}) {\n const {\n maxAge = 60 * 60 * 24 * 365,\n sameSite = \"Lax\",\n domain = this.domain,\n path = this.path,\n secure = this.secure,\n } = options;\n if (!key) {\n return;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)};${\n domain ? ` domain=${domain}; ` : \"\"\n } samesite=${sameSite}; path=${path}; max-age=${maxAge}${\n secure ? \"; secure\" : \"\"\n }`;\n document.cookie = cookie;\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n cookie,\n });\n }\n\n /**\n * Delete a cookie.\n * @param {string} key - The cookie name.\n * @param {string} [path=/] - The path to the cookie is registered on.\n */\n delete(key, path = \"/\", domain = null) {\n const options = { maxAge: -1, path, domain: domain || undefined };\n this.set(key, \"\", options);\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = null) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.events.trigger(\"deleteAllCookies\", { path, domain });\n }\n\n /**\n * Accept a policy.\n * @param {string} policy - The name of the policy.\n */\n acceptPolicy(policy) {\n this.setPolicy(policy, true);\n this.events.trigger(\"acceptPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: true });\n }\n\n /**\n * Reject a policy.\n * @param {string} policy - The name of the policy.\n */\n rejectPolicy(policy) {\n this.setPolicy(policy, false);\n this.events.trigger(\"rejectPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: false });\n }\n\n /**\n * Set a policy.\n * @param {string} policy - The name of the policy.\n * @param {boolean} accepted - Whether the policy is accepted or not.\n */\n setPolicy(policy, accepted) {\n if (policy === \"essential\") {\n return;\n }\n this.savePolicies({\n ...this.policies,\n [policy]: accepted,\n essential: true,\n });\n this.events.trigger(\"changePolicy\", { [policy]: accepted });\n }\n\n /**\n * Accept all the cookie policies.\n */\n acceptAllPolicies() {\n const allPolicies = Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), true]),\n );\n this.savePolicies(allPolicies);\n this.events.trigger(\"acceptAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Reject all the cookie policies.\n */\n rejectAllPolicies() {\n const allPolicies = {\n ...Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), false]),\n ),\n essential: true,\n };\n this.savePolicies(allPolicies);\n this.events.trigger(\"rejectAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Commit policy preferences to the browser.\n * @param {object} policies - The policies to commit.\n */\n savePolicies(policies) {\n this.set(this.policiesKey, JSON.stringify(policies));\n }\n\n /**\n * Get the acceptance status of a policy.\n * @param {string} policy - The name of the policy.\n * @returns {boolean}\n */\n isPolicyAccepted(policy) {\n return Object.prototype.hasOwnProperty.call(this.policies, policy)\n ? this.policies[policy] === true\n : null;\n }\n\n /**\n * Add an event listener.\n * @param {string} event - The event to add a listener for.\n * @param {function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n this.events.on(event, callback);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import Cookies from \"../../lib/cookies.mjs\";\n\nexport { Cookies };\n\nexport class CookieBanner {\n constructor($module) {\n this.$module = $module;\n this.$acceptButton = $module && $module.querySelector('[value=\"accept\"]');\n this.$rejectButton = $module && $module.querySelector('[value=\"reject\"]');\n this.$prompt =\n $module && $module.querySelector(\".tna-cookie-banner__message--prompt\");\n this.$acceptedMessage =\n $module && $module.querySelector(\".tna-cookie-banner__message--accepted\");\n this.$rejectedMessage =\n $module && $module.querySelector(\".tna-cookie-banner__message--rejected\");\n this.$closeButtons = $module && $module.querySelectorAll('[value=\"close\"]');\n }\n\n init() {\n if (\n !this.$module ||\n !this.$acceptButton ||\n !this.$rejectButton ||\n !this.$prompt ||\n !this.$acceptedMessage ||\n !this.$rejectedMessage ||\n !this.$closeButtons\n ) {\n return;\n }\n\n const policies = this.$module.getAttribute(\"data-policies\") || \"\";\n const extraPolicies = policies\n .split(\",\")\n .filter((x) => x)\n .map((policy) => policy.trim());\n const domain = this.$module.getAttribute(\"data-domain\") || undefined;\n const path = this.$module.getAttribute(\"data-path\") || undefined;\n const secure = this.$module.getAttribute(\"data-secure\") || undefined;\n const policiesKey =\n this.$module.getAttribute(\"data-policieskey\") || undefined;\n\n this.cookies = new (window.TNAFrontend?.Cookies || Cookies)({\n extraPolicies,\n domain,\n path,\n secure,\n policiesKey,\n });\n\n this.cookiePreferencesSet =\n this.$module.getAttribute(\"data-preferenceskey\") ||\n \"cookie_preferences_set\";\n const cookiePreferencesSet = this.cookies.hasValue(\n this.cookiePreferencesSet,\n \"true\",\n );\n\n if (!cookiePreferencesSet) {\n this.$module.removeAttribute(\"hidden\");\n\n this.$acceptButton.addEventListener(\"click\", () => this.accept());\n this.$rejectButton.addEventListener(\"click\", () => this.reject());\n }\n }\n\n accept() {\n this.$prompt.setAttribute(\"hidden\", true);\n this.complete();\n this.$acceptedMessage.removeAttribute(\"hidden\");\n this.$acceptedMessage.focus();\n this.$acceptedMessage.setAttribute(\"tabindex\", \"-1\");\n this.cookies.acceptAllPolicies();\n }\n\n reject() {\n this.$prompt.setAttribute(\"hidden\", true);\n this.complete();\n this.$rejectedMessage.removeAttribute(\"hidden\");\n this.$rejectedMessage.focus();\n this.$rejectedMessage.setAttribute(\"tabindex\", \"-1\");\n this.cookies.rejectAllPolicies();\n }\n\n complete() {\n this.cookies.set(this.cookiePreferencesSet, true);\n this.$closeButtons.forEach(($closeButton) => {\n $closeButton.addEventListener(\"click\", () => this.close());\n });\n }\n\n close() {\n this.$module.setAttribute(\"hidden\", true);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","CookieEventHandler","_classCallCheck","_defineProperty","_instance","this","_createClass","key","value","event","callback","Object","prototype","hasOwnProperty","call","events","concat","_this","data","arguments","length","undefined","forEach","eventToTrigger","Cookies","options","_options$extraPolicie","extraPolicies","_options$domain","domain","_options$path","path","_options$secure","secure","_options$policiesKey","policiesKey","init","savePolicies","_objectSpread","fromEntries","map","k","toLowerCase","usage","settings","policies","essential","get","deserialised","document","cookie","split","filter","x","parts","trim","JSON","parse","e","all","exists","decodeURIComponent","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain2","_options$path2","_options$secure2","encodeURIComponent","trigger","set","_this2","keys","policy","setPolicy","accepted","allPolicies","stringify","on","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","o","defineProperty","enumerable","obj","prop","r","Symbol","toStringTag","CookieBanner","$module","$acceptButton","querySelector","$rejectButton","$prompt","$acceptedMessage","$rejectedMessage","$closeButtons","querySelectorAll","_window$TNAFrontend","getAttribute","cookies","window","TNAFrontend","cookiePreferencesSet","hasValue","removeAttribute","addEventListener","accept","reject","setAttribute","complete","focus","acceptAllPolicies","rejectAllPolicies","$closeButton","close"],"sourceRoot":""}
@@ -1,5 +1,7 @@
1
1
  import Cookies from "../../lib/cookies.mjs";
2
2
 
3
+ export { Cookies };
4
+
3
5
  export class CookieBanner {
4
6
  constructor($module) {
5
7
  this.$module = $module;
@@ -36,7 +38,7 @@ export class CookieBanner {
36
38
  const path = this.$module.getAttribute("data-path") || undefined;
37
39
  const secure = this.$module.getAttribute("data-secure") || undefined;
38
40
  const policiesKey =
39
- this.$module.getAttribute("data-policies-key") || undefined;
41
+ this.$module.getAttribute("data-policieskey") || undefined;
40
42
 
41
43
  this.cookies = new (window.TNAFrontend?.Cookies || Cookies)({
42
44
  extraPolicies,
@@ -7,7 +7,7 @@
7
7
  "serviceName": "My service",
8
8
  "cookiesUrl": "/cookies"
9
9
  },
10
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
10
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
11
11
  "hidden": false
12
12
  },
13
13
  {
@@ -17,7 +17,7 @@
17
17
  "cookiesUrl": "/cookies",
18
18
  "cookiesPreferencesSetKey": "custom"
19
19
  },
20
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
20
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
21
21
  "hidden": false
22
22
  },
23
23
  {
@@ -27,7 +27,7 @@
27
27
  "cookiesUrl": "/cookies",
28
28
  "policies": "custom"
29
29
  },
30
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"custom\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
30
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"custom\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
31
31
  "hidden": false
32
32
  },
33
33
  {
@@ -37,7 +37,7 @@
37
37
  "cookiesUrl": "/cookies",
38
38
  "policiesKey": "custom_key"
39
39
  },
40
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"custom_key\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
40
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"custom_key\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
41
41
  "hidden": false
42
42
  },
43
43
  {
@@ -47,7 +47,7 @@
47
47
  "cookiesUrl": "/cookies",
48
48
  "cookiesDomain": "nationalarchives.gov.uk"
49
49
  },
50
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"nationalarchives.gov.uk\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
50
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"nationalarchives.gov.uk\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
51
51
  "hidden": false
52
52
  },
53
53
  {
@@ -57,7 +57,7 @@
57
57
  "cookiesUrl": "/cookies",
58
58
  "cookiesPath": "/my-service"
59
59
  },
60
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"/my-service\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
60
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"/my-service\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
61
61
  "hidden": false
62
62
  },
63
63
  {
@@ -67,7 +67,7 @@
67
67
  "cookiesUrl": "/cookies",
68
68
  "preferencesSetKey": "custom_preferences_set_key"
69
69
  },
70
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"custom_preferences_set_key\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
70
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"custom_preferences_set_key\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
71
71
  "hidden": false
72
72
  },
73
73
  {
@@ -77,7 +77,7 @@
77
77
  "cookiesUrl": "/cookies",
78
78
  "allowInsecure": true
79
79
  },
80
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"true\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
80
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"true\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
81
81
  "hidden": false
82
82
  },
83
83
  {
@@ -87,7 +87,7 @@
87
87
  "cookiesUrl": "/cookies",
88
88
  "classes": "tna-cookie-banner--fixture"
89
89
  },
90
- "html": "<section class=\"tna-cookie-banner tna-cookie-banner--fixture\" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
90
+ "html": "<section class=\"tna-cookie-banner tna-cookie-banner--fixture\" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
91
91
  "hidden": false
92
92
  },
93
93
  {
@@ -99,7 +99,7 @@
99
99
  "data-fixturetest": "pass"
100
100
  }
101
101
  },
102
- "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"cookie_preferences_set\" data-policies-key=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" data-fixturetest=\"pass\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
102
+ "html": "<section class=\"tna-cookie-banner \" data-module=\"tna-cookie-banner\" role=\"region\" data-policies=\"\" data-preferenceskey=\"\" data-policieskey=\"\" data-domain=\"\" data-path=\"\" data-insecure=\"false\" aria-label=\"Cookies on My service\" data-fixturetest=\"pass\" hidden><div class=\"tna-container\"><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt\"><h2 class=\"tna-heading-m\">This website uses cookies</h2><p>We use some essential cookies to make this service work.</p><p>We'd also like to use analytics cookies so we can understand how you use the service and make improvements.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"accept\">Accept cookies</button><button class=\"tna-button \" type=\"button\" value=\"reject\">Reject cookies</button><a href=\"/cookies\" class=\"tna-button tna-button--plain\">Set cookie preferences</a></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--accepted\" tabindex=\"0\" hidden><p>You have accepted optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div><div class=\"tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--rejected\" tabindex=\"0\" hidden><p>You have rejected optional cookies. You can change your cookie settings on the <a href=\"/cookies\">Cookies page</a>.</p><div class=\"tna-button-group\"><button class=\"tna-button \" type=\"button\" value=\"close\">Close this message</button></div></div></div></section>",
103
103
  "hidden": false
104
104
  }
105
105
  ]
@@ -1,7 +1,7 @@
1
1
  {% from "nationalarchives/components/button/macro.njk" import tnaButton %}
2
2
 
3
3
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
4
- <section class="tna-cookie-banner {{ containerClasses | join(' ') }}" data-module="tna-cookie-banner" role="region" data-policies="{{ params.policies if params.policies }}" data-preferenceskey="{{ params.preferencesSetKey if params.preferencesSetKey else 'cookie_preferences_set' }}" data-policies-key="{{ params.policiesKey if params.policiesKey }}" data-domain="{{ params.cookiesDomain if params.cookiesDomain }}" data-path="{{ params.cookiesPath if params.cookiesPath }}" data-insecure="{{ true if params.allowInsecure else 'false' }}" aria-label="Cookies on {{ params.serviceName }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} hidden>
4
+ <section class="tna-cookie-banner {{ containerClasses | join(' ') }}" data-module="tna-cookie-banner" role="region" data-policies="{{ params.policies if params.policies }}" data-preferenceskey="{{ params.preferencesSetKey if params.preferencesSetKey }}" data-policieskey="{{ params.policiesKey if params.policiesKey }}" data-domain="{{ params.cookiesDomain if params.cookiesDomain }}" data-path="{{ params.cookiesPath if params.cookiesPath }}" data-insecure="{{ true if params.allowInsecure else 'false' }}" aria-label="Cookies on {{ params.serviceName }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} hidden>
5
5
  <div class="tna-container">
6
6
  <div class="tna-column tna-column--full tna-cookie-banner__message tna-cookie-banner__message--prompt">
7
7
  <h2 class="tna-heading-m">This website uses cookies</h2>
@@ -18,6 +18,7 @@
18
18
  {{ tnaButton({
19
19
  text: "Reject cookies",
20
20
  buttonElement: true,
21
+ buttonElement: true,
21
22
  attributes: {
22
23
  value: "reject"
23
24
  }
@@ -58,4 +59,4 @@
58
59
  </div>
59
60
  </div>
60
61
  </div>
61
- </section>
62
+ </section>