@defra/forms-engine-plugin 5.0.0-alpha.28 → 5.0.0-alpha.29
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.
- package/.public/37c964ca545c240f010a.mjs +2 -0
- package/.public/37c964ca545c240f010a.mjs.LICENSE.txt +4 -0
- package/.public/assets-manifest.json +3 -0
- package/.public/javascripts/shared.min.js +1 -1
- package/.public/javascripts/shared.min.js.LICENSE.txt +2 -0
- package/.public/javascripts/shared.min.js.map +1 -1
- package/.public/javascripts/vendor/@defra.min.js +1 -1
- package/.public/javascripts/vendor/@defra.min.js.map +1 -1
- package/.public/javascripts/vendor/maplibre-gl.min.js +1 -1
- package/.public/javascripts/vendor/maplibre-gl.min.js.LICENSE.txt +3 -3
- package/.public/javascripts/vendor/maplibre-gl.min.js.map +1 -1
- package/.public/stylesheets/application.min.css +1 -1
- package/.public/stylesheets/application.min.css.map +1 -1
- package/.server/client/javascripts/geospatial-map.js +3 -3
- package/.server/client/javascripts/geospatial-map.js.map +1 -1
- package/.server/client/javascripts/location-map.js +2 -2
- package/.server/client/javascripts/location-map.js.map +1 -1
- package/.server/client/javascripts/map.d.ts +5 -2
- package/.server/client/javascripts/map.js +17 -5
- package/.server/client/javascripts/map.js.map +1 -1
- package/.server/server/plugins/engine/components/AutocompleteField.d.ts +1 -2
- package/.server/server/plugins/engine/components/AutocompleteField.js +9 -4
- package/.server/server/plugins/engine/components/AutocompleteField.js.map +1 -1
- package/.server/server/plugins/engine/components/LocationFieldBase.js +11 -6
- package/.server/server/plugins/engine/components/LocationFieldBase.js.map +1 -1
- package/.server/server/plugins/engine/components/NumberField.js +14 -8
- package/.server/server/plugins/engine/components/NumberField.js.map +1 -1
- package/.server/server/plugins/engine/components/YesNoField.d.ts +1 -3
- package/.server/server/plugins/engine/components/YesNoField.js +9 -4
- package/.server/server/plugins/engine/components/YesNoField.js.map +1 -1
- package/.server/server/plugins/engine/components/helpers/index.d.ts +14 -1
- package/.server/server/plugins/engine/components/helpers/index.js +32 -0
- package/.server/server/plugins/engine/components/helpers/index.js.map +1 -1
- package/package.json +4 -4
- package/src/client/javascripts/geospatial-map.js +3 -3
- package/src/client/javascripts/location-map.js +2 -2
- package/src/client/javascripts/map.js +19 -8
- package/src/server/plugins/engine/components/AutocompleteField.ts +12 -5
- package/src/server/plugins/engine/components/LocationFieldBase.ts +18 -8
- package/src/server/plugins/engine/components/NumberField.ts +17 -13
- package/src/server/plugins/engine/components/YesNoField.ts +14 -4
- package/src/server/plugins/engine/components/helpers/index.ts +45 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see shared.min.js.LICENSE.txt */
|
|
2
|
-
var e,t,n,r={452:(e,t,n)=>{n.d(t,{Ob:()=>Pe,q6:()=>s.q6,d5:()=>ae,Ay:()=>xe,Rf:()=>q,Qv:()=>fe,XX:()=>he,xJ:()=>Ae,hb:()=>O,NT:()=>P,vJ:()=>b,Nf:()=>w,Kr:()=>k,WO:()=>y,li:()=>E,J0:()=>v});var r,o,i,a,s=n(126),l=0,u=[],c=s.fF,d=c.__b,p=c.__r,h=c.diffed,f=c.__c,m=c.unmount,g=c.__;function _(e,t){c.__h&&c.__h(o,e,l||t),l=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return l=1,y(D,e)}function y(e,t,n){var i=_(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):D(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var o=i.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,n)||o};o.__f=!0;var s=o.shouldComponentUpdate,l=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}l&&l.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=_(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=_(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function E(e){return l=5,k(function(){return{current:e}},[])}function S(e,t,n){l=6,w(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function k(e,t){var n=_(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return l=8,k(function(){return e},t)}function P(e){var t=o.context[e.__c],n=_(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function A(e,t){c.useDebugValue&&c.useDebugValue(t?t(e):e)}function N(){var e=_(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function T(){for(var e;e=u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(L),t.__h.some($),t.__h=[]}catch(o){t.__h=[],c.__e(o,e.__v)}}}c.__b=function(e){o=null,d&&d(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},c.__r=function(e){p&&p(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(L),t.__h.some($),t.__h=[],r=0)),i=o},c.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&a===c.requestAnimationFrame||((a=c.requestAnimationFrame)||M)(T)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),i=o=null},c.__c=function(e,t){t.some(function(e){try{e.__h.some(L),e.__h=e.__h.filter(function(e){return!e.__||$(e)})}catch(o){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(o,e.__v)}}),f&&f(e,t)},c.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{L(e)}catch(e){t=e}}),n.__H=void 0,t&&c.__e(t,n.__v))};var x="function"==typeof requestAnimationFrame;function M(e){var t,n=function(){clearTimeout(r),x&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);x&&(t=requestAnimationFrame(n))}function L(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function $(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function D(e,t){return"function"==typeof t?t(e):t}function j(e,t){for(var n in t)e[n]=t[n];return e}function R(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function F(e,t){var n=t(),r=v({t:{__:n,u:t}}),o=r[0].t,i=r[1];return w(function(){o.__=n,o.u=t,I(o)&&i({t:o})},[e,n,t]),b(function(){return I(o)&&i({t:o}),e(function(){I(o)&&i({t:o})})},[e]),n}function I(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function B(e){e()}function G(e){return e}function W(){return[!1,B]}var U=w;function H(e,t){this.props=e,this.context=t}(H.prototype=new s.uA).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return R(this.props,e)||R(this.state,t)};var V=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),V&&V(e)};var z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function q(e){function t(t){var n=j({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=z,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Y=function(e,t){return null==e?null:(0,s.v2)((0,s.v2)(e).map(t))},K={map:Y,forEach:Y,count:function(e){return e?(0,s.v2)(e).length:0},only:function(e){var t=(0,s.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:s.v2},Z=s.fF.__e;s.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var X=s.fF.unmount;function J(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=j({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,n)})),e}function Q(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Q(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function te(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ne(){this.i=null,this.l=null}s.fF.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),X&&X(e)},(ee.prototype=new s.uA).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=te(r.__v),i=!1,a=function(){i||r.__z||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Q(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,s.n)(s.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),o]};var re=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ie(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,s.XX)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,s.XX)((0,s.n)(oe,{context:t.context},e.__v),t.v)}function ae(e,t){var n=(0,s.n)(ie,{__v:e,h:t});return n.containerInfo=t,n}(ne.prototype=new s.uA).__a=function(e){var t=this,n=te(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),re(t,e,r)):o()};n?n(i):i()}},ne.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ne.prototype.componentDidUpdate=ne.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){re(e,n,t)})};var se="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ue=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,de="undefined"!=typeof document,pe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function he(e,t,n){return null==t.__k&&(t.textContent=""),(0,s.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function fe(e,t,n){return(0,s.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var me=s.fF.event;function ge(){}function _e(){return this.cancelBubble}function ve(){return this.defaultPrevented}s.fF.event=function(e){return me&&(e=me(e)),e.persist=ge,e.isPropagationStopped=_e,e.isDefaultPrevented=ve,e.nativeEvent=e};var ye,be={enumerable:!1,configurable:!0,get:function(){return this.class}},we=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||de&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||pe(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":ue.test(i)&&(i=l):l=i="oninput":o&&le.test(i)?i=i.replace(ce,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",be)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=se,we&&we(e)};var Ee=s.fF.__r;s.fF.__r=function(e){Ee&&Ee(e),ye=e.__c};var Se=s.fF.diffed;s.fF.diffed=function(e){Se&&Se(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ye=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ye.__n[e.__c].props.value},useCallback:O,useContext:P,useDebugValue:A,useDeferredValue:G,useEffect:b,useId:N,useImperativeHandle:S,useInsertionEffect:U,useLayoutEffect:w,useMemo:k,useReducer:y,useRef:E,useState:v,useSyncExternalStore:F,useTransition:W}}};function Oe(e){return!!e&&e.$$typeof===se}function Pe(e){return Oe(e)?s.Ob.apply(null,arguments):e}function Ae(e){return!!e.__k&&((0,s.XX)(null,e),!0)}var Ne=s.FK,Te=Oe,xe={useState:v,useId:N,useReducer:y,useEffect:b,useLayoutEffect:w,useInsertionEffect:U,useTransition:W,useDeferredValue:G,useSyncExternalStore:F,startTransition:B,useRef:E,useImperativeHandle:S,useMemo:k,useCallback:O,useContext:P,useDebugValue:A,version:"18.3.1",Children:K,render:he,hydrate:fe,unmountComponentAtNode:Ae,createPortal:ae,createElement:s.n,createContext:s.q6,createFactory:function(e){return s.n.bind(null,e)},cloneElement:Pe,createRef:s._3,Fragment:s.FK,isValidElement:Oe,isElement:Te,isFragment:function(e){return Oe(e)&&e.type===s.FK},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:s.uA,PureComponent:H,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:R(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,s.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r},forwardRef:q,flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Ne,Suspense:ee,SuspenseList:ne,lazy:function(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?(0,s.n)(o,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},126:(e,t,n)=>{n.d(t,{FK:()=>k,Ob:()=>K,Qv:()=>Y,XX:()=>q,_3:()=>S,fF:()=>o,n:()=>w,q6:()=>Z,uA:()=>O,v2:()=>C});var r,o,i,a,s,l,u,c,d,p,h,f,m={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function S(){return{current:null}}function k(e){return e.children}function O(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?P(e):null}function A(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=y({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),I(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?P(t):n,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,G(r,a,i),t.__e=t.__=null,a.__e!=n&&N(a)}}function N(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),N(e)}function T(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!x.__r++||s!=o.debounceRendering)&&((s=o.debounceRendering)||l)(x)}function x(){for(var e,t=1;a.length;)a.length>t&&a.sort(u),e=a.shift(),t=a.length,A(e);x.__r=0}function M(e,t,n,r,o,i,a,s,l,u,c){var d,p,h,f,_,v,y,b=r&&r.__k||g,w=t.length;for(l=L(n,t,b,l,w),d=0;d<w;d++)null!=(h=n.__k[d])&&(p=-1!=h.__i&&b[h.__i]||m,h.__i=d,v=I(e,h,p,o,i,a,s,l,u,c),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&H(p.ref,null,h),c.push(h.ref,h.__c||f,h)),null==_&&null!=f&&(_=f),(y=!!(4&h.__u))||p.__k===h.__k?l=$(h,l,e,y):"function"==typeof h.type&&void 0!==v?l=v:f&&(l=f.nextSibling),h.__u&=-7);return n.__e=_,l}function L(e,t,n,r,o){var i,a,s,l,u,c=n.length,d=c,p=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[i]=E(null,a,null,null,null):v(a)?a=e.__k[i]=E(k,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=E(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+p,a.__=e,a.__b=e.__b+1,s=null,-1!=(u=a.__i=D(a,n,l,d))&&(d--,(s=n[u])&&(s.__u|=2)),null==s||null==s.__v?(-1==u&&(o>c?p--:o<c&&p++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=P(s)),V(s,s));return r}function $(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=$(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=P(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function C(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){C(e,t)}):t.push(e)),t}function D(e,t,n,r){var o,i,a,s=e.key,l=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==s||c&&s==u.key&&l==u.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(u=t[a=o>=0?o--:i++])&&!(2&u.__u)&&s==u.key&&l==u.type)return a;return-1}function j(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function R(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||j(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||j(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(c,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=d,e.addEventListener(t,i?h:p,i)):e.removeEventListener(t,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function I(e,t,n,r,i,a,s,l,u,c){var d,p,h,f,m,_,w,E,S,P,A,N,T,x,L,$=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof $)try{if(E=t.props,S="prototype"in $&&$.prototype.render,P=(d=$.contextType)&&r[d.__c],A=d?P?P.props.value:d.__:r,n.__c?w=(p=t.__c=n.__c).__=p.__E:(S?t.__c=p=new $(E,A):(t.__c=p=new O(E,A),p.constructor=$,p.render=z),P&&P.sub(p),p.state||(p.state={}),p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),S&&null==p.__s&&(p.__s=p.state),S&&null!=$.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,$.getDerivedStateFromProps(E,p.__s))),f=p.props,m=p.state,p.__v=t,h)S&&null==$.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),S&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(S&&null==$.getDerivedStateFromProps&&E!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,A),t.__v==n.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,A)){t.__v!=n.__v&&(p.props=E,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,A),S&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(f,m,_)})}if(p.context=A,p.props=E,p.__P=e,p.__e=!1,N=o.__r,T=0,S)p.state=p.__s,p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++T<25);p.state=p.__s,null!=p.getChildContext&&(r=y(y({},r),p.getChildContext())),S&&!h&&null!=p.getSnapshotBeforeUpdate&&(_=p.getSnapshotBeforeUpdate(f,m)),x=null!=d&&d.type===k&&null==d.key?W(d.props.children):d,l=M(e,v(x)?x:[x],t,n,r,i,a,s,l,u,c),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),w&&(p.__E=p.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(L=a.length;L--;)b(a[L]);B(t)}else t.__e=n.__e,t.__k=n.__k,e.then||B(t);o.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=U(n.__e,t,n,r,i,a,s,u,c);return(d=o.diffed)&&d(t),128&t.__u?void 0:l}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function G(e,t,n){for(var r=0;r<n.length;r++)H(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function W(e){return"object"!=typeof e||null==e||e.__b>0?e:v(e)?e.map(W):y({},e)}function U(e,t,n,i,a,s,l,u,c){var d,p,h,f,g,_,y,w=n.props||m,E=t.props,S=t.type;if("svg"==S?a="http://www.w3.org/2000/svg":"math"==S?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;d<s.length;d++)if((g=s[d])&&"setAttribute"in g==!!S&&(S?g.localName==S:3==g.nodeType)){e=g,s[d]=null;break}if(null==e){if(null==S)return document.createTextNode(E);e=document.createElementNS(a,S,E.is&&E),u&&(o.__m&&o.__m(t,s),u=!1),s=null}if(null==S)w===E||u&&e.data==E||(e.data=E);else{if(s=s&&r.call(e.childNodes),!u&&null!=s)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)g=w[d],"dangerouslySetInnerHTML"==d?h=g:"children"==d||d in E||"value"==d&&"defaultValue"in E||"checked"==d&&"defaultChecked"in E||R(e,d,null,g,a);for(d in E)g=E[d],"children"==d?f=g:"dangerouslySetInnerHTML"==d?p=g:"value"==d?_=g:"checked"==d?y=g:u&&"function"!=typeof g||w[d]===g||R(e,d,g,w[d],a);if(p)u||h&&(p.__html==h.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),M("template"==t.type?e.content:e,v(f)?f:[f],t,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":a,s,l,s?s[0]:n.__k&&P(n,0),u,c),null!=s)for(d=s.length;d--;)b(s[d]);u||(d="value","progress"==S&&null==_?e.removeAttribute("value"):null!=_&&(_!==e[d]||"progress"==S&&!_||"option"==S&&_!=w[d])&&R(e,d,_,w[d],a),d="checked",null!=y&&y!=e[d]&&R(e,d,y,w[d],a))}return e}function H(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function V(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||H(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&V(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function z(e,t,n){return this.constructor(e,n)}function q(e,t,n){var i,a,s,l;t==document&&(t=document.documentElement),o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],I(t,e=(!i&&n||t).__k=w(k,null,[e]),a||m,m,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,l),G(s,e,l)}function Y(e,t){q(e,t,Y)}function K(e,t,n){var o,i,a,s,l=y({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),E(e.type,l,o||e.key,i||e.ref,null)}function Z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,T(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+f++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=g.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,O.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},O.prototype.render=k,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,c=/(PointerCapture)$|Capture$/i,d=0,p=F(!1),h=F(!0),f=0},247:(e,t,n)=>{n.d(t,{FD:()=>i,FK:()=>r.FK,Y:()=>i});var r=n(126),o=0;function i(e,t,n,i,a,s){t||(t={});var l,u,c=t;if("ref"in c)for(u in c={},t)"ref"==u?l=t[u]:c[u]=t[u];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(l=e.defaultProps))for(u in l)void 0===c[u]&&(c[u]=l[u]);return r.fF.vnode&&r.fF.vnode(d),d}Array.isArray},944:(e,t,n)=>{n.d(t,{g5:()=>o,Yv:()=>Xe,g$:()=>i,Tj:()=>a,zp:()=>r});var r={};n.r(r),n.d(r,{default:()=>Q,sssiEnglandRequestTransformer:()=>Z,sssiScotlandRequestTransformer:()=>J,sssiWalesRequestTransformer:()=>X});var o={};n.r(o),n.d(o,{addFeatureToMap:()=>_e,createFeatureHTML:()=>be,createFeaturesHTML:()=>ve,focusFeature:()=>ye,getBoundingBox:()=>me,getFeaturesManager:()=>Se,getGeoJSON:()=>fe,getHelpPanelHtml:()=>le,getTexts:()=>ae,getUIManager:()=>ke,languageTexts:()=>ie,processGeospatial:()=>ge});var i={};n.r(i),n.d(i,{getInitMapConfig:()=>xe,getTexts:()=>Te,languageTexts:()=>Ne,processLocation:()=>Fe});var a={};n.r(a),n.d(a,{EVENTS:()=>Ke,centerMap:()=>et,createMap:()=>Qe,defaultConfig:()=>Ye,eastingNorthingToLatLong:()=>Ue,formSubmitFactory:()=>Ze,getCentroidGridRef:()=>qe,getCoordinateGridRef:()=>ze,getMapCountryLayers:()=>nt,getMapLayers:()=>tt,initMaps:()=>Xe,latLongToEastingNorthing:()=>We,latLongToOsGridRef:()=>He,makeTileRequestTransformer:()=>Je,osGridRefToLatLong:()=>Ve});var s=n(196),l=n(321),u=n(585);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(){var e,{manifest:t,mapStyles:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:t,mapStyles:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,171))).manifest}),function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}function h(){var e,{manifest:t,units:r="metric"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"scaleBar",manifest:t,units:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,415))).manifest}),function(){return e.apply(this,arguments)})}}var f=n(463);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(g(g(g({},f.D),t),t.expanded&&{manifest:{controls:[{id:"search",mobile:{slot:"banner"}}]}}),{},{id:"search",load:(e=(0,l.A)(function*(){return(yield Promise.resolve().then(n.bind(n,463)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})})}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:()=>{var e=(()=>{if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var t=document.createElement("canvas"),n=!1;for(var r of["webgl2","webgl1"])try{if((n=t.getContext(r))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}return{isEnabled:!1,error:"WebGL is supported, but disabled"}})(),t=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:t?"Internet Explorer is not supported":e.error}},load:(e=(0,l.A)(function*(){var e=yield n.e(264).then(n.t.bind(n,825,19));return t.workerUrl&&e.setWorkerUrl(t.workerUrl),{MapProvider:(yield n.e(402).then(n.bind(n,814))).default,mapProviderConfig:y(y({},t),{},{crs:"EPSG:4326"}),mapFramework:e}}),function(){return e.apply(this,arguments)})}}n(452),n(247);function w(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function E(e,t,n){if(null!==e)for(var r,o,i,a,s,l,u,c,d=0,p=0,h=e.type,f="FeatureCollection"===h,m="Feature"===h,g=f?e.features.length:1,_=0;_<g;_++){s=(c=!!(u=f?e.features[_].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var y=0,b=0;if(null!==(a=c?u.geometries[v]:u)){l=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(l,p,_,y,b))return!1;p++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],p,_,y,b))return!1;p++,"MultiPoint"===w&&y++}"LineString"===w&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-d;o++){if(!1===t(l[r][o],p,_,y,b))return!1;p++}"MultiLineString"===w&&y++,"Polygon"===w&&b++}"Polygon"===w&&y++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,o=0;o<l[r].length;o++){for(i=0;i<l[r][o].length-d;i++){if(!1===t(l[r][o][i],p,_,y,b))return!1;p++}b++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===E(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function S(e,t={}){let n=0,r=0,o=0;return E(e,function(e){n+=e[0],r+=e[1],o++},!0),function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!w(e[0])||!w(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([n/o,r/o],t.properties)}Math.PI;let k=" ";class O{static get separator(){return k}static set separator(e){k=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+O.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+O.separator+i+"′"+O.separator+a+"″"}return r}static toLat(e,t,n){const r=O.toDms(O.wrap90(e),t,n);return null===r?"–":r.slice(1)+O.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=O.toDms(O.wrap180(e),t,n);return null===r?"–":r+O.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=O.toDms(O.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=O.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const P=O;class A{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new A(t,n,r)}negate(){return new A(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new A(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");if(!(t instanceof A||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof A))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],p=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new A(p[0],p[1],p[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const N=A,T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},x={WGS84:{ellipsoid:T.WGS84}};Object.freeze(T.WGS84),Object.freeze(x.WGS84);class M{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=P.wrap90(Number(e)),this._lon=P.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?P.wrap90(P.parse(e)):P.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?P.wrap90(P.parse(e)):P.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return T}static get datums(){return x}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:T.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new L((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof M))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${P.toLat(this.lat,e,t)}, ${P.toLon(this.lon,e,t)}${null==n?"":r}`}}class L extends N{constructor(e,t,n){super(e,t,n)}toLatLon(e=T.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),p=d/c,h=isNaN(p)?0:Math.atan2(r+l*i*d*d*d,u-s*o*p*p*p),f=Math.atan2(n,t),m=Math.sin(h),g=u*Math.cos(h)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new M(h.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const $={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},C={ED50:{ellipsoid:$.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:$.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:$.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:$.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:$.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:$.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:$.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:$.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:$.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:$.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:$.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys($).forEach(e=>Object.freeze($[e])),Object.keys(C).forEach(e=>{Object.freeze(C[e]),Object.freeze(C[e].transform)});class D extends M{constructor(e,t,n=0,r=C.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return $}static get datums(){return C}static parse(...e){let t=C.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new j(e.x,e.y,e.z,this.datum)}}class j extends L{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||C.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new D(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=C.WGS84||(t=this,n=e.transform),e==C.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(C.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new j(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const R={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:D.ellipsoids.Airy1830};class F{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=D.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),p=d*d,h=d*d*d;let f=i,m=0;do{f=(n-l-m)/(r*u)+f,m=o*u*((1+d+5/4*p+5/4*h)*(f-i)-(3*d+3*d*d+21/8*h)*Math.sin(f-i)*Math.cos(f+i)+(15/8*p+15/8*h)*Math.sin(2*(f-i))*Math.cos(2*(f+i))-35/24*h*Math.sin(3*(f-i))*Math.cos(3*(f+i)))}while(Math.abs(n-l-m)>=1e-5);const g=Math.cos(f),_=Math.sin(f),v=r*u/Math.sqrt(1-c*_*_),y=r*u*(1-c)/Math.pow(1-c*_*_,1.5),b=v/y-1,w=Math.tan(f),E=w*w,S=E*E,k=1/g,O=v*v*v,P=O*v*v,A=t-s,N=A*A,T=N*A,x=N*N,M=T*N;f=f-w/(2*y*v)*N+w/(24*y*O)*(5+3*E+b-9*E*b)*x-w/(720*y*P)*(61+90*E+45*S)*(x*N);const L=a+k/v*A-k/(6*O)*(v/y+2*E)*T+k/(120*P)*(5+28*E+24*S)*M-k/(P*v*v*5040)*(61+662*E+1320*S+S*E*720)*(M*N);let $=new I(f.toDegrees(),L.toDegrees(),0,D.datums.OSGB36);return e!=D.datums.OSGB36&&($=$.convertDatum(e),$=new I($.lat,$.lon,$.height,$.datum)),$}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new F(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new F(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class I extends D{toOsGrid(){const e=this.datum==D.datums.OSGB36?this:this.convertDatum(D.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),p=d*d,f=d*d*d,m=Math.cos(t),g=Math.sin(t),_=r*u/Math.sqrt(1-c*g*g),v=r*u*(1-c)/Math.pow(1-c*g*g,1.5),y=_/v-1,b=o*u*((1+d+5/4*p+5/4*f)*(t-i)-(3*d+3*d*d+21/8*f)*Math.sin(t-i)*Math.cos(t+i)+(15/8*p+15/8*f)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*f*Math.sin(3*(t-i))*Math.cos(3*(t+i))),w=m*m*m,E=w*m*m,S=Math.tan(t)*Math.tan(t),k=S*S,O=n-a,P=O*O,A=P*O,N=A*O,T=N*O;let x=b+l+_/2*g*m*P+_/24*g*w*(5-S+9*y)*N+_/720*g*E*(61-58*S+k)*(T*O),M=s+_*m*O+_/6*w*(_/v-S)*A+_/120*E*(5-18*S+k+14*y-58*S*y)*T;x=Number(x.toFixed(3)),M=Number(M.toFixed(3));try{return new F(M,x)}catch(h){throw new Error(`${h.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new I(t.lat,t.lon,t.height,t.datum)}}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function W(){var e,t=G(G({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"datasets",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,407)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})});return t}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return E(e,e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}const z="en-GB",q="cy",Y=z,K={stroke:"#00897B",fillPattern:"diagonal-cross-hatch",fillPatternForegroundColor:"#00897B",fillPatternBackgroundColor:"transparent"};function Z(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",t.join(",")),{url:n.toString()}}function X(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",`${t.join(",")},EPSG:4326`),{url:n.toString()}}function J(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("geometry",t.join(",")),{url:n.toString()}}const Q=[{id:"sssi-england",label:"Sites of Special Scientific Interest",dynamicGeoJSON:{url:"https://environment.data.gov.uk/geoservices/datasets/ba8dc201-66ef-4983-9d46-7378af21027e/ogc/features/v1/collections/Sites_of_Special_Scientific_Interest_England/items?f=json",idProperty:"ref_code",transformRequest:Z},minZoom:12,style:K,showInKey:!0,showInMenu:!1},{id:"sssi-wales",label:"SSSI Wales",dynamicGeoJSON:{url:"https://datamap.gov.wales/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=inspire-nrw:NRW_SSSI&outputFormat=application/json&srsName=EPSG:4326",idProperty:"id",transformRequest:X},minZoom:12,style:K,showInKey:!1,showInMenu:!1},{id:"sssi-scotland",label:"SSSI Scotland",dynamicGeoJSON:{url:"https://services1.arcgis.com/LM9GyVFsughzHdbO/ArcGIS/rest/services/Sites_of_Special_Scientific_Interest/FeatureServer/0/query?f=geojson&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&returnGeometry=true&outFields=*",idProperty:"OBJECTID",transformRequest:J},minZoom:12,style:K,showInKey:!1,showInMenu:!1}],ee=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Defnyddiwch lyfliwr neu allweddlon i ganolbwyntio\'r pwynt yn y lleoliad","point4":"Cliciwch i ychwanegu\'r lleoliad i\'r map"}}},"QW":{"Tj":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","ledeIntro":"Gallwch ychwanegu","ledeOutro":"i\'r map.","lineText":"llinell","shapeText":"siâp","lineOrShapeText":"llinell neu siâp","typesPhrasePoint":"pwyntiau","typesPhraseLine":"lliniau","typesPhraseShape":"siâpiau","typesPhraseOr":"neu","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Cliciwch ddwywaith, neu dewiswch \'Wedi gorffen\', pan fyddwch wedi","point4":"Rhowch enw i\'r lleoliad"},"typeDescriptions":{"point":"Pwynt","line":"Llinell","polygon":"Siâp"},"buttons":{"point":"Ychwanegu pwynt","line":"Ychwanegu llinell","polygon":"Ychwanegu siâp"},"itemLabel1":"Lleoliad","itemLabel2":"disgrifiad","itemUpdateLink":"Diweddaru","itemDeleteLink":"Dileu","itemFocusLink":"Dangos","itemVisuallyHidden":"lleoliad","details":{"summary":"Cyfesurynnau","type":"Math","centroidGridReference":"Canol cyfeirnod grid","firstPointGridReference":"Cyfeirnod grid y pwynt cyntaf","detailedCoordinates":"Cyfesurynnau manwl"}}}}}'),te=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"How to use this map","point1":"Search for a place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Use a mouse or keyboard to centre the point at the location","point4":"Click to add the location to the map"}}},"QW":{"Tj":{"helpPanel":{"label":"How to use this map","ledeIntro":"You can add","ledeOutro":"to the map.","lineText":"a line","shapeText":"a shape","lineOrShapeText":"a line or shape","typesPhrasePoint":"points","typesPhraseLine":"lines","typesPhraseShape":"shapes","typesPhraseOr":"or","point1":"Search for a county, place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Double‑click, or select \'Done\', when you have finished drawing","point4":"Give the location a name"},"typeDescriptions":{"point":"Point","line":"Line","polygon":"Shape"},"buttons":{"point":"Add point","line":"Add line","polygon":"Add shape"},"itemLabel1":"Location","itemLabel2":"description","itemUpdateLink":"Update","itemDeleteLink":"Delete","itemFocusLink":"Show","itemVisuallyHidden":"location","details":{"summary":"Coordinates","type":"Type","centroidGridReference":"Centre grid reference","firstPointGridReference":"First point grid reference","detailedCoordinates":"Detailed coordinates"}}}}}');function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(null,arguments)}const re=te.dK.QW.Tj,oe=ee.dK.QW.Tj,ie={[z]:re,[q]:oe};function ae(e=Y){return ie[e]}const se={focus:!1,showLabel:!0,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1}};function le(e,t,n,r){const o=function(e,t,n){return t&&n?e.lineOrShapeText:t?e.lineText:n?e.shapeText:""}(e,n,r),i=o?`<li>${e.point3} ${o}</li>`:"",a=function(e,t,n,r){const o=[];return t&&o.push(e.typesPhrasePoint),n&&o.push(e.typesPhraseLine),r&&o.push(e.typesPhraseShape),function(e,t,n){if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return`${e[0]} ${n} ${e[1]}`;const r=e.pop();return`${e.join(", ")} ${n} ${r}`}(o,0,e.typesPhraseOr)}(e,t,n,r);return`<p class="govuk-body-s govuk-!-margin-bottom-2">${e.ledeIntro} ${a} ${e.ledeOutro}</p><ul class="govuk-list govuk-list--number govuk-body-s"><li>${e.point1}</li><li>${e.point2}</li>${i}<li>${e.point4}</li></ul>`}const ue={stroke:"rgba(0, 11, 112, 1)",fill:"rgba(0, 11, 112, 0.2)",strokeWidth:2},ce={stroke:"rgb(0, 0, 0)",fill:"rgba(255, 221, 0, 0.2)",strokeWidth:2},de='<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" /><circle cx="12" cy="10" r="3" />',pe='<path d="M19.5 7v10M4.5 7v10M7 19.5h10M7 4.5h10"/><path d="M22 18v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zm0-15v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 18v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 3v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1z"/>',he='<path d="M5.706 16.294L16.294 5.706"/><path d="M21 2v3c0 .549-.451 1-1 1h-3c-.549 0-1-.451-1-1V2c0-.549.451-1 1-1h3c.549 0 1 .451 1 1zM6 17v3c0 .549-.451 1-1 1H2c-.549 0-1-.451-1-1v-3c0-.549.451-1 1-1h3c.549 0 1 .451 1 1z"/>';function fe(e){const t=e.value.trim();return{type:"FeatureCollection",features:t?JSON.parse(t):[]}}function me(e){return V(e)}function ge(e,t,r){if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".govuk-textarea");if(!(o instanceof HTMLTextAreaElement))return;const{listEl:i,mapId:a}=function(e,t){const n=document.createElement("div"),r=`geospatialmap_${t}`;n.setAttribute("id",r),n.setAttribute("class","map-container");const o=document.createElement("div"),i=`${r}_list`;return o.setAttribute("id",i),e.after(n),n.after(o),e.classList.add("js-hidden"),{mapEl:n,listEl:o,mapId:r}}(o,r),s=fe(o),u=s.features.length?me(s):void 0,c=function(){var e;return H(H({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"draw",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,327))).manifest}),function(){return e.apply(this,arguments)})})}(),d=[c],p=t.dataset.country,h=tt(t.dataset.maplayers),f=nt(e.apiPath,p);h.includes("sssi")&&f.push(...Q),f.length&&d.push(W({datasets:f}));const m=ne({},Ye,{bounds:u,plugins:d}),{map:g,interactPlugin:_}=Qe(a,m,e),v=Se(s),y=function(){let e;return{getActiveFeature:function(){return e},setActiveFeature:function(t){e=t},resetActiveFeature:function(){e=void 0}}}(),b={geometryTypes:t.dataset.geometrytypes},w=t.dataset.lang||Y,E=ke(s,g,a,i,o,b,w);!function(e){const{map:t}=e;t.on(Ke.mapReady,function(e){const{map:t,activeFeatureManager:n,uiManager:r,interactPlugin:o,drawPlugin:i}=e,{toggleActionButtons:a,renderList:s,getAllowableGeometryTypes:l}=r,{resetActiveFeature:u}=n;return function(n){const c=l(),d=c.includes("point"),p=c.includes("line"),h=c.includes("shape"),{texts:f}=e.languageManager;t.addPanel("info",ne({},se,{label:f.helpPanel.label,html:le(f.helpPanel,d,p,h)})),d&&t.addButton("btnAddPoint",{variant:"tertiary",label:f.buttons.point,iconSvgContent:de,onClick:()=>{u(),a(!0),s(!0),o.enable()},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),h&&t.addButton("btnAddPolygon",{variant:"tertiary",label:f.buttons.polygon,iconSvgContent:pe,onClick:()=>{u(),a(!0),s(!0),i.newPolygon(we(),ce)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),p&&t.addButton("btnAddLine",{variant:"tertiary",label:f.buttons.line,iconSvgContent:he,onClick:()=>{u(),a(!0),s(!0),i.newLine(we(),ue)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),e.mapProvider=n.map,t.on(Ke.drawReady,function(e){const{featuresManager:t,uiManager:n,drawPlugin:r,map:o}=e,{renderList:i}=n,{getFeatures:a}=t;return function(){a().forEach(e=>_e(e,r,o)),i()}}(e)),t.on(Ke.drawCreated,function(e){const{featuresManager:t,uiManager:n}=e,{addFeature:r}=t,{renderList:o,toggleActionButtons:i,focusDescriptionInput:a}=n;return function(e){r(ne({},e,{properties:{description:""}})),o(),i(!1),a()}}(e)),t.on(Ke.drawEdited,function(e){const{featuresManager:t,activeFeatureManager:n,uiManager:r}=e,{updateFeature:o}=t,{getActiveFeature:i,resetActiveFeature:a}=n,{renderList:s,toggleActionButtons:l}=r;return function(e){const t=e,n=t.id;i()===n&&(o(n,t.geometry),s()),a(),l(!1)}}(e)),t.on(Ke.drawCancelled,function(e){const{uiManager:t,activeFeatureManager:n}=e,{toggleActionButtons:r,renderList:o}=t,{resetActiveFeature:i}=n;return function(){r(!1),i(),o()}}(e)),t.on(Ke.interactMarkerChange,function(e){const{featuresManager:t,activeFeatureManager:n,map:r,interactPlugin:o,uiManager:i}=e,{addFeature:a,updateFeature:s}=t,{getActiveFeature:l,resetActiveFeature:u}=n,{renderList:c,focusDescriptionInput:d,toggleActionButtons:p}=i;return function(e){const t=l();if(t){const n=s(t,{type:"Point",coordinates:e.coords});r.addMarker(t,e.coords),n&&c(),u()}else{const t=we();a({type:"Feature",properties:{description:""},geometry:{type:"Point",coordinates:e.coords},id:t}),r.addMarker(t,e.coords),c(),d()}r.removeMarker("location"),o.disable(),p(!1)}}(e));const{listEl:m}=r;m.addEventListener("click",function(e){const{map:t,mapProvider:n,featuresManager:r,activeFeatureManager:o,interactPlugin:i,uiManager:a,drawPlugin:s}=e,{getFeature:l,removeFeature:u}=r,{getActiveFeature:c,setActiveFeature:d}=o,{renderList:p,toggleActionButtons:h}=a;return function(e){const r=e.target;if(r instanceof HTMLElement){if(c())return e.preventDefault(),void e.stopPropagation();if("A"===r.tagName&&r.dataset.action&&r.dataset.id&&r.dataset.type){const{action:o,id:a,type:c}=r.dataset;"edit"===o?function(e,t){d(e),"Point"===t?(i.selectFeature({featureId:e}),i.enable()):s.editFeature(e);const r=l(e);r&&n&&ye(r,n),h(!0),p(!0)}(a,c):(e.preventDefault(),e.stopPropagation(),"delete"===o&&function(e,n){"Point"===n?(t.removeMarker(e),u(e)):(s.deleteFeature(e),u(e)),p()}(a,c))}}}}(e),!1),m.addEventListener("change",function(e){const{featuresManager:t,uiManager:n}=e,{getFeature:r}=t,{renderValue:o}=n;return function(e){e.preventDefault(),e.stopPropagation();const t=e.target;if(!(t instanceof HTMLInputElement&&t.dataset.id))return;const{id:n}=t.dataset,i=r(n);i&&(i.properties.description=t.value.trim(),o())}}(e),!1),m.addEventListener("keydown",function(e){e.target instanceof HTMLInputElement&&("Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),e.stopPropagation()))},!1)}}(e))}({languageManager:{lang:w,texts:ae(w)},map:g,featuresManager:v,activeFeatureManager:y,uiManager:E,interactPlugin:_,drawPlugin:c})}function _e(e,t,n){switch(e.geometry.type){case"Polygon":t.addFeature(ne({},e,ce));break;case"LineString":t.addFeature(ne({},e,ue));break;case"Point":n.addMarker(e.id,e.geometry.coordinates)}}function ve(e,t,n=!1,r=!1,o=Y){return`<dl class="govuk-summary-list">\n ${e.map((e,i)=>be(e,i,t,n,r,o)).join("\n")}\n </dl>`}function ye(e,t){t.fitBounds(V(e))}function be(e,t,n,r=!1,o=!1,i=Y){const a=ae(i),s=e.geometry.coordinates.flat(2),l=[];for(let h=0;h<s.length;h+=2)l.push(s.slice(h,h+2).join(", "));const u=l.map(e=>`<li>${e}</li>`).join(""),c=o?`<p class="govuk-body govuk-!-margin-bottom-0">${e.properties.description}</p>`:`<input class="govuk-input govuk-!-width-two-thirds" type="text" id="description_${t}" value="${e.properties.description}" data-id="${e.id}">`,d=`<ul class="govuk-summary-list__actions-list">${o?`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state" href="#${n}" data-action="focus" data-id="${e.id}">${a.itemFocusLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`:`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#${n}" data-action="edit" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemUpdateLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li><li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#" data-action="delete" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemDeleteLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`}</ul>`,p=function(e,t){switch(e.geometry.type){case"Point":return t.point;case"LineString":return t.line;case"Polygon":return t.polygon}}(e,a.typeDescriptions);return`<div class="govuk-summary-list__row govuk-summary-list__row--no-border">\n <dt class="govuk-summary-list__key">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" ${o?"":`for="description_${t}"`}>${a.itemLabel1} ${t+1} ${a.itemLabel2}</label>\n ${c}\n </div>\n </dt>\n <dd class="govuk-summary-list__actions">\n ${d}\n </dd>\n</div>\n<div class="govuk-summary-list__row">\n <details class="govuk-details govuk-!-margin-bottom-2">\n <summary class="govuk-details__summary">\n <span class="govuk-details__summary-text">${a.details.summary}</span>\n </summary>\n <div class="govuk-details__text">\n <dl class="govuk-summary-list">\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.type}</dt>\n <dd class="govuk-summary-list__value">${p}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.centroidGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.centroidGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.firstPointGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.coordinateGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.detailedCoordinates}</dt>\n <dd class="govuk-summary-list__value">\n <ol class="govuk-list govuk-list--number">${u}</ol>\n </dd>\n </div>\n </dl>\n </div>\n </details>\n</div>`}function we(){return window.crypto.randomUUID()}function Ee(e){const{geometry:t}=e;function n(e){e[0]=+e[0].toFixed(7),e[1]=+e[1].toFixed(7)}"Point"===t.type?n(t.coordinates):"LineString"===t.type?t.coordinates.forEach(n):t.coordinates.flat().forEach(n)}function Se(e){function t(t){return e.features.find(e=>e.id===t)}return{getFeatures:function(){return e.features},getFeature:t,addFeature:function(t){t.properties.coordinateGridReference=ze(t),t.properties.centroidGridReference=qe(t),Ee(t),e.features.push(t)},updateFeature:function(e,n){const r=t(e);return r&&(r.geometry=n,r.properties.coordinateGridReference=ze(r),r.properties.centroidGridReference=qe(r),Ee(r)),r},removeFeature:function(t){const n=e.features.findIndex(e=>e.id===t);return n>-1?e.features.splice(n,1):void 0}}}function ke(e,t,n,r,o,i,a=Y){function s(){return null!=i&&i.geometryTypes?i.geometryTypes.split(","):["point","line","shape"]}const l=function(e,t){return function(){t.value=JSON.stringify(e.features,null,2)}}(e,o),u=function(e,t,n,r,o=Y){return function(i=!1){const a=ve(e.features,t,i,!1,o);n.innerHTML=a,r()}}(e,n,r,l,a);return{renderList:u,renderValue:l,listEl:r,toggleActionButtons:function(e){const n=s();n.includes("point")&&t.toggleButtonState("btnAddPoint","hidden",e),n.includes("shape")&&t.toggleButtonState("btnAddPolygon","hidden",e),n.includes("line")&&t.toggleButtonState("btnAddLine","hidden",e)},focusDescriptionInput:function(){const e=r.querySelectorAll("input");if(e.length){const t=e.item(e.length-1);t.focus(),t.select()}},getAllowableGeometryTypes:s}}const Oe=te.dK.Bt.T,Pe=ee.dK.Bt.T,Ae="input.govuk-input",Ne={[z]:Oe,[q]:Pe};function Te(e=Y){return Ne[e]}function xe(e){switch(e.dataset.locationtype){case"latlongfield":return function(e){const{latInput:t,longInput:n}=Ce(e),r=Me(t.value,n.value);if(r.valid)return Re([r.value.long,r.value.lat])}(e);case"eastingnorthingfield":return function(e){const{eastingInput:t,northingInput:n}=De(e),r=Le(t.value,n.value);if(!r.valid)return;const o=Ue(r.value);return Re([o.long,o.lat])}(e);case"osgridreffield":return function(e){const t=$e(je(e).value);if(!t.valid)return;const n=Ve(t.value);return Re([n.long,n.lat])}(e);default:throw new Error("Not implemented")}}function Me(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=49.85&&n<=60.859&&r>=-13.687&&r<=1.767?{valid:!0,value:{lat:n,long:r}}:{valid:!1}}function Le(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=0&&n<=7e5&&r>=0&&r<=13e5?{valid:!0,value:{easting:n,northing:r}}:{valid:!1}}function $e(e){if(!e)return{valid:!1};const t=/^((([sS]|[nN])[a-hA-Hj-zJ-Z])|(([tT]|[oO])[abfglmqrvwABFGLMQRVW])|([hH][l-zL-Z])|([jJ][lmqrvwLMQRVW]))\s?(([0-9]{3})\s?([0-9]{3})|([0-9]{4})\s?([0-9]{4})|([0-9]{5})\s?([0-9]{5}))$/.exec(e);return null===t?{valid:!1}:{valid:!0,value:t[0]}}function Ce(e){const t=e.querySelectorAll(Ae);if(2!==t.length)throw new Error("Expected 2 inputs for lat and long");return{latInput:t[0],longInput:t[1]}}function De(e){const t=e.querySelectorAll(Ae);if(2!==t.length)throw new Error("Expected 2 inputs for easting and northing");return{eastingInput:t[0],northingInput:t[1]}}function je(e){const t=e.querySelector(Ae);if(null===t)throw new Error("Expected 1 input for osgridref");return t}function Re(e){return{zoom:"16",center:e,markers:[{id:"location",coords:e}]}}function Fe(e,t,n){var r;if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".app-location-field-inputs");if(!(o instanceof HTMLDivElement))return;const i=t.dataset.locationtype;if(!i||!["latlongfield","eastingnorthingfield","osgridreffield"].includes(i))return;const a=document.createElement("div"),s=`map_${n}`;a.setAttribute("id",s),a.setAttribute("class","map-container");const l=null!=(r=xe(t))?r:Ye;o.after(a);const u=t.dataset.country,c=tt(t.dataset.maplayers),d=nt(e.apiPath,u);c.includes("sssi")&&d.push(...Q),d.length&&(l.plugins=[W({datasets:d})]);const p=t.dataset.lang||Y,{map:h,interactPlugin:f}=Qe(s,l,e);h.on(Ke.mapReady,function(e){switch(i){case"latlongfield":!function(e,t,n){const{latInput:r,longInput:o}=Ce(e);function i(){const e=Me(r.value,o.value);if(e.valid){const r=[e.value.long,e.value.lat];et(t,n,r)}}t.on(Ke.interactMarkerChange,function(e){r.value=e.coords[1].toFixed(7),o.value=e.coords[0].toFixed(7)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"eastingnorthingfield":!function(e,t,n){const{eastingInput:r,northingInput:o}=De(e);function i(){const e=Le(r.value,o.value);if(e.valid){const r=Ue(e.value),o=[r.long,r.lat];et(t,n,o)}}t.on(Ke.interactMarkerChange,function(e){const t=We({lat:e.coords[1],long:e.coords[0]});r.value=t.easting.toFixed(0),o.value=t.northing.toFixed(0)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"osgridreffield":!function(e,t,n){const r=je(e);t.on(Ke.interactMarkerChange,function(e){const t=He({lat:e.coords[1],long:e.coords[0]});r.value=t}),r.addEventListener("change",function(){const e=$e(r.value);if(e.valid){const r=Ve(e.value),o=[r.long,r.lat];et(t,n,o)}},!1)}(t,h,e.map);break;default:throw new Error("Not implemented")}const n=Te(p);h.addPanel("info",{focus:!1,showLabel:!0,label:n.helpPanel.label,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1},html:`<ul><li>${n.helpPanel.point1}</li><li>${n.helpPanel.point2}</li><li>${n.helpPanel.point3}</li><li>${n.helpPanel.point4}</li></ul>`}),f.enable()})}function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ie.apply(null,arguments)}const Be=169,Ge={VTS_OUTDOOR_URL:"/api/maps/vts/OS_VTS_3857_Outdoor.json",VTS_DARK_URL:"/api/maps/vts/OS_VTS_3857_Dark.json",VTS_BLACK_AND_WHITE_URL:"/api/maps/vts/OS_VTS_3857_Black_and_White.json",VTS_AERIAL_URL:"/api/maps/vts/esri-aerial.json"};function We({lat:e,long:t}){return new I(e,t).toOsGrid()}function Ue({easting:e,northing:t}){const n=new F(e,t).toLatLon();return{lat:n.latitude,long:n.longitude}}function He({lat:e,long:t}){return new I(e,t).toOsGrid().toString()}function Ve(e){const t=F.parse(e).toLatLon();return{lat:t.latitude,long:t.longitude}}function ze(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}if("LineString"===e.geometry.type){const[t,n]=e.geometry.coordinates[0];return new I(n,t).toOsGrid().toString()}{const[t,n]=e.geometry.coordinates[0][0];return new I(n,t).toOsGrid().toString()}}function qe(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}{const t=S(e),[n,r]=t.geometry.coordinates;return new I(r,n).toOsGrid().toString()}}const Ye={zoom:"6",center:[-2.421975,53.825564]},Ke={mapReady:"map:ready",interactMarkerChange:"interact:markerchange",drawReady:"draw:ready",drawCreated:"draw:created",drawEdited:"draw:edited",drawCancelled:"draw:cancelled"};function Ze(e){return function(t){t.submitter instanceof HTMLButtonElement&&e.includes(t.submitter)||t.preventDefault()}}function Xe(e={}){const{assetPath:t="/assets",apiPath:n="/form/api",data:r=Ge}=e,o=document.querySelectorAll(".app-location-field"),i=document.querySelectorAll(".app-geospatial-field");if(o.length){const e=o[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ze(t),!1)}if(i.length){const e=i[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ze(t),!1)}o.forEach((e,o)=>{Fe({assetPath:t,apiPath:n,data:r},e,o)}),i.forEach((e,o)=>{ge({assetPath:t,apiPath:n,data:r},e,o)})}function Je(e){return function(t,n){if(t.startsWith("https://api.os.uk")){if("Tile"===n)return{url:t.replace("https://api.os.uk/maps/vector/v1/vts",`${window.location.origin}${e}`),headers:{}};if("Style"!==n)return{url:`${e}/map-proxy?url=${encodeURIComponent(t)}`,headers:{}}}if(t.startsWith("https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main")){const n=t.substring(84);return{url:`${e}/maps/vts${n}`,headers:{}}}return{url:t,headers:{}}}}function Qe(e,t,r){var o;const{assetPath:i,apiPath:a,data:u=Ge}=r,c="Ordnance survey logo",f=function(){var e;return d(d({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"interact",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,706))).manifest}),function(){return e.apply(this,arguments)})})}({markerColor:{outdoor:"#ff0000",dark:"#00ff00"},interactionModes:["placeMarker"],multiSelect:!1});return{map:new s.I(e,Ie({enableFullscreen:!0,autoColorScheme:!1,mapProvider:b(),behaviour:"inline",minZoom:6,maxZoom:18,containerHeight:"400px",enableZoomControls:!0,transformRequest:Je(a)},t,{plugins:[p({mapStyles:[{id:"outdoor",label:"Outdoor",url:u.VTS_OUTDOOR_URL,thumbnail:`${i}/interactive-map/assets/images/outdoor-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Be)} Crown copyright and database rights ${(new Date).getFullYear()}`,backgroundColor:"#f5f5f0"},{id:"dark",label:"Dark",url:u.VTS_DARK_URL,mapColorScheme:"dark",appColorScheme:"dark",thumbnail:`${i}/interactive-map/assets/images/dark-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-white.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Be)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"black-and-white",label:"Black/White",url:u.VTS_BLACK_AND_WHITE_URL,thumbnail:`${i}/interactive-map/assets/images/black-and-white-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-black.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Be)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"aerial",label:"Aerial",url:u.VTS_AERIAL_URL,thumbnail:`${i}/interactive-map/assets/images/aerial-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/esri-logo.png`,logoAltText:"Powered by Esri",attribution:`Tiles ${String.fromCodePoint(Be)} Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community ${(new Date).getFullYear()}`}]}),f,_({osNamesURL:`${a}/geocode-proxy?query={query}`,width:"300px",showMarker:!1}),h({units:"metric"}),...null!=(o=t.plugins)?o:[]]})),interactPlugin:f}}function et(e,t,n){e.addMarker("location",n),t.flyTo({center:n,zoom:14,essential:!0})}function tt(e){const t=null==e?void 0:e.trim();return t?t.split(","):[]}function nt(e,t){const n=[];return t&&n.push({id:"invalid-area",label:"Invalid areas",geojson:`${e}/maps/countries.geojson?omit=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"gray",strokeWidth:1,fill:"rgba(211,211,211,0.8)"}},{id:"valid-area",label:"Valid areas",geojson:`${e}/maps/countries.geojson?only=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"rgba(0,112,60,1)",strokeWidth:1}}),n}},321:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)})}}n.d(t,{A:()=>o})},585:(e,t,n)=>{function r(e){return r="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},r(e)}function o(e,t,n){return(t=function(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>o})},505:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{A:()=>r})},196:(e,t,n)=>{n.d(t,{E:()=>w,I:()=>z,a:()=>M,b:()=>v,g:()=>l,h:()=>C,l:()=>b,r:()=>D,s:()=>L,t:()=>g});var r=n(321),o=n(585),i=n(505),a=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)},s=e=>{var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},l=e=>{var{behaviour:t}=e;return["mapOnly","buttonFirst"].includes(t)||s(e)};function u(){c.forEach(e=>{!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!s(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(e,a(e.config.mapViewQueryParam))})}var c=new Map,d=!1;function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function f(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var m=(e,t,n,r)=>e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e);function g(e){var t,{containerEl:n,isFullscreen:r,boundaryEl:o=document.body}=e,i=Array.from(o.querySelectorAll("[data-fm-inert]"));if(n&&(i=i.filter(e=>!n.contains(e))),i.forEach(e=>{e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),r){null===(t=document.activeElement)||void 0===t||t.blur();for(var a=n;null!==(s=a)&&void 0!==s&&s.parentNode&&a!==o&&a!==document.body;){var s,l=a.parentNode;for(var u of l.children)m(u,a,n,o)&&(u.setAttribute("aria-hidden","true"),u.dataset.fmInert="");a=l}}}function _(e){var{isFullscreen:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{config:n,rootEl:r}=e,{pageTitle:o,behaviour:i,containerHeight:l}=n,u=null!=t?t:function(e){var{id:t,behaviour:n,manageHistoryState:r}=e;return"mapOnly"===n||("buttonFirst"===n?!1===r||a(e.mapViewQueryParam)===t:s(e)&&a(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(i)&&(g({containerEl:r,isFullscreen:u}),document.documentElement.classList.toggle("im-is-fullscreen",u),r.classList.toggle("im-is-fullscreen",u)),["buttonFirst","hybrid"].includes(i)&&function(e){var{pageTitle:t,isFullscreen:n}=e,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:o,isFullscreen:u});var c=u||"buttonFirst"!==i&&!s(n)?l:"auto";return r.style.height=u?"100%":c,{isFullscreen:u}}function v(){document.body.classList.remove("im-is-loading")}var y="[interactive-map]",b={warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.warn(y,...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(y,...t)}},w={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",APP_REMOVE_MARKER:"app:removemarker",APP_SET_MODE:"app:setmode",APP_REVERT_MODE:"app:revertmode",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_FULLSCREEN_CHANGE:"app:fullscreenchange",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"};function E(e){var{id:t,behaviour:n}=e,r=a(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!s(e)||r}var S={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,backAndContinue:null,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Shift</kbd> + <kbd>?</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map application",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewQueryParam:"mv",urlPosition:"sync",maxMobileWidth:640,minDesktopWidth:835,nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1},k=["mapViewParamKey"];function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var A=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",N=new Set,T=new Set;function x(e){A!==e&&(A=e,T.forEach(t=>t(e)),N.forEach(t=>t(e)))}function M(){return"unknown"===A?(A="mouse","mouse"):A}function L(e){return N.add(e),()=>{N.delete(e)}}var $=null;function C(){return null!==$}function D(e,t){if(!$)throw new Error("ReverseGeocode not initialised");return $(e,t)}class j{constructor(){this.events={},this._queued={}}on(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t(...this._queued[e])}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}once(e,t){var n=this,r=function(){n.off(e,r),t(...arguments)};return this.on(e,r)}off(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(e=>e!==t):[],this):this}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(t=>{try{t(...n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}emitWhenReady(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit(e,...n):(this._queued[e]=n,this)}destroy(){this.events={},this._queued={}}}if("undefined"!=typeof crypto&&!crypto.randomUUID){var R=0;crypto.randomUUID=()=>(R=Math.max(Date.now(),R+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e,t)=>{var n=t<12?Number.parseInt(R.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)}))}var F=!Object.hasOwn;F&&(Object.hasOwn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t));var I="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(I&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(I||F)&&"undefined"!=typeof URL&&URL.createObjectURL){var B="text/javascript",G=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",I?'if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n':""].join(""),W=URL.createObjectURL.bind(URL);if(URL.createObjectURL=e=>(e instanceof Blob&&e.type===B&&(e=new Blob([G,e],{type:B})),W(e)),"undefined"!=typeof Worker){var U=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")){var n=new Blob(["".concat(G,"importScripts(").concat(JSON.stringify(e),")")],{type:B});e=W(n)}return new U(e,t)},Worker.prototype=U.prototype}}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}class z{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,o.A)(this,"_openButton",null),(0,o.A)(this,"_root",null),(0,o.A)(this,"_breakpointDetector",null),(0,o.A)(this,"_interfaceDetectorCleanup",null),(0,o.A)(this,"_hybridBehaviourCleanup",null),(0,o.A)(this,"_isHidden",!1),(0,o.A)(this,"_isClosingViaBack",!1),(0,o.A)(this,"_isLoading",!1),this.id=e,this.rootEl=document.getElementById(e),!this.rootEl)throw new Error('Element with id "'.concat(e,'" not found'));this.eventBus=new j,this.config=this._buildConfig(t),function(e,t){var{mapProvider:n,deviceNotSupportedText:r}=t,o=null==n?void 0:n.checkDeviceCapabilities();return n?!(null==o||!o.isSupported)||(f(e,r),v(),b.warn(null==o?void 0:o.error),!1):(b.warn("No map provider"),!1)}(this.rootEl,this.config)&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&function(e){d||(globalThis.addEventListener("popstate",u),d=!0),c.set(e.id,e)}(this),this._breakpointDetector=function(e){var t,{maxMobileWidth:n,minDesktopWidth:r,containerEl:o}=e,i="unknown",a=new Set,s=e=>{e!==i&&(i=e,requestAnimationFrame(()=>{i===e&&a.forEach(t=>t(e))}))};if(o){var l=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(r=>{var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),s=t(a);e.dataset.breakpoint=s,n(s)});return i.observe(e),{initialType:o,cleanup:()=>{i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,e=>function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r),s);i=l.initialType,s(l.initialType),t=l.cleanup}else{var u=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=()=>{var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:()=>{r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,s);t=u.cleanup}return{subscribe:e=>(a.add(e),()=>a.delete(e)),getBreakpoint:()=>i,destroy:()=>{var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=function(){var e=window.matchMedia("(pointer: coarse)"),t=e=>{x(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=e=>{var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==A&&(A=n,T.forEach(e=>e(n)),setTimeout(()=>{N.forEach(e=>e(n))},150))},r=e=>{"Tab"===e.key&&x("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),()=>{e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}(),this._initialize())}_buildConfig(e){var t=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={};for(var r of Object.keys(t))n[r]=h(t[r]);return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mapViewParamKey:t}=e,n=(0,i.A)(e,k),r=P(P({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(V(V({id:this.id,title:document.title},t),e))}_initialize(){["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(e,t,n){var{id:r,buttonText:o,buttonClass:i}=e,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");t.insertAdjacentHTML("beforebegin",a);var s=t.previousElementSibling,l=new URL(window.location.href);return l.searchParams.set(e.mapViewQueryParam,r),s.setAttribute("href",l.toString()),s.addEventListener("click",e=>{e.preventDefault(),n(e)}),s}(this.config,this.rootEl,e=>{this._handleButtonClick(e)})),this._hybridBehaviourCleanup=function(e){var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e.config;if("buttonFirst"===t&&e._breakpointDetector.subscribe(()=>{E(e.config)?e.loadApp():e.removeApp()}),"hybrid"===t){var o=null!=n?n:r,i=window.matchMedia("(max-width: ".concat(o,"px)")),a=()=>{if(E(e.config))if(e._isHidden)e.showApp();else if(null==e._root)e.loadApp();else{var{isFullscreen:t}=_(e);e.eventBus.emit(w.APP_FULLSCREEN_CHANGE,{isFullscreen:t})}else e._root&&e.hideApp()};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}return null}(this),E(this.config)?this.loadApp():v()}_handleButtonClick(e){this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.loadApp())}_removeMapParamFromUrl(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,(e,t)=>"&"===t?"?":"").replace(/\?$/,""):e}_handleExitClick(){var e;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(()=>{this._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var t=this.config.mapViewQueryParam,n=this._removeMapParamFromUrl(location.href,t);history.replaceState(history.state,"",n)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}loadApp(){var e=this;return(0,r.A)(function*(){if(!e._root&&!e._isLoading){e._isLoading=!0,e._openButton&&(e._openButton.style.display="none");try{var{initialiseApp:t}=yield Promise.all([n.e(402),n.e(935)]).then(n.bind(n,967)),{MapProvider:o,mapFramework:i,mapProviderConfig:a}=yield e.config.mapProvider.load();e.config.reverseGeocodeProvider&&function(e,t){var{url:n,transformRequest:o,load:i}=e;$=function(){var e=(0,r.A)(function*(e,r){return(yield i())(n,o,t,e,r)});return function(t,n){return e.apply(this,arguments)}}()}(e.config.reverseGeocodeProvider,a.crs);var s=yield t(e.rootEl,V(V({id:e.id,initialBreakpoint:e._breakpointDetector.getBreakpoint(),initialInterfaceType:M()},e.config),{},{MapProvider:o,mapProviderConfig:a,mapFramework:i,eventBus:e.eventBus,breakpointDetector:e._breakpointDetector,handleExitClick:e._handleExitClick.bind(e)}));e._root=s._root,delete s._root;var l=new Set(["on","off","emit"]);Object.keys(s).forEach(t=>{l.has(t)||(e[t]=s[t])});var{isFullscreen:u}=_(e);e.eventBus.emit(w.APP_OPENED,{statePreserved:!1,isFullscreen:u})}catch(d){var c;throw null===(c=e._openButton)||void 0===c||c.removeAttribute("style"),f(e.rootEl,e.config.genericErrorText),console.error(d),d}finally{e._isLoading=!1}}})()}removeApp(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),_(this,{isFullscreen:!1}),this.eventBus.emit(w.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(w.MAP_DESTROY,{mapId:this.id})}hideApp(){this._isHidden=!0,this.rootEl.style.display="none",g({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(w.APP_CLOSED,{statePreserved:!0})}showApp(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none");var{isFullscreen:e}=_(this);this.eventBus.emit(w.APP_OPENED,{statePreserved:!0,isFullscreen:e})}destroy(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),function(e){c.delete(e.id),0===c.size&&(globalThis.removeEventListener("popstate",u),d=!1)}(this),this.eventBus.destroy()}on(){this.eventBus.on(...arguments)}off(){this.eventBus.off(...arguments)}emit(){this.eventBus.emit(...arguments)}addMarker(e,t,n){this.eventBus.emit(w.APP_ADD_MARKER,{id:e,coords:t,options:n})}updateMarker(e,t){this.eventBus.emit(w.APP_UPDATE_MARKER,{id:e,options:t})}removeMarker(e){this.eventBus.emit(w.APP_REMOVE_MARKER,e)}setMode(e){this.eventBus.emit(w.APP_SET_MODE,e)}addButton(e,t){this.eventBus.emit(w.APP_ADD_BUTTON,{id:e,config:t})}toggleButtonState(e,t,n){this.eventBus.emit(w.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}setContinueEnabled(e){this.toggleButtonState("journeyContinue","disabled",!e)}addPanel(e,t){this.eventBus.emit(w.APP_ADD_PANEL,{id:e,config:t})}removePanel(e){this.eventBus.emit(w.APP_REMOVE_PANEL,e)}showPanel(e){var{focus:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.eventBus.emit(w.APP_SHOW_PANEL,{id:e,focus:t})}hidePanel(e){this.eventBus.emit(w.APP_HIDE_PANEL,e)}addControl(e,t){this.eventBus.emit(w.APP_ADD_CONTROL,{id:e,config:t})}fitToBounds(e){this.eventBus.emitWhenReady(w.MAP_FIT_TO_BOUNDS,e)}setView(e){this.eventBus.emitWhenReady(w.MAP_SET_VIEW,e)}open(){this._isHidden?this.showApp():this._root||this.loadApp()}close(){this._handleExitClick()}}},463:(e,t,n)=>{n.d(t,{D:()=>u,m:()=>re});var r=n(452),o=n(247),i=n(585),a=n(505);function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var l=n(321),u={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"};function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p={TOGGLE_EXPANDED:(e,t)=>d(d({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_KEYBOARD_FOCUS_WITHIN:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0}),INPUT_BLUR:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1}),SET_VALUE:(e,t)=>d(d({},e),{},{value:t}),UPDATE_SUGGESTIONS:(e,t)=>d(d({},e),{},{suggestions:t.results,hasFetchedSuggestions:!0,hasSearchError:t.hasError}),SHOW_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1}),HIDE_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_SELECTED:(e,t)=>d(d({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})},h=e=>{var{id:t,isExpanded:n,onClick:r,buttonRef:i,searchIcon:a,showLabel:s}=e;return(0,o.FD)("button",{"aria-label":"Open search",className:"im-c-map-button im-c-search-open-button",onClick:r,"aria-controls":"".concat(t,"-search-form"),ref:i,style:n?{display:"none"}:void 0,children:[a&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}}),s&&(0,o.Y)("span",{children:"Search"})]})},f=e=>{var{id:t,pluginState:n,handleSuggestionClick:r}=e;return(0,o.Y)("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search"),className:"im-c-search-suggestions",style:n.areSuggestionsVisible&&n.suggestions.length?void 0:{display:"none"},children:n.suggestions.map((e,i)=>(0,o.Y)("li",{id:"".concat(t,"-search-suggestion-").concat(i),className:"im-c-search-suggestions__item",role:"option","aria-selected":n.selectedIndex===i,"aria-setsize":n.suggestions.length,"aria-posinset":i+1,onClick:()=>r(e),children:(0,o.Y)("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:e.marked}})},e.id))})};function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var g=(e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==n.breakpoint&&(null==e?void 0:e.width)&&{width:e.width}),_=e=>{var{id:t,pluginState:n,pluginConfig:i,appState:a,inputRef:s,events:l,services:u,children:c}=e,{areSuggestionsVisible:d,hasFetchedSuggestions:p,hasSearchError:h,suggestions:m=[]}=n,{noResultsMessage:_,searchErrorMessage:v}=i;(0,r.vJ)(()=>{d&&p&&u.announce(((e,t,n,r)=>{if(t)return n;if(0===e)return r;var o=1===e?"result":"results";return"".concat(e," ").concat(o," available")})(m.length,h,v,_))},[m,p]);var y=["im-c-search-form",i.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),b=d&&p&&(h||!m.length);return(0,o.FD)("form",{id:"".concat(t,"-search-form"),role:"search",className:y,style:g(i,n,a),"aria-controls":"".concat(t,"-viewport"),onSubmit:e=>l.handleSubmit(e,a,n),children:[(0,o.Y)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,o.FD)("div",{className:"im-c-search__input-container".concat(n.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,o.Y)("label",{htmlFor:"".concat(t,"-search"),className:"im-u-visually-hidden",children:i.placeholder}),(0,o.Y)("input",{id:"".concat(t,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":n.suggestionsVisible,"aria-controls":"".concat(t,"-search-suggestions"),"aria-activedescendant":n.selectedIndex>=0?"".concat(t,"-search-suggestion-").concat(n.selectedIndex):void 0,"aria-describedby":n.value?void 0:"".concat(t,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:i.placeholder,name:"".concat(t,"-search"),spellCheck:!1,enterKeyHint:"search",value:n.value,onClick:l.handleInputClick,onChange:l.handleInputChange,onFocus:()=>l.handleInputFocus(a.interfaceType),onBlur:()=>l.handleInputBlur(a.interfaceType),onKeyDown:e=>l.handleInputKeyDown(e,n),ref:s}),(0,o.Y)("span",{id:"".concat(t,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),c]}),b&&(0,o.Y)("div",{className:"im-c-search__status","aria-hidden":"true",children:h?v:_}),(0,o.Y)(f,{id:t,appState:a,pluginState:n,handleSuggestionClick:e=>l.handleSuggestionClick(e,a)})]})},v=e=>{var{defaultExpanded:t,onClick:n,closeIcon:r}=e;return(0,o.Y)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:n,style:t?{display:"none"}:void 0,children:r&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})},y=e=>{var{defaultExpanded:t,submitIcon:n}=e;return(0,o.Y)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:n&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})};let b=" ";class w{static get separator(){return b}static set separator(e){b=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+w.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+w.separator+i+"′"+w.separator+a+"″"}return r}static toLat(e,t,n){const r=w.toDms(w.wrap90(e),t,n);return null===r?"–":r.slice(1)+w.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=w.toDms(w.wrap180(e),t,n);return null===r?"–":r+w.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=w.toDms(w.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=w.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};class E{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new E(t,n,r)}negate(){return new E(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new E(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");if(!(t instanceof E||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof E))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],p=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new E(p[0],p[1],p[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const S={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},k={WGS84:{ellipsoid:S.WGS84}};Object.freeze(S.WGS84),Object.freeze(k.WGS84);class O{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=w.wrap90(Number(e)),this._lon=w.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return S}static get datums(){return k}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:S.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new P((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof O))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${w.toLat(this.lat,e,t)}, ${w.toLon(this.lon,e,t)}${null==n?"":r}`}}class P extends E{constructor(e,t,n){super(e,t,n)}toLatLon(e=S.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),p=d/c,h=isNaN(p)?0:Math.atan2(r+l*i*d*d*d,u-s*o*p*p*p),f=Math.atan2(n,t),m=Math.sin(h),g=u*Math.cos(h)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new O(h.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const A={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},N={ED50:{ellipsoid:A.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:A.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:A.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:A.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:A.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:A.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:A.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:A.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:A.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:A.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:A.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(A).forEach(e=>Object.freeze(A[e])),Object.keys(N).forEach(e=>{Object.freeze(N[e]),Object.freeze(N[e].transform)});class T extends O{constructor(e,t,n=0,r=N.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return A}static get datums(){return N}static parse(...e){let t=N.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new x(e.x,e.y,e.z,this.datum)}}class x extends P{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||N.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new T(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=N.WGS84||(t=this,n=e.transform),e==N.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(N.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new x(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const M={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:T.ellipsoids.Airy1830};class L{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=T.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-1e5,l=M.scaleFactor,u=1-o*o/(r*r),c=(r-o)/(r+o),d=c*c,p=c*c*c;let h=i,f=0;do{h=(n-s-f)/(r*l)+h,f=o*l*((1+c+5/4*d+5/4*p)*(h-i)-(3*c+3*c*c+21/8*p)*Math.sin(h-i)*Math.cos(h+i)+(15/8*d+15/8*p)*Math.sin(2*(h-i))*Math.cos(2*(h+i))-35/24*p*Math.sin(3*(h-i))*Math.cos(3*(h+i)))}while(Math.abs(n-s-f)>=1e-5);const m=Math.cos(h),g=Math.sin(h),_=r*l/Math.sqrt(1-u*g*g),v=r*l*(1-u)/Math.pow(1-u*g*g,1.5),y=_/v-1,b=Math.tan(h),w=b*b,E=w*w,S=1/m,k=_*_*_,O=k*_*_,P=t-4e5,A=P*P,N=A*P,x=A*A,L=N*A;h=h-b/(2*v*_)*A+b/(24*v*k)*(5+3*w+y-9*w*y)*x-b/(720*v*O)*(61+90*w+45*E)*(x*A);const C=a+S/_*P-S/(6*k)*(_/v+2*w)*N+S/(120*O)*(5+28*w+24*E)*L-S/(O*_*_*5040)*(61+662*w+1320*E+E*w*720)*(L*A);let D=new $(h.toDegrees(),C.toDegrees(),0,T.datums.OSGB36);return e!=T.datums.OSGB36&&(D=D.convertDatum(e),D=new $(D.lat,D.lon,D.height,D.datum)),D}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new L(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new L(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class $ extends T{toOsGrid(){const e=this.datum==T.datums.OSGB36?this:this.convertDatum(T.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=M.scaleFactor,l=1-o*o/(r*r),u=(r-o)/(r+o),c=u*u,d=u*u*u,p=Math.cos(t),h=Math.sin(t),f=r*s/Math.sqrt(1-l*h*h),m=r*s*(1-l)/Math.pow(1-l*h*h,1.5),g=f/m-1,_=o*s*((1+u+5/4*c+5/4*d)*(t-i)-(3*u+3*u*u+21/8*d)*Math.sin(t-i)*Math.cos(t+i)+(15/8*c+15/8*d)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*d*Math.sin(3*(t-i))*Math.cos(3*(t+i))),v=p*p*p,y=v*p*p,b=Math.tan(t)*Math.tan(t),w=b*b,E=n-a,S=E*E,k=S*E,O=k*E,P=O*E;let A=_+-1e5+f/2*h*p*S+f/24*h*v*(5-b+9*g)*O+f/720*h*y*(61-58*b+w)*(P*E),N=4e5+f*p*E+f/6*v*(f/m-b)*k+f/120*y*(5-18*b+w+14*g-58*b*g)*P;A=Number(A.toFixed(3)),N=Number(N.toFixed(3));try{return new L(N,A)}catch(t){throw new Error(`${t.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new $(t.lat,t.lon,t.height,t.datum)}}var C;function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var R,F=500,I=e=>{var t=e.GAZETTEER_ENTRY,n="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=n,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},B=(e,t)=>{var n,r,o,i,{MBR_XMIN:a,MBR_YMIN:s,MBR_XMAX:l,MBR_YMAX:u,GEOMETRY_X:c,GEOMETRY_Y:d}=t;if(null==a?(n=c-F,r=d-F,o=c+F,i=d+F):(n=a,r=s,o=l,i=u),"EPSG:27700"===e)return[n,r,o,i];if("EPSG:4326"===e){var p=new L(n,r).toLatLon(),h=new L(o,i).toLatLon();return[p.lon,p.lat,h.lon,h.lat].map(e=>Math.round(1e6*e)/1e6)}throw new Error("Unsupported CRS: ".concat(e))},G=(e,t)=>{var{GEOMETRY_X:n,GEOMETRY_Y:r}=t;if("EPSG:27700"===e)return[n,r];if("EPSG:4326"===e){var o=new L(n,r).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},W=function(e,t,n,r){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!e||e.error||0===(null===(o=e.header)||void 0===o?void 0:o.totalresults))return[];var a=e.results;return a=((e,t)=>{var n=t.toLowerCase().replace(/,/g,"").split(" ");return e.map(I).filter(e=>n.some(n=>{return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(n)||(r=(r=t).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(r));var r}))})(a,t),a=((e,t)=>e.filter(e=>{var n,r=null==e||null===(n=e.GAZETTEER_ENTRY)||void 0===n||null===(n=n.COUNTRY)||void 0===n?void 0:n.toLowerCase();return r&&t.includes(r)}))(a=(e=>Array.from(new Map(e.map(e=>[e.GAZETTEER_ENTRY.ID,e])).values()))(a),n),(a=a.slice(0,i)).map(e=>j(j({id:e.GAZETTEER_ENTRY.ID,bounds:B(r,e.GAZETTEER_ENTRY),point:G(r,e.GAZETTEER_ENTRY)},((e,t)=>{var n,r,o,i,{NAME1:a,COUNTY_UNITARY:l,DISTRICT_BOROUGH:u,POSTCODE_DISTRICT:c,LOCAL_TYPE:d}=t,p="".concat(["City","Postcode"].includes(d)?"":c+", ").concat("City"===d?"":l||u),h="".concat(a).concat(p?", "+p:"");return{text:h,marked:(n=h,r=e,o=r.replace(/\s+/g,"").split("").join(String.raw(C||(C=s(["s*"],["\\s*"])))),i=new RegExp("(".concat(o,")"),"i"),n.replace(i,"<mark>$1</mark>"))}})(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"}))},U=e=>{var{url:t,options:n}=e;return new Request(t,n)},H=(R=(0,l.A)(function*(e,t,n){var r,o={url:null===(r=e.urlTemplate)||void 0===r?void 0:r.replace("{query}",encodeURIComponent(t)),options:{method:"GET"}};if(e.buildRequest){var i=e.buildRequest(t,()=>o);return i instanceof Request?i:U(i)}return U(n?yield n(o,t):o)}),function(e,t,n){return R.apply(this,arguments)}),V=function(){var e=(0,l.A)(function*(e,t,n){try{var r=yield fetch(t);if(!r.ok)return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(r.status)),{error:!0};var o=yield r.json();return e.parseResults(o,n)}catch(t){return console.error("Network error for ".concat(e.label||"dataset",":"),t),{error:!0}}});return function(t,n,r){return e.apply(this,arguments)}}(),z=function(){var e=(0,l.A)(function*(e,t,n,r){var o=(e=>e.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim())(e),i=t.filter(t=>{var n=!t.includeRegex||t.includeRegex.test(e),r=!!t.excludeRegex&&t.excludeRegex.test(o);return n&&!r}),a=[],s=!1;for(var l of i){var u=yield H(l,o,r),c=yield V(l,u,o);if(null!=c&&c.error?s=!0:null!=c&&c.length&&(a=[...a,...c]),l.exclusive&&a.length)break}return n({type:"UPDATE_SUGGESTIONS",payload:{results:a,hasError:s}}),{results:a,sanitisedValue:o}});return function(t,n,r,o){return e.apply(this,arguments)}}();function q(e){var{mapProvider:t,bounds:n,point:r,markers:o,showMarker:i,markerOptions:a}=e;t.fitToBounds(n),i&&o.add("search",r,a)}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e){var t,n,r,{dispatch:o,searchContainerRef:a}=e,s=(t=t=>z(t,e.datasets,o,e.transformRequest),n=null,r=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout(()=>{t(...r)},350)},r.cancel=()=>{n&&(clearTimeout(n),n=null)},r),c=(e=>{var{dispatch:t,services:n,viewportRef:r,mapProvider:o,markers:i,datasets:a,transformRequest:s,showMarker:c,markerOptions:d}=e,p="";return{handleOpenClick(){t({type:"TOGGLE_EXPANDED",payload:!0}),n.eventBus.emit("search:open")},handleCloseClick(e,r){t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),t({type:"SET_VALUE",payload:""}),setTimeout(()=>r.current.focus(),0),i.remove("search"),n.eventBus.emit("search:clear"),n.eventBus.emit("search:close")},handleSubmit:(e,h,f)=>(0,l.A)(function*(){e.preventDefault();var{suggestions:l,selectedIndex:m,value:g}=f,_=null==g?void 0:g.trim();if(t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),m>=0){var v,y=l[m];return t({type:"SET_VALUE",payload:y.text}),null===(v=r.current)||void 0===v||v.focus(),q({mapProvider:o,bounds:y.bounds,point:y.point,markers:i,showMarker:c,markerOptions:d}),void n.eventBus.emit("search:match",K({query:y.text},y))}if(!((null==_?void 0:_.length)<u.minSearchLength)){var b=l;if(!l.length||_!==p){var{results:w,sanitisedValue:E}=yield z(_,a,t,s);b=w,p=E}if(b.length){var S;null===(S=r.current)||void 0===S||S.focus(),"mobile"===h.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close"));var k=b[0];q({mapProvider:o,bounds:k.bounds,point:k.point,markers:i,showMarker:c,markerOptions:d}),n.eventBus.emit("search:match",K({query:g},k))}}})()}})(e),d=(e=>{var{dispatch:t,debouncedFetchSuggestions:n}=e;return{handleInputClick(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange(e){var r=e.target.value;if(t({type:"SET_VALUE",payload:r}),r.length<u.minSearchLength)return n.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),n(r)}}})(J(J({},e),{},{debouncedFetchSuggestions:s})),p=(e=>{var{dispatch:t,services:n,mapProvider:r,markers:o,showMarker:a,markerOptions:s,viewportRef:l}=e,u=(e,t)=>{var n;return t>=0?"".concat(null===(n=e[t])||void 0===n?void 0:n.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick(e,u){var c;t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===u.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close")),null===(c=l.current)||void 0===c||c.focus(),q({mapProvider:r,bounds:e.bounds,point:e.point,markers:o,showMarker:a,markerOptions:s}),n.eventBus.emit("search:match",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({query:e.text},e))},handleInputKeyDown(e,r){var{suggestions:o,selectedIndex:i}=r;switch(e.key){case"ArrowDown":if(null==o||!o.length)return;if(e.preventDefault(),i<o.length-1){var a=i+1;n.announce(u(o,a)),t({type:"SET_SELECTED",payload:a}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;e.preventDefault();var s=i>0?i-1:-1;n.announce(u(o,s)),t({type:"SET_SELECTED",payload:s}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:s<0});break;case"Escape":e.preventDefault(),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}})(e);return J(J(J(J({},c),d),p),{},{handleOutside(t){a.current.contains(t.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var ee=["marker"];function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var ne={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:p},controls:[{id:"search",mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1},render:function(e){var t,{appConfig:n,iconRegistry:s,pluginState:l,pluginConfig:u,appState:c,mapState:d,services:p,mapProvider:f}=e,{id:m}=n,{interfaceType:g}=c,{expanded:b,customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k}=u,{dispatch:O,isExpanded:P,areSuggestionsVisible:A,suggestions:N}=l,T=(null==c||null===(t=c.controlConfig)||void 0===t||null===(t=t.search)||void 0===t?void 0:t[null==c?void 0:c.breakpoint].showLabel)||!1,x=s.close,M=s.search,L=(0,r.li)(null),$=(0,r.li)(null),C=(0,r.li)(null),D=c.layoutRefs.viewportRef,j=function(e){var{customDatasets:t=[],osNamesURL:n,crs:r,regions:o=["england","scotland","wales"],maxSuggestions:i}=e;return n?[{name:"osNames",urlTemplate:n,parseResults:(e,t)=>W(e,t,o,r,i),includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i},...t]:t}({customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k,crs:f.crs}),R=(0,r.li)(null);if(!R.current){var{marker:F}=u,I=(0,a.A)(u,ee);R.current=Q(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({dispatch:O,datasets:j,services:p,mapProvider:f,viewportRef:D,searchContainerRef:L,markers:d.markers,markerOptions:F},I))}var B=R.current,G=P||!!(b&&A&&N.length);return(0,r.vJ)(()=>{var e;P&&(null===(e=C.current)||void 0===e||e.focus())},[P]),(0,r.vJ)(()=>{if(c.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:P}),G)return D.current.style.pointerEvents="none",document.addEventListener("focusin",B.handleOutside),document.addEventListener("pointerdown",B.handleOutside),()=>{D.current.style.pointerEvents="auto",document.removeEventListener("focusin",B.handleOutside),document.removeEventListener("pointerdown",B.handleOutside)}},[P,g,A,N]),(0,o.FD)("div",{className:"im-c-search",ref:L,children:[!b&&(0,o.Y)(h,{id:m,isExpanded:P,onClick:()=>B.handleOpenClick(c),buttonRef:$,searchIcon:M,showLabel:T}),(0,o.FD)(_,{id:m,pluginState:l,pluginConfig:u,appState:c,inputRef:C,events:B,services:p,children:[(0,o.Y)(v,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,$,c),closeIcon:x}),(0,o.Y)(y,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,$,c),submitIcon:M})]})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]},re=Object.freeze({__proto__:null,manifest:ne})}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e].call(n.exports,n,n.exports,i),n.exports}function a(e){const t=e.currentTarget;if("true"===t.dataset.debouncing)return e.preventDefault(),void e.stopImmediatePropagation();t.dataset.debouncing="true",setTimeout(()=>{delete t.dataset.debouncing},1e4)}function s(e){a(e)}function l(e){"Enter"!==e.key&&" "!==e.key||a(e)}i.m=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"javascripts/"+{7:"vendor/accessible-autocomplete",264:"vendor/maplibre-gl",402:"vendor/@defra",935:"im-core"}[e]+".min.js",i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i.l=(e,t,r,o)=>{if(n[e])n[e].push(t);else{var a,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==e){a=c;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.src=e),n[e]=[t];var d=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={804:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var a=i.p+i.u(t),s=new Error;i.l(a,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,a=n[0],s=n[1],l=n[2],u=0;if(a.some(t=>0!==e[t])){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);l&&l(i)}for(t&&t(n);u<a.length;u++)o=a[u],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();const u="aria-describedby",c="error-summary-title";function d(e,t,n){var r;const o=document.getElementById("uploadedFilesContainer"),i=o?o.closest("form"):null;if(!(i&&i instanceof HTMLFormElement))return;const a=i.querySelector("p.govuk-body");if(!a)return;const s=function(e,t){let n=null==e?void 0:e.querySelector("#statusInformation");if(!n){n=document.createElement("div"),n.id="statusInformation",n.className="govuk-visually-hidden",n.setAttribute("aria-live","polite");try{!function(e,t,n){var r;null!=t&&t.nextSibling&&t.parentNode===e?e.insertBefore(n,t.nextSibling):(null!=(r=null==t?void 0:t.parentNode)?r:e).appendChild(n)}(e,t,n)}catch(r){try{null==e||e.appendChild(n)}catch(o){document.body.appendChild(n)}}}return n}(i,a),l=n.querySelector('input[type="file"]');l&&l.setAttribute(u,"statusInformation");const c=function(e,t){let n=e.querySelector("dl.govuk-summary-list");if(!n){n=document.createElement("dl"),n.className="govuk-summary-list govuk-summary-list--long-key";const r=e.querySelector(".govuk-button-group");r?e.insertBefore(n,r):e.insertBefore(n,t.nextSibling)}return n}(i,a),d=document.querySelector(`[data-filename="${null==e?void 0:e.name}"]`);d&&d.remove();const p=function(e,t){var n,r;const o=document.createElement("div");return o.className="govuk-summary-list__row",o.setAttribute("data-filename",null!=(n=null==e?void 0:e.name)?n:""),o.innerHTML=`\n <dt class="govuk-summary-list__key">\n ${null!=(r=null==e?void 0:e.name)?r:""}\n </dt>\n <dd class="govuk-summary-list__value">\n <strong class="govuk-tag govuk-tag--yellow">${t}</strong>\n </dd>\n <dd class="govuk-summary-list__actions">\n </dd>\n `,o}(e,t);c.insertBefore(p,c.firstChild),s.textContent=`${null!=(r=null==e?void 0:e.name)?r:""} ${t}`}function p(e,t,n){if(document.querySelector(".govuk-error-summary"))return void(document.getElementById(c)?n.setAttribute(u,c):n.removeAttribute(u));t&&(t.innerHTML=`\n <div class="govuk-error-summary" data-module="govuk-error-summary">\n <div role="alert">\n <h2 class="govuk-error-summary__title" id="${c}">\n There is a problem\n </h2>\n <div class="govuk-error-summary__body">\n <ul class="govuk-list govuk-error-summary__list">\n <li>\n <a href="#file-upload">${e}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n `,n.setAttribute(u,c));const r=n.closest(".govuk-form-group");if(r){r.classList.add("govuk-form-group--error"),n.classList.add("govuk-file-upload--error");const t=n.id;let o=document.getElementById(`${t}-error`);o||(o=document.createElement("p"),o.id=`${t}-error`,o.className="govuk-error-message",o.innerHTML=`<span class="govuk-visually-hidden">Error:</span> ${e}`,r.insertBefore(o,n)),n.setAttribute(u,`error-summary-title ${t}-error`)}}function h(){window.history.replaceState(null,"",window.location.href),window.location.href=window.location.pathname}function f(){var e,t,n;const r=document.querySelector('form:has(input[type="file"])'),o=r?r.querySelector('input[type="file"]'):null,i=r?r.querySelector(".upload-file-button"):null,a=null!=(e=Array.from(document.querySelectorAll("button.govuk-button")).find(e=>"Continue"===e.textContent.trim()))?e:null,s=document.querySelector(".govuk-error-summary-container");if(!r||!o||!i)return;const l=null!=(t=null==(n=document.getElementById("uploadedFilesContainer"))?void 0:n.dataset.uploadinglabel)?t:"Uploading…",u=r;let c=[],f=!1;const m=u.dataset.uploadId;o.addEventListener("change",()=>{s&&(s.innerHTML=""),o.files&&o.files.length>0&&(c=Array.from(o.files),i.click())}),i.addEventListener("click",e=>{if(0===c.length)return e.preventDefault(),void p("Select a file",s,o);f?e.preventDefault():(f=!0,function(e,t,n,r,o,i){for(let a=o.length-1;a>=0;a--)d(o[a],i,e);t.focus(),setTimeout(()=>{t.disabled=!0,n.disabled=!0,r.disabled=!0},100)}(u,o,i,a,c,l),function(e,t,n,r,o,i){var a;if(!t.action||!i)return!1;e.preventDefault();const s=new FormData(t),l=!!t.dataset.proxyUrl,u=null!=(a=t.dataset.proxyUrl)?a:t.action,c={method:"POST",body:s,redirect:l?"follow":"manual"};l&&(c.mode="no-cors"),fetch(u,c).then(()=>{!function(e){let t=0;const n=setInterval(()=>{if(t++,t>=300)return clearInterval(n),void h();const r=function(e,t){const n=e.replace(/\/preview\/(draft|live)/g,"").replace(/\/{2,}/g,"/").replace(/\/$/,"").split("/").filter(Boolean);return`${n.length>2?`/${n.slice(0,n.length-2).join("/")}`:""}/upload-status/${t}`}(window.location.pathname,e);fetch(r,{headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>{"ready"===e.uploadStatus&&(clearInterval(n),h())}).catch(()=>{clearInterval(n),h()})},1e3)}(i)}).catch(()=>(n.disabled=!1,r.disabled=!1,p("There was a problem uploading the file",o,n),null))}(e,u,o,i,s,m))})}function m(e,t={}){var n;const r=e.getAttribute("tabindex");function o(){var n;null==(n=t.onBlur)||n.call(e),r||e.removeAttribute("tabindex")}r||e.setAttribute("tabindex","-1"),e.addEventListener("focus",function(){e.addEventListener("blur",o,{once:!0})},{once:!0}),null==(n=t.onBeforeFocus)||n.call(e),e.focus()}function g(e=document.body){return!!e&&e.classList.contains("govuk-frontend-supported")}function _(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function v(e){return!!e&&(e instanceof Element||e instanceof Document)}function y(e,t){return`${e.moduleName}: ${t}`}class b extends Error{constructor(...e){super(...e),this.name="GOVUKFrontendError"}}class w extends b{constructor(e=document.body){const t="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(e?t:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class E extends b{constructor(...e){super(...e),this.name="ConfigError"}}class S extends b{constructor(e){let t="string"==typeof e?e:"";if(_(e)){const{component:n,identifier:r,element:o,expectedType:i}=e;t=r,t+=o?` is not of type ${null!=i?i:"HTMLElement"}`:" not found",n&&(t=y(n,t))}super(t),this.name="ElementError"}}class k extends b{constructor(e){super("string"==typeof e?e:y(e,"Root element (`$root`) already initialised")),this.name="InitError"}}class O{get $root(){return this._$root}constructor(e){this._$root=void 0;const t=this.constructor;if("string"!=typeof t.moduleName)throw new k("`moduleName` not defined in component");if(!(e instanceof t.elementType))throw new S({element:e,component:t,identifier:"Root element (`$root`)",expectedType:t.elementType.name});this._$root=e,t.checkSupport(),this.checkInitialised();const n=t.moduleName;this.$root.setAttribute(`data-${n}-init`,"")}checkInitialised(){const e=this.constructor,t=e.moduleName;if(t&&function(e,t){return e instanceof HTMLElement&&e.hasAttribute(`data-${t}-init`)}(this.$root,t))throw new k(e)}static checkSupport(){if(!g())throw new w}}O.elementType=HTMLElement;const P=Symbol.for("configOverride");class A extends O{[P](e){return{}}get config(){return this._config}constructor(e,t){super(e),this._config=void 0;const n=this.constructor;if(!_(n.defaults))throw new E(y(n,"Config passed as parameter into constructor but no defaults defined"));const r=function(e,t){if(!_(e.schema))throw new E(y(e,"Config passed as parameter into constructor but no schema defined"));const n={},r=Object.entries(e.schema.properties);for(const o of r){const[r,i]=o,a=r.toString();a in t&&(n[a]=N(t[a],i)),"object"===(null==i?void 0:i.type)&&(n[a]=x(e.schema,t,r))}return n}(n,this._$root.dataset);this._config=T(n.defaults,null!=t?t:{},this[P](r),r)}}function N(e,t){const n=e?e.trim():"";let r,o=null==t?void 0:t.type;switch(o||(["true","false"].includes(n)&&(o="boolean"),n.length>0&&isFinite(Number(n))&&(o="number")),o){case"boolean":r="true"===n;break;case"number":r=Number(n);break;default:r=e}return r}function T(...e){const t={};for(const n of e)for(const e of Object.keys(n)){const r=t[e],o=n[e];_(r)&&_(o)?t[e]=T(r,o):t[e]=o}return t}function x(e,t,n){const r=e.properties[n];if("object"!==(null==r?void 0:r.type))return;const o={[n]:{}};for(const[i,a]of Object.entries(t)){let e=o;const t=i.split(".");for(const[r,o]of t.entries())_(e)&&(r<t.length-1?(_(e[o])||(e[o]={}),e=e[o]):i!==n&&(e[o]=N(a)))}return o[n]}function M(e,t,n){let r;const o=function(e){let t,n=document;if(_(e)){const r=e;(v(r.scope)||null===r.scope)&&(n=r.scope),"function"==typeof r.onError&&(t=r.onError)}return v(e)?n=e:null===e?n=null:"function"==typeof e&&(t=e),{scope:n,onError:t}}(n);try{var i;if(!g())throw new w;if(null===o.scope)throw new S({element:o.scope,component:e,identifier:"Scope element (`$scope`)"});r=null==(i=o.scope)?void 0:i.querySelectorAll(`[data-module="${e.moduleName}"]`)}catch(a){return o.onError?o.onError(a,{component:e,config:t}):console.log(a),[]}return Array.from(null!=r?r:[]).map(n=>{try{return void 0!==t?new e(n,t):new e(n)}catch(a){return o.onError?o.onError(a,{element:n,component:e,config:t}):console.log(a),null}}).filter(Boolean)}class L extends A{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",e=>this.handleKeyDown(e)),this.$root.addEventListener("click",e=>this.debounce(e))}handleKeyDown(e){const t=e.target;" "===e.key&&t instanceof HTMLElement&&"button"===t.getAttribute("role")&&(e.preventDefault(),t.click())}debounce(e){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout(()=>{this.debounceFormSubmitTimer=null},1e3))}}function $(e,t){const n=e.closest(`[${t}]`);return n?n.getAttribute(t):null}L.moduleName="govuk-button",L.defaults=Object.freeze({preventDoubleClick:!1}),L.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class C{constructor(e={},t={}){var n;this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(n=t.locale)?n:document.documentElement.lang||"en"}t(e,t){if(!e)throw new Error("i18n: lookup key missing");let n=this.translations[e];if("number"==typeof(null==t?void 0:t.count)&&_(n)){const r=n[this.getPluralSuffix(e,t.count)];r&&(n=r)}if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!t)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,t)}return n}return e}replacePlaceholders(e,t){const n=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,function(e,r){if(Object.prototype.hasOwnProperty.call(t,r)){const e=t[r];return!1===e||"number"!=typeof e&&"string"!=typeof e?"":"number"==typeof e?n?n.format(e):`${e}`:e}throw new Error(`i18n: no data found to replace ${e} placeholder in string`)})}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(e,t){if(t=Number(t),!isFinite(t))return"other";const n=this.translations[e],r=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(t):"other";if(_(n)){if(r in n)return r;if("other"in n)return console.warn(`i18n: Missing plural form ".${r}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class D extends A{[P](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var n,r;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const o=this.$root.querySelector(".govuk-js-character-count");if(!(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement))throw new S({component:D,element:o,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const i=function(e,t){const n=[];for(const[r,o]of Object.entries(e)){const e=[];if(Array.isArray(o)){for(const{required:n,errorMessage:r}of o)n.every(e=>!!t[e])||e.push(r);"anyOf"!==r||o.length-e.length>=1||n.push(...e)}}return n}(D.schema,this.config);if(i[0])throw new E(y(D,i[0]));this.i18n=new C(this.config.i18n,{locale:$(this.$root,"lang")}),this.maxLength=null!=(n=null!=(r=this.config.maxwords)?r:this.config.maxlength)?n:1/0,this.$textarea=o;const a=`${this.$textarea.id}-info`,s=document.getElementById(a);if(!s)throw new S({component:D,element:s,identifier:`Count message (\`id="${a}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),s.textContent.match(/^\s*$/)&&(s.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",s);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,s.insertAdjacentElement("afterend",l);const u=document.createElement("div");u.className=s.className,u.classList.add("govuk-character-count__status"),u.setAttribute("aria-hidden","true"),this.$visibleCountMessage=u,s.insertAdjacentElement("afterend",u),s.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",()=>this.updateCountMessage()),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",()=>this.handleKeyUp()),this.$textarea.addEventListener("focus",()=>this.handleFocus()),this.$textarea.addEventListener("blur",()=>this.handleBlur())}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval(()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()},1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){var t;return this.config.maxwords?(null!=(t=e.match(/\S+/g))?t:[]).length:e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}D.moduleName="govuk-character-count",D.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),D.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class j extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="checkbox"]');if(!t.length)throw new S({component:j,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:j,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-checkboxes__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!t)}}unCheckAllInputsExcept(e){document.querySelectorAll(`input[type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&t!==e&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}unCheckExclusiveInputs(e){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}handleClick(e){const t=e.target;t instanceof HTMLInputElement&&"checkbox"===t.type&&(t.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(t),t.checked&&("exclusive"===t.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(t):this.unCheckExclusiveInputs(t)))}}j.moduleName="govuk-checkboxes";class R extends A{constructor(e,t={}){super(e,t),this.config.disableAutoFocus||m(this.$root),this.$root.addEventListener("click",e=>this.handleClick(e))}handleClick(e){const t=e.target;t&&this.focusTarget(t)&&e.preventDefault()}focusTarget(e){if(!(e instanceof HTMLAnchorElement))return!1;const t=e.hash.replace("#","");if(!t)return!1;const n=document.getElementById(t);if(!n)return!1;const r=this.getAssociatedLegendOrLabel(n);return!!r&&(r.scrollIntoView(),n.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(e){var t;const n=e.closest("fieldset");if(n){const t=n.getElementsByTagName("legend");if(t.length){const n=t[0];if(e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type))return n;const r=n.getBoundingClientRect().top,o=e.getBoundingClientRect();if(o.height&&window.innerHeight&&o.top+o.height-r<window.innerHeight/2)return n}}return null!=(t=document.querySelector(`label[for='${e.getAttribute("id")}']`))?t:e.closest("label")}}R.moduleName="govuk-error-summary",R.defaults=Object.freeze({disableAutoFocus:!1}),R.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class F extends O{constructor(e){super(e),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const t=this.$root.querySelector(".govuk-js-header-toggle");if(!t)return this;this.$root.classList.add("govuk-header--with-js-navigation");const n=t.getAttribute("aria-controls");if(!n)throw new S({component:F,identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const r=document.getElementById(n);if(!r)throw new S({component:F,element:r,identifier:`Navigation (\`<ul id="${n}">\`)`});this.$menu=r,this.$menuButton=t,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",()=>this.handleMenuButtonClick())}setupResponsiveChecks(){const e=function(){const e="--govuk-breakpoint-desktop";return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}();if(!e.value)throw new S({component:F,identifier:`CSS custom property (\`${e.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${e.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",()=>this.checkMode()):this.mql.addListener(()=>this.checkMode()),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}F.moduleName="govuk-header";class I extends A{constructor(e,t={}){super(e,t),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const n=this.$root.querySelector("input");if(null===n)throw new S({component:I,identifier:'File inputs (`<input type="file">`)'});if("file"!==n.type)throw new S(y(I,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(this.$input=n,!this.$input.id)throw new S({component:I,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new C(this.config.i18n,{locale:$(this.$root,"lang")});const r=this.findLabel();r.id||(r.id=`${this.id}-label`),this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","true");const o=document.createElement("button");o.classList.add("govuk-file-upload-button"),o.type="button",o.id=this.id,o.classList.add("govuk-file-upload-button--empty");const i=this.$input.getAttribute("aria-describedby");i&&o.setAttribute("aria-describedby",i);const a=document.createElement("span");a.className="govuk-body govuk-file-upload-button__status",a.setAttribute("aria-live","polite"),a.innerText=this.i18n.t("noFileChosen"),o.appendChild(a);const s=document.createElement("span");s.className="govuk-visually-hidden",s.innerText=", ",s.id=`${this.id}-comma`,o.appendChild(s);const l=document.createElement("span");l.className="govuk-file-upload-button__pseudo-button-container";const u=document.createElement("span");u.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",u.innerText=this.i18n.t("chooseFilesButton"),l.appendChild(u),l.insertAdjacentText("beforeend"," ");const c=document.createElement("span");c.className="govuk-body govuk-file-upload-button__instruction",c.innerText=this.i18n.t("dropInstruction"),l.appendChild(c),o.appendChild(l),o.setAttribute("aria-labelledby",`${r.id} ${s.id} ${o.id}`),o.addEventListener("click",this.onClick.bind(this)),o.addEventListener("dragover",e=>{e.preventDefault()}),this.$root.insertAdjacentElement("afterbegin",o),this.$input.setAttribute("tabindex","-1"),this.$input.setAttribute("aria-hidden","true"),this.$button=o,this.$status=a,this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",()=>{this.enteredAnotherElement=!0}),document.addEventListener("dragleave",()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1})}updateDropzoneVisibility(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(e){return this.matchesInputCapacity(e.files.length)}canDrop(e){return e.items.length?this.matchesInputCapacity(function(e){let t=0;for(let n=0;n<e.length;n++)"file"===e[n].kind&&t++;return t}(e.items)):!e.types.length||e.types.includes("Files")}matchesInputCapacity(e){return this.$input.multiple?e>0:1===e}onChange(){const e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const e=document.querySelector(`label[for="${this.$input.id}"]`);if(!e)throw new S({component:I,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return e}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver(e=>{for(const t of e)"attributes"===t.type&&"disabled"===t.attributeName&&this.updateDisabledState()}).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)}}I.moduleName="govuk-file-upload",I.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),I.schema=Object.freeze({properties:{i18n:{type:"object"}}});class B extends A{constructor(e,t={}){super(e,t),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||m(this.$root)}}B.moduleName="govuk-notification-banner",B.defaults=Object.freeze({disableAutoFocus:!1}),B.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class G extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="radio"]');if(!t.length)throw new S({component:G,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:G,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-radios__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!t)}}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"radio"!==t.type)return;const n=document.querySelectorAll('input[type="radio"][aria-controls]'),r=t.form,o=t.name;n.forEach(e=>{const t=e.form===r;e.name===o&&t&&this.syncConditionalRevealWithInputState(e)})}}G.moduleName="govuk-radios";class W extends O{constructor(e){var t;super(e);const n=this.$root.hash,r=null!=(t=this.$root.getAttribute("href"))?t:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const o=n.replace("#","");if(!o)throw new S(`Skip link: Target link (\`href="${r}"\`) has no hash fragment`);const i=document.getElementById(o);if(!i)throw new S({component:W,element:i,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",()=>m(i,{onBeforeFocus(){i.classList.add("govuk-skip-link-focused-element")},onBlur(){i.classList.remove("govuk-skip-link-focused-element")}}))}}W.elementType=HTMLAnchorElement,W.moduleName="govuk-skip-link";var U=i(944);const H=function(){M(L),M(D),M(j),M(R),M(F),M(I),M(B),M(G),M(W)},V=function(){const e=document.querySelectorAll('[data-module="govuk-accessible-autocomplete"]');e.length&&i.e(7).then(i.t.bind(i,60,19)).then(t=>{const{default:n}=t;e.forEach(e=>function(e,t){if(!e)return;const n={id:e.id,selectElement:e};t(n);const r=document.querySelector(`#${n.id}`),o=[...e.options].map(e=>e.text);null==r||r.addEventListener("blur",()=>{r.value&&o.includes(r.value)||(e.value="")})}(e.querySelector("select"),n.enhanceSelectElement))}).catch(console.error)},z=function(){const e=document.querySelectorAll(".prevent-multiple-clicks");for(const t of e)t.addEventListener("click",s),t.addEventListener("keydown",l)},q=function(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()},Y=function(){if(window.opener){const e=document.querySelector(".js-preview-banner-close");null==e||e.removeAttribute("hidden"),null==e||e.addEventListener("click",e=>{e.preventDefault(),window.close()})}};function K(){H(),V(),z(),q(),Y()}export{K as initAll,V as initAllAutocomplete,H as initAllGovuk,z as initDebounceClick,q as initFileUpload,Y as initPreviewCloseLink};export const geospatialMap=U.g5;export const initMaps=U.Yv;export const locationMap=U.g$;export const map=U.Tj;export const sssiDataset=U.zp;
|
|
2
|
+
var e,t,n,r={452:(e,t,n)=>{n.d(t,{Ob:()=>Te,q6:()=>s.q6,d5:()=>ae,Ay:()=>Me,Rf:()=>z,Qv:()=>fe,XX:()=>pe,xJ:()=>Ne,hb:()=>S,NT:()=>T,vJ:()=>b,Nf:()=>w,Kr:()=>A,WO:()=>y,li:()=>E,J0:()=>_});var r,o,i,a,s=n(126),l=0,u=[],c=s.fF,d=c.__b,h=c.__r,p=c.diffed,f=c.__c,m=c.unmount,v=c.__;function g(e,t){c.__h&&c.__h(o,e,l||t),l=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function _(e){return l=1,y(I,e)}function y(e,t,n){var i=g(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):I(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var o=i.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,n)||o};o.__f=!0;var s=o.shouldComponentUpdate,l=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}l&&l.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=g(r++,3);!c.__s&&$(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=g(r++,4);!c.__s&&$(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function E(e){return l=5,A(function(){return{current:e}},[])}function k(e,t,n){l=6,w(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function A(e,t){var n=g(r++,7);return $(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return l=8,A(function(){return e},t)}function T(e){var t=o.context[e.__c],n=g(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function N(e,t){c.useDebugValue&&c.useDebugValue(t?t(e):e)}function x(){var e=g(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function P(){for(var e;e=u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(C),t.__h.some(O),t.__h=[]}catch(o){t.__h=[],c.__e(o,e.__v)}}}c.__b=function(e){o=null,d&&d(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(e){h&&h(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(C),t.__h.some(O),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&a===c.requestAnimationFrame||((a=c.requestAnimationFrame)||L)(P)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),i=o=null},c.__c=function(e,t){t.some(function(e){try{e.__h.some(C),e.__h=e.__h.filter(function(e){return!e.__||O(e)})}catch(o){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(o,e.__v)}}),f&&f(e,t)},c.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{C(e)}catch(e){t=e}}),n.__H=void 0,t&&c.__e(t,n.__v))};var M="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),M&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);M&&(t=requestAnimationFrame(n))}function C(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function O(e){var t=o;e.__c=e.__(),o=t}function $(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function I(e,t){return"function"==typeof t?t(e):t}function R(e,t){for(var n in t)e[n]=t[n];return e}function D(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function F(e,t){var n=t(),r=_({t:{__:n,u:t}}),o=r[0].t,i=r[1];return w(function(){o.__=n,o.u=t,B(o)&&i({t:o})},[e,n,t]),b(function(){return B(o)&&i({t:o}),e(function(){B(o)&&i({t:o})})},[e]),n}function B(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function G(e){e()}function j(e){return e}function W(){return[!1,G]}var U=w;function H(e,t){this.props=e,this.context=t}(H.prototype=new s.uA).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return D(this.props,e)||D(this.state,t)};var q=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),q&&q(e)};var V="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function z(e){function t(t){var n=R({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=V,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Y=function(e,t){return null==e?null:(0,s.v2)((0,s.v2)(e).map(t))},K={map:Y,forEach:Y,count:function(e){return e?(0,s.v2)(e).length:0},only:function(e){var t=(0,s.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:s.v2},Z=s.fF.__e;s.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var X=s.fF.unmount;function J(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=R({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,n)})),e}function Q(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Q(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function te(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ne(){this.i=null,this.l=null}s.fF.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),X&&X(e)},(ee.prototype=new s.uA).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=te(r.__v),i=!1,a=function(){i||r.__z||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Q(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,s.n)(s.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),o]};var re=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ie(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,s.XX)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,s.XX)((0,s.n)(oe,{context:t.context},e.__v),t.v)}function ae(e,t){var n=(0,s.n)(ie,{__v:e,h:t});return n.containerInfo=t,n}(ne.prototype=new s.uA).__a=function(e){var t=this,n=te(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),re(t,e,r)):o()};n?n(i):i()}},ne.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ne.prototype.componentDidUpdate=ne.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){re(e,n,t)})};var se="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ue=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,de="undefined"!=typeof document,he=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function pe(e,t,n){return null==t.__k&&(t.textContent=""),(0,s.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function fe(e,t,n){return(0,s.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var me=s.fF.event;function ve(){}function ge(){return this.cancelBubble}function _e(){return this.defaultPrevented}s.fF.event=function(e){return me&&(e=me(e)),e.persist=ve,e.isPropagationStopped=ge,e.isDefaultPrevented=_e,e.nativeEvent=e};var ye,be={enumerable:!1,configurable:!0,get:function(){return this.class}},we=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||de&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||he(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":ue.test(i)&&(i=l):l=i="oninput":o&&le.test(i)?i=i.replace(ce,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",be)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=se,we&&we(e)};var Ee=s.fF.__r;s.fF.__r=function(e){Ee&&Ee(e),ye=e.__c};var ke=s.fF.diffed;s.fF.diffed=function(e){ke&&ke(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ye=null};var Ae={ReactCurrentDispatcher:{current:{readContext:function(e){return ye.__n[e.__c].props.value},useCallback:S,useContext:T,useDebugValue:N,useDeferredValue:j,useEffect:b,useId:x,useImperativeHandle:k,useInsertionEffect:U,useLayoutEffect:w,useMemo:A,useReducer:y,useRef:E,useState:_,useSyncExternalStore:F,useTransition:W}}};function Se(e){return!!e&&e.$$typeof===se}function Te(e){return Se(e)?s.Ob.apply(null,arguments):e}function Ne(e){return!!e.__k&&((0,s.XX)(null,e),!0)}var xe=s.FK,Pe=Se,Me={useState:_,useId:x,useReducer:y,useEffect:b,useLayoutEffect:w,useInsertionEffect:U,useTransition:W,useDeferredValue:j,useSyncExternalStore:F,startTransition:G,useRef:E,useImperativeHandle:k,useMemo:A,useCallback:S,useContext:T,useDebugValue:N,version:"18.3.1",Children:K,render:pe,hydrate:fe,unmountComponentAtNode:Ne,createPortal:ae,createElement:s.n,createContext:s.q6,createFactory:function(e){return s.n.bind(null,e)},cloneElement:Te,createRef:s._3,Fragment:s.FK,isValidElement:Se,isElement:Pe,isFragment:function(e){return Se(e)&&e.type===s.FK},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:s.uA,PureComponent:H,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:D(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,s.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r},forwardRef:z,flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:xe,Suspense:ee,SuspenseList:ne,lazy:function(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?(0,s.n)(o,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ae}},126:(e,t,n)=>{n.d(t,{FK:()=>A,Ob:()=>K,Qv:()=>Y,XX:()=>z,_3:()=>k,fF:()=>o,n:()=>w,q6:()=>Z,uA:()=>S,v2:()=>$});var r,o,i,a,s,l,u,c,d,h,p,f,m={},v=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function k(){return{current:null}}function A(e){return e.children}function S(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?T(e):null}function N(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=y({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),B(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?T(t):n,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,j(r,a,i),t.__e=t.__=null,a.__e!=n&&x(a)}}function x(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),x(e)}function P(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!M.__r++||s!=o.debounceRendering)&&((s=o.debounceRendering)||l)(M)}function M(){for(var e,t=1;a.length;)a.length>t&&a.sort(u),e=a.shift(),t=a.length,N(e);M.__r=0}function L(e,t,n,r,o,i,a,s,l,u,c){var d,h,p,f,g,_,y,b=r&&r.__k||v,w=t.length;for(l=C(n,t,b,l,w),d=0;d<w;d++)null!=(p=n.__k[d])&&(h=-1!=p.__i&&b[p.__i]||m,p.__i=d,_=B(e,p,h,o,i,a,s,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&H(h.ref,null,p),c.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),(y=!!(4&p.__u))||h.__k===p.__k?l=O(p,l,e,y):"function"==typeof p.type&&void 0!==_?l=_:f&&(l=f.nextSibling),p.__u&=-7);return n.__e=g,l}function C(e,t,n,r,o){var i,a,s,l,u,c=n.length,d=c,h=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[i]=E(null,a,null,null,null):_(a)?a=e.__k[i]=E(A,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=E(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(u=a.__i=I(a,n,l,d))&&(d--,(s=n[u])&&(s.__u|=2)),null==s||null==s.__v?(-1==u&&(o>c?h--:o<c&&h++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=T(s)),q(s,s));return r}function O(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=O(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=T(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function $(e,t){return t=t||[],null==e||"boolean"==typeof e||(_(e)?e.some(function(e){$(e,t)}):t.push(e)),t}function I(e,t,n,r){var o,i,a,s=e.key,l=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==s||c&&s==u.key&&l==u.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(u=t[a=o>=0?o--:i++])&&!(2&u.__u)&&s==u.key&&l==u.type)return a;return-1}function R(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||g.test(t)?n:n+"px"}function D(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||R(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||R(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(c,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=d,e.addEventListener(t,i?p:h,i)):e.removeEventListener(t,i?p:h,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function B(e,t,n,r,i,a,s,l,u,c){var d,h,p,f,m,g,w,E,k,T,N,x,P,M,C,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof O)try{if(E=t.props,k="prototype"in O&&O.prototype.render,T=(d=O.contextType)&&r[d.__c],N=d?T?T.props.value:d.__:r,n.__c?w=(h=t.__c=n.__c).__=h.__E:(k?t.__c=h=new O(E,N):(t.__c=h=new S(E,N),h.constructor=O,h.render=V),T&&T.sub(h),h.state||(h.state={}),h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),k&&null==h.__s&&(h.__s=h.state),k&&null!=O.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=y({},h.__s)),y(h.__s,O.getDerivedStateFromProps(E,h.__s))),f=h.props,m=h.state,h.__v=t,p)k&&null==O.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),k&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(k&&null==O.getDerivedStateFromProps&&E!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(E,N),t.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(E,h.__s,N)){t.__v!=n.__v&&(h.props=E,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),v.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(E,h.__s,N),k&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,g)})}if(h.context=N,h.props=E,h.__P=e,h.__e=!1,x=o.__r,P=0,k)h.state=h.__s,h.__d=!1,x&&x(t),d=h.render(h.props,h.state,h.context),v.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,x&&x(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++P<25);h.state=h.__s,null!=h.getChildContext&&(r=y(y({},r),h.getChildContext())),k&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(f,m)),M=null!=d&&d.type===A&&null==d.key?W(d.props.children):d,l=L(e,_(M)?M:[M],t,n,r,i,a,s,l,u,c),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),w&&(h.__E=h.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(C=a.length;C--;)b(a[C]);G(t)}else t.__e=n.__e,t.__k=n.__k,e.then||G(t);o.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=U(n.__e,t,n,r,i,a,s,u,c);return(d=o.diffed)&&d(t),128&t.__u?void 0:l}function G(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(G))}function j(e,t,n){for(var r=0;r<n.length;r++)H(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function W(e){return"object"!=typeof e||null==e||e.__b>0?e:_(e)?e.map(W):y({},e)}function U(e,t,n,i,a,s,l,u,c){var d,h,p,f,v,g,y,w=n.props||m,E=t.props,k=t.type;if("svg"==k?a="http://www.w3.org/2000/svg":"math"==k?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;d<s.length;d++)if((v=s[d])&&"setAttribute"in v==!!k&&(k?v.localName==k:3==v.nodeType)){e=v,s[d]=null;break}if(null==e){if(null==k)return document.createTextNode(E);e=document.createElementNS(a,k,E.is&&E),u&&(o.__m&&o.__m(t,s),u=!1),s=null}if(null==k)w===E||u&&e.data==E||(e.data=E);else{if(s=s&&r.call(e.childNodes),!u&&null!=s)for(w={},d=0;d<e.attributes.length;d++)w[(v=e.attributes[d]).name]=v.value;for(d in w)v=w[d],"dangerouslySetInnerHTML"==d?p=v:"children"==d||d in E||"value"==d&&"defaultValue"in E||"checked"==d&&"defaultChecked"in E||D(e,d,null,v,a);for(d in E)v=E[d],"children"==d?f=v:"dangerouslySetInnerHTML"==d?h=v:"value"==d?g=v:"checked"==d?y=v:u&&"function"!=typeof v||w[d]===v||D(e,d,v,w[d],a);if(h)u||p&&(h.__html==p.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(p&&(e.innerHTML=""),L("template"==t.type?e.content:e,_(f)?f:[f],t,n,i,"foreignObject"==k?"http://www.w3.org/1999/xhtml":a,s,l,s?s[0]:n.__k&&T(n,0),u,c),null!=s)for(d=s.length;d--;)b(s[d]);u||(d="value","progress"==k&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[d]||"progress"==k&&!g||"option"==k&&g!=w[d])&&D(e,d,g,w[d],a),d="checked",null!=y&&y!=e[d]&&D(e,d,y,w[d],a))}return e}function H(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function q(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||H(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&q(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,n){return this.constructor(e,n)}function z(e,t,n){var i,a,s,l;t==document&&(t=document.documentElement),o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],B(t,e=(!i&&n||t).__k=w(A,null,[e]),a||m,m,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,l),j(s,e,l)}function Y(e,t){z(e,t,Y)}function K(e,t,n){var o,i,a,s,l=y({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),E(e.type,l,o||e.key,i||e.ref,null)}function Z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,P(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+f++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},S.prototype.render=A,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,c=/(PointerCapture)$|Capture$/i,d=0,h=F(!1),p=F(!0),f=0},247:(e,t,n)=>{n.d(t,{FD:()=>i,FK:()=>r.FK,Y:()=>i});var r=n(126),o=0;function i(e,t,n,i,a,s){t||(t={});var l,u,c=t;if("ref"in c)for(u in c={},t)"ref"==u?l=t[u]:c[u]=t[u];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(l=e.defaultProps))for(u in l)void 0===c[u]&&(c[u]=l[u]);return r.fF.vnode&&r.fF.vnode(d),d}Array.isArray},53:(e,t,n)=>{e.exports=n.p+"37c964ca545c240f010a.mjs"},402:(e,t,n)=>{n.d(t,{g5:()=>o,Yv:()=>He,g$:()=>i,Tj:()=>a,zp:()=>r});var r={};n.r(r),n.d(r,{default:()=>V,sssiEnglandRequestTransformer:()=>U,sssiScotlandRequestTransformer:()=>q,sssiWalesRequestTransformer:()=>H});var o={};n.r(o),n.d(o,{addFeatureToMap:()=>ce,createFeatureHTML:()=>pe,createFeaturesHTML:()=>de,focusFeature:()=>he,getBoundingBox:()=>le,getFeaturesManager:()=>ve,getGeoJSON:()=>se,getHelpPanelHtml:()=>te,getTexts:()=>Q,getUIManager:()=>ge,languageTexts:()=>J,processGeospatial:()=>ue});var i={};n.r(i),n.d(i,{getInitMapConfig:()=>ke,getTexts:()=>Ee,languageTexts:()=>we,processLocation:()=>Le});var a={};n.r(a),n.d(a,{EVENTS:()=>We,centerMap:()=>ze,createMap:()=>Ve,eastingNorthingToLatLong:()=>Re,formSubmitFactory:()=>Ue,getCentroidGridRef:()=>Ge,getCoordinateGridRef:()=>Be,getDefaultConfig:()=>je,getMapCountryLayers:()=>Ke,getMapLayers:()=>Ye,initMaps:()=>He,latLongToEastingNorthing:()=>Ie,latLongToOsGridRef:()=>De,makeTileRequestTransformer:()=>qe,osGridRefToLatLong:()=>Fe});var s=n(196),l=n(399),u=n(321),c=n(781);function d(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:t.manifest,mapStyles:t.mapStyles,load:(e=(0,u.A)((0,l.A)().m(function e(){var t;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(402).then(n.bind(n,232));case 1:return t=e.v.manifest,e.a(2,t)}},e)})),function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}function h(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.manifest,o=t.units;return{id:"scaleBar",manifest:r,units:void 0===o?"metric":o,load:(e=(0,u.A)((0,l.A)().m(function e(){var t;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(402).then(n.bind(n,792));case 1:return t=e.v.manifest,e.a(2,t)}},e)})),function(){return e.apply(this,arguments)})}}var p=n(647);function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.A)((0,c.A)((0,c.A)({},p.D),t),{},{id:"search",load:(e=(0,u.A)((0,l.A)().m(function e(){var t;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.resolve().then(n.bind(n,647)).then(function(e){return e.m});case 1:return t=e.v.manifest,e.a(2,t)}},e)})),function(){return e.apply(this,arguments)})})}n(452),n(247);var m=n(7),v=function(e){var t=new URL(n(53),n.b);return t.searchParams.set("v",e),t.href};function g(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var e=function(){if(document.documentMode)return"Internet Explorer is not supported";var e=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var t,n=document.createElement("canvas"),r=!1,o=(0,m.A)(["webgl2"]);try{for(o.s();!(t=o.n()).done;){var i=t.value;try{if((r=n.getContext(i))&&"function"==typeof r.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){o.e(e)}finally{o.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}}(["webgl2"]);return e.isEnabled?function(){if("function"!=typeof(null===Intl||void 0===Intl?void 0:Intl.supportedValuesOf))return!1;try{return new RegExp("(?<=a)b").test("ab")}catch(e){return!1}}()?function(){if("undefined"==typeof Worker)return!1;var e=!1,t={get type(){return e=!0,"module"}};try{new Worker("blob://",t).terminate()}catch(e){}return e}()?void 0:"Browser does not support module workers":"Browser does not support the JavaScript features MapLibre requires":e.error}();return{isSupported:!e,error:e}},load:(e=(0,u.A)((0,l.A)().m(function e(){var r,o,i;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(264).then(n.bind(n,212));case 1:return(r=e.v).setWorkerUrl(t.workerUrl||v(r.getVersion())),e.n=2,n.e(402).then(n.bind(n,814));case 2:return o=e.v.default,i=(0,c.A)((0,c.A)({},t),{},{crs:"EPSG:4326"}),e.a(2,{MapProvider:o,mapProviderConfig:i,mapFramework:r})}},e)})),function(){return e.apply(this,arguments)})}}function _(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function y(e,t,n){if(null!==e)for(var r,o,i,a,s,l,u,c,d=0,h=0,p=e.type,f="FeatureCollection"===p,m="Feature"===p,v=f?e.features.length:1,g=0;g<v;g++){s=(c=!!(u=f?e.features[g].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var b=0,w=0;if(null!==(a=c?u.geometries[_]:u)){l=a.coordinates;var E=a.type;switch(d=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===t(l,h,g,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,g,b,w))return!1;h++,"MultiPoint"===E&&b++}"LineString"===E&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-d;o++){if(!1===t(l[r][o],h,g,b,w))return!1;h++}"MultiLineString"===E&&b++,"Polygon"===E&&w++}"Polygon"===E&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(w=0,o=0;o<l[r].length;o++){for(i=0;i<l[r][o].length-d;i++){if(!1===t(l[r][o][i],h,g,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===y(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function b(e,t={}){let n=0,r=0,o=0;return y(e,function(e){n+=e[0],r+=e[1],o++},!0),function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!_(e[0])||!_(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([n/o,r/o],t.properties)}Math.PI;let w=" ";class E{static get separator(){return w}static set separator(e){w=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+E.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+E.separator+i+"′"+E.separator+a+"″"}return r}static toLat(e,t,n){const r=E.toDms(E.wrap90(e),t,n);return null===r?"–":r.slice(1)+E.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=E.toDms(E.wrap180(e),t,n);return null===r?"–":r+E.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=E.toDms(E.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=E.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const k=E;class A{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new A(t,n,r)}negate(){return new A(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new A(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");if(!(t instanceof A||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof A))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],h=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new A(h[0],h[1],h[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const S=A,T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},N={WGS84:{ellipsoid:T.WGS84}};Object.freeze(T.WGS84),Object.freeze(N.WGS84);class x{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=k.wrap90(Number(e)),this._lon=k.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?k.wrap90(k.parse(e)):k.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?k.wrap90(k.parse(e)):k.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?k.wrap180(k.parse(e)):k.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?k.wrap180(k.parse(e)):k.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?k.wrap180(k.parse(e)):k.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return T}static get datums(){return N}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=k.wrap90(k.parse(t)),n=k.wrap180(k.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=k.wrap90(k.parse(t)),n=k.wrap180(k.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=k.wrap90(k.parse(t)),n=k.wrap180(k.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:T.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new P((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof x))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${k.toLat(this.lat,e,t)}, ${k.toLon(this.lon,e,t)}${null==n?"":r}`}}class P extends S{constructor(e,t,n){super(e,t,n)}toLatLon(e=T.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),h=d/c,p=isNaN(h)?0:Math.atan2(r+l*i*d*d*d,u-s*o*h*h*h),f=Math.atan2(n,t),m=Math.sin(p),v=u*Math.cos(p)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new x(p.toDegrees(),f.toDegrees(),v)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const M={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},L={ED50:{ellipsoid:M.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:M.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:M.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:M.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:M.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:M.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:M.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:M.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:M.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:M.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:M.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(M).forEach(e=>Object.freeze(M[e])),Object.keys(L).forEach(e=>{Object.freeze(L[e]),Object.freeze(L[e].transform)});class C extends x{constructor(e,t,n=0,r=L.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return M}static get datums(){return L}static parse(...e){let t=L.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new O(e.x,e.y,e.z,this.datum)}}class O extends P{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||L.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new C(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=L.WGS84||(t=this,n=e.transform),e==L.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(L.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new O(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const $={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:C.ellipsoids.Airy1830};class I{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=C.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=$.ellipsoid,i=$.trueOrigin.lat.toRadians(),a=$.trueOrigin.lon.toRadians(),s=-$.falseOrigin.easting,l=-$.falseOrigin.northing,u=$.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),h=d*d,p=d*d*d;let f=i,m=0;do{f=(n-l-m)/(r*u)+f,m=o*u*((1+d+5/4*h+5/4*p)*(f-i)-(3*d+3*d*d+21/8*p)*Math.sin(f-i)*Math.cos(f+i)+(15/8*h+15/8*p)*Math.sin(2*(f-i))*Math.cos(2*(f+i))-35/24*p*Math.sin(3*(f-i))*Math.cos(3*(f+i)))}while(Math.abs(n-l-m)>=1e-5);const v=Math.cos(f),g=Math.sin(f),_=r*u/Math.sqrt(1-c*g*g),y=r*u*(1-c)/Math.pow(1-c*g*g,1.5),b=_/y-1,w=Math.tan(f),E=w*w,k=E*E,A=1/v,S=_*_*_,T=S*_*_,N=t-s,x=N*N,P=x*N,M=x*x,L=P*x;f=f-w/(2*y*_)*x+w/(24*y*S)*(5+3*E+b-9*E*b)*M-w/(720*y*T)*(61+90*E+45*k)*(M*x);const O=a+A/_*N-A/(6*S)*(_/y+2*E)*P+A/(120*T)*(5+28*E+24*k)*L-A/(T*_*_*5040)*(61+662*E+1320*k+k*E*720)*(L*x);let I=new R(f.toDegrees(),O.toDegrees(),0,C.datums.OSGB36);return e!=C.datums.OSGB36&&(I=I.convertDatum(e),I=new R(I.lat,I.lon,I.height,I.datum)),I}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new I(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new I(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class R extends C{toOsGrid(){const e=this.datum==C.datums.OSGB36?this:this.convertDatum(C.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=$.ellipsoid,i=$.trueOrigin.lat.toRadians(),a=$.trueOrigin.lon.toRadians(),s=-$.falseOrigin.easting,l=-$.falseOrigin.northing,u=$.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),h=d*d,p=d*d*d,f=Math.cos(t),m=Math.sin(t),v=r*u/Math.sqrt(1-c*m*m),g=r*u*(1-c)/Math.pow(1-c*m*m,1.5),_=v/g-1,y=o*u*((1+d+5/4*h+5/4*p)*(t-i)-(3*d+3*d*d+21/8*p)*Math.sin(t-i)*Math.cos(t+i)+(15/8*h+15/8*p)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*p*Math.sin(3*(t-i))*Math.cos(3*(t+i))),b=f*f*f,w=b*f*f,E=Math.tan(t)*Math.tan(t),k=E*E,A=n-a,S=A*A,T=S*A,N=T*A,x=N*A;let P=y+l+v/2*m*f*S+v/24*m*b*(5-E+9*_)*N+v/720*m*w*(61-58*E+k)*(x*A),M=s+v*f*A+v/6*b*(v/g-E)*T+v/120*w*(5-18*E+k+14*_-58*E*_)*x;P=Number(P.toFixed(3)),M=Number(M.toFixed(3));try{return new I(M,P)}catch(L){throw new Error(`${L.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new R(t.lat,t.lon,t.height,t.datum)}}function D(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,c.A)((0,c.A)({noKeyItemText:"No features displayed"},t),{},{id:"datasets",load:(e=(0,u.A)((0,l.A)().m(function e(){var r,o;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(402).then(n.bind(n,900)).then(function(e){return e.m});case 1:return r=e.v,o=r.createManifest,e.a(2,o(t))}},e)})),function(){return e.apply(this,arguments)})});return r}function F(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return y(e,e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}const B="en-GB",G="cy",j=B,W={stroke:"#00897B",fillPattern:"diagonal-cross-hatch",fillPatternForegroundColor:"#00897B",fillPatternBackgroundColor:"transparent"};function U(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",t.join(",")),{url:n.toString()}}function H(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",`${t.join(",")},EPSG:4326`),{url:n.toString()}}function q(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("geometry",t.join(",")),{url:n.toString()}}const V=[{id:"sssi-england",label:"Sites of Special Scientific Interest",dynamicGeoJSON:{url:"https://environment.data.gov.uk/geoservices/datasets/ba8dc201-66ef-4983-9d46-7378af21027e/ogc/features/v1/collections/Sites_of_Special_Scientific_Interest_England/items?f=json",idProperty:"ref_code",transformRequest:U},minZoom:12,style:W,showInKey:!0,showInMenu:!1},{id:"sssi-wales",label:"SSSI Wales",dynamicGeoJSON:{url:"https://datamap.gov.wales/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=inspire-nrw:NRW_SSSI&outputFormat=application/json&srsName=EPSG:4326",idProperty:"id",transformRequest:H},minZoom:12,style:W,showInKey:!1,showInMenu:!1},{id:"sssi-scotland",label:"SSSI Scotland",dynamicGeoJSON:{url:"https://services1.arcgis.com/LM9GyVFsughzHdbO/ArcGIS/rest/services/Sites_of_Special_Scientific_Interest/FeatureServer/0/query?f=geojson&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&returnGeometry=true&outFields=*",idProperty:"OBJECTID",transformRequest:q},minZoom:12,style:W,showInKey:!1,showInMenu:!1}],z=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Defnyddiwch lyfliwr neu allweddlon i ganolbwyntio\'r pwynt yn y lleoliad","point4":"Cliciwch i ychwanegu\'r lleoliad i\'r map"}}},"QW":{"Tj":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","ledeIntro":"Gallwch ychwanegu","ledeOutro":"i\'r map.","lineText":"llinell","shapeText":"siâp","lineOrShapeText":"llinell neu siâp","typesPhrasePoint":"pwyntiau","typesPhraseLine":"lliniau","typesPhraseShape":"siâpiau","typesPhraseOr":"neu","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Cliciwch ddwywaith, neu dewiswch \'Wedi gorffen\', pan fyddwch wedi","point4":"Rhowch enw i\'r lleoliad"},"typeDescriptions":{"point":"Pwynt","line":"Llinell","polygon":"Siâp"},"buttons":{"point":"Ychwanegu pwynt","line":"Ychwanegu llinell","polygon":"Ychwanegu siâp"},"itemLabel1":"Lleoliad","itemLabel2":"disgrifiad","itemUpdateLink":"Diweddaru","itemDeleteLink":"Dileu","itemFocusLink":"Dangos","itemVisuallyHidden":"lleoliad","details":{"summary":"Cyfesurynnau","type":"Math","centroidGridReference":"Canol cyfeirnod grid","firstPointGridReference":"Cyfeirnod grid y pwynt cyntaf","detailedCoordinates":"Cyfesurynnau manwl"}}}}}'),Y=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"How to use this map","point1":"Search for a place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Use a mouse or keyboard to centre the point at the location","point4":"Click to add the location to the map"}}},"QW":{"Tj":{"helpPanel":{"label":"How to use this map","ledeIntro":"You can add","ledeOutro":"to the map.","lineText":"a line","shapeText":"a shape","lineOrShapeText":"a line or shape","typesPhrasePoint":"points","typesPhraseLine":"lines","typesPhraseShape":"shapes","typesPhraseOr":"or","point1":"Search for a county, place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Double‑click, or select \'Done\', when you have finished drawing","point4":"Give the location a name"},"typeDescriptions":{"point":"Point","line":"Line","polygon":"Shape"},"buttons":{"point":"Add point","line":"Add line","polygon":"Add shape"},"itemLabel1":"Location","itemLabel2":"description","itemUpdateLink":"Update","itemDeleteLink":"Delete","itemFocusLink":"Show","itemVisuallyHidden":"location","details":{"summary":"Coordinates","type":"Type","centroidGridReference":"Centre grid reference","firstPointGridReference":"First point grid reference","detailedCoordinates":"Detailed coordinates"}}}}}');function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(null,arguments)}const Z=Y.dK.QW.Tj,X=z.dK.QW.Tj,J={[B]:Z,[G]:X};function Q(e=j){return J[e]}const ee={focus:!1,showLabel:!0,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1}};function te(e,t,n,r){const o=function(e,t,n){return t&&n?e.lineOrShapeText:t?e.lineText:n?e.shapeText:""}(e,n,r),i=o?`<li>${e.point3} ${o}</li>`:"",a=function(e,t,n,r){const o=[];return t&&o.push(e.typesPhrasePoint),n&&o.push(e.typesPhraseLine),r&&o.push(e.typesPhraseShape),function(e,t,n){if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return`${e[0]} ${n} ${e[1]}`;const r=e.pop();return`${e.join(", ")} ${n} ${r}`}(o,0,e.typesPhraseOr)}(e,t,n,r);return`<p class="govuk-body-s govuk-!-margin-bottom-2">${e.ledeIntro} ${a} ${e.ledeOutro}</p><ul class="govuk-list govuk-list--number govuk-body-s"><li>${e.point1}</li><li>${e.point2}</li>${i}<li>${e.point4}</li></ul>`}const ne={stroke:"rgba(0, 11, 112, 1)",fill:"rgba(0, 11, 112, 0.2)",strokeWidth:2},re={stroke:"rgb(0, 0, 0)",fill:"rgba(255, 221, 0, 0.2)",strokeWidth:2},oe='<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" /><circle cx="12" cy="10" r="3" />',ie='<path d="M19.5 7v10M4.5 7v10M7 19.5h10M7 4.5h10"/><path d="M22 18v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zm0-15v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 18v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 3v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1z"/>',ae='<path d="M5.706 16.294L16.294 5.706"/><path d="M21 2v3c0 .549-.451 1-1 1h-3c-.549 0-1-.451-1-1V2c0-.549.451-1 1-1h3c.549 0 1 .451 1 1zM6 17v3c0 .549-.451 1-1 1H2c-.549 0-1-.451-1-1v-3c0-.549.451-1 1-1h3c.549 0 1 .451 1 1z"/>';function se(e){const t=e.value.trim();return{type:"FeatureCollection",features:t?JSON.parse(t):[]}}function le(e){return F(e)}function ue(e,t,r){if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".govuk-textarea");if(!(o instanceof HTMLTextAreaElement))return;const{listEl:i,mapId:a}=function(e,t){const n=document.createElement("div"),r=`geospatialmap_${t}`;n.setAttribute("id",r),n.setAttribute("class","map-container");const o=document.createElement("div"),i=`${r}_list`;return o.setAttribute("id",i),e.after(n),n.after(o),e.classList.add("js-hidden"),{mapEl:n,listEl:o,mapId:r}}(o,r),s=se(o),d=s.features.length?le(s):void 0,h=function(){var e;return(0,c.A)((0,c.A)({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"draw",load:(e=(0,u.A)((0,l.A)().m(function e(){var t;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(402).then(n.bind(n,666)).then(function(e){return e.z});case 1:return t=e.v.manifest,e.a(2,t)}},e)})),function(){return e.apply(this,arguments)})})}(),p=[h],f=t.dataset.country,m=Ye(t.dataset.maplayers),v=Ke(e.apiPath,f);m.includes("sssi")&&v.push(...V),v.length&&p.push(D({datasets:v}));const g=K({},je(),{bounds:d,plugins:p}),{map:_,interactPlugin:y}=Ve(a,g,e),b=ve(s),w=function(){let e;return{getActiveFeature:function(){return e},setActiveFeature:function(t){e=t},resetActiveFeature:function(){e=void 0}}}(),E={geometryTypes:t.dataset.geometrytypes},k=t.dataset.lang||j,A=ge(s,_,a,i,o,E,k);!function(e){const{map:t}=e;t.on(We.mapReady,function(e){const{map:t,activeFeatureManager:n,uiManager:r,interactPlugin:o,drawPlugin:i}=e,{toggleActionButtons:a,renderList:s,getAllowableGeometryTypes:l}=r,{resetActiveFeature:u}=n;return function(n){const c=l(),d=c.includes("point"),h=c.includes("line"),p=c.includes("shape"),{texts:f}=e.languageManager;t.addPanel("info",K({},ee,{label:f.helpPanel.label,html:te(f.helpPanel,d,h,p)})),d&&t.addButton("btnAddPoint",{variant:"tertiary",label:f.buttons.point,iconSvgContent:oe,onClick:()=>{u(),a(!0),s(!0),o.enable()},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),p&&t.addButton("btnAddPolygon",{variant:"tertiary",label:f.buttons.polygon,iconSvgContent:ie,onClick:()=>{u(),a(!0),s(!0),i.newPolygon(fe(),re)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),h&&t.addButton("btnAddLine",{variant:"tertiary",label:f.buttons.line,iconSvgContent:ae,onClick:()=>{u(),a(!0),s(!0),i.newLine(fe(),ne)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),e.mapProvider=n.map,t.on(We.drawReady,function(e){const{featuresManager:t,uiManager:n,drawPlugin:r,map:o}=e,{renderList:i}=n,{getFeatures:a}=t;return function(){a().forEach(e=>ce(e,r,o)),i()}}(e)),t.on(We.drawCreated,function(e){const{featuresManager:t,uiManager:n}=e,{addFeature:r}=t,{renderList:o,toggleActionButtons:i,focusDescriptionInput:a}=n;return function(e){r(K({},e,{properties:{description:""}})),o(),i(!1),a()}}(e)),t.on(We.drawEdited,function(e){const{featuresManager:t,activeFeatureManager:n,uiManager:r}=e,{updateFeature:o}=t,{getActiveFeature:i,resetActiveFeature:a}=n,{renderList:s,toggleActionButtons:l}=r;return function(e){const t=e,n=t.id;i()===n&&(o(n,t.geometry),s()),a(),l(!1)}}(e)),t.on(We.drawCancelled,function(e){const{uiManager:t,activeFeatureManager:n}=e,{toggleActionButtons:r,renderList:o}=t,{resetActiveFeature:i}=n;return function(){r(!1),i(),o()}}(e)),t.on(We.interactMarkerChange,function(e){const{featuresManager:t,activeFeatureManager:n,map:r,interactPlugin:o,uiManager:i}=e,{addFeature:a,updateFeature:s}=t,{getActiveFeature:l,resetActiveFeature:u}=n,{renderList:c,focusDescriptionInput:d,toggleActionButtons:h}=i;return function(e){const t=l();if(t){const n=s(t,{type:"Point",coordinates:e.coords});r.addMarker(t,e.coords),n&&c(),u()}else{const t=fe();a({type:"Feature",properties:{description:""},geometry:{type:"Point",coordinates:e.coords},id:t}),r.addMarker(t,e.coords),c(),d()}r.removeMarker("location"),o.disable(),h(!1)}}(e));const{listEl:m}=r;m.addEventListener("click",function(e){const{map:t,mapProvider:n,featuresManager:r,activeFeatureManager:o,interactPlugin:i,uiManager:a,drawPlugin:s}=e,{getFeature:l,removeFeature:u}=r,{getActiveFeature:c,setActiveFeature:d}=o,{renderList:h,toggleActionButtons:p}=a;return function(e){const r=e.target;if(r instanceof HTMLElement){if(c())return e.preventDefault(),void e.stopPropagation();if("A"===r.tagName&&r.dataset.action&&r.dataset.id&&r.dataset.type){const{action:o,id:a,type:c}=r.dataset;"edit"===o?function(e,t){d(e),"Point"===t?(i.selectFeature({featureId:e}),i.enable()):s.editFeature(e);const r=l(e);r&&n&&he(r,n),p(!0),h(!0)}(a,c):(e.preventDefault(),e.stopPropagation(),"delete"===o&&function(e,n){"Point"===n?(t.removeMarker(e),u(e)):(s.deleteFeature(e),u(e)),h()}(a,c))}}}}(e),!1),m.addEventListener("change",function(e){const{featuresManager:t,uiManager:n}=e,{getFeature:r}=t,{renderValue:o}=n;return function(e){e.preventDefault(),e.stopPropagation();const t=e.target;if(!(t instanceof HTMLInputElement&&t.dataset.id))return;const{id:n}=t.dataset,i=r(n);i&&(i.properties.description=t.value.trim(),o())}}(e),!1),m.addEventListener("keydown",function(e){e.target instanceof HTMLInputElement&&("Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),e.stopPropagation()))},!1)}}(e))}({languageManager:{lang:k,texts:Q(k)},map:_,featuresManager:b,activeFeatureManager:w,uiManager:A,interactPlugin:y,drawPlugin:h})}function ce(e,t,n){switch(e.geometry.type){case"Polygon":t.addFeature(K({},e,re));break;case"LineString":t.addFeature(K({},e,ne));break;case"Point":n.addMarker(e.id,e.geometry.coordinates)}}function de(e,t,n=!1,r=!1,o=j){return`<dl class="govuk-summary-list">\n ${e.map((e,i)=>pe(e,i,t,n,r,o)).join("\n")}\n </dl>`}function he(e,t){t.fitBounds(F(e))}function pe(e,t,n,r=!1,o=!1,i=j){const a=Q(i),s=e.geometry.coordinates.flat(2),l=[];for(let p=0;p<s.length;p+=2)l.push(s.slice(p,p+2).join(", "));const u=l.map(e=>`<li>${e}</li>`).join(""),c=o?`<p class="govuk-body govuk-!-margin-bottom-0">${e.properties.description}</p>`:`<input class="govuk-input govuk-!-width-two-thirds" type="text" id="description_${t}" value="${e.properties.description}" data-id="${e.id}">`,d=`<ul class="govuk-summary-list__actions-list">${o?`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state" href="#${n}" data-action="focus" data-id="${e.id}">${a.itemFocusLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`:`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#${n}" data-action="edit" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemUpdateLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li><li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#" data-action="delete" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemDeleteLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`}</ul>`,h=function(e,t){switch(e.geometry.type){case"Point":return t.point;case"LineString":return t.line;case"Polygon":return t.polygon}}(e,a.typeDescriptions);return`<div class="govuk-summary-list__row govuk-summary-list__row--no-border">\n <dt class="govuk-summary-list__key">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" ${o?"":`for="description_${t}"`}>${a.itemLabel1} ${t+1} ${a.itemLabel2}</label>\n ${c}\n </div>\n </dt>\n <dd class="govuk-summary-list__actions">\n ${d}\n </dd>\n</div>\n<div class="govuk-summary-list__row">\n <details class="govuk-details govuk-!-margin-bottom-2">\n <summary class="govuk-details__summary">\n <span class="govuk-details__summary-text">${a.details.summary}</span>\n </summary>\n <div class="govuk-details__text">\n <dl class="govuk-summary-list">\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.type}</dt>\n <dd class="govuk-summary-list__value">${h}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.centroidGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.centroidGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.firstPointGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.coordinateGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.detailedCoordinates}</dt>\n <dd class="govuk-summary-list__value">\n <ol class="govuk-list govuk-list--number">${u}</ol>\n </dd>\n </div>\n </dl>\n </div>\n </details>\n</div>`}function fe(){return window.crypto.randomUUID()}function me(e){const{geometry:t}=e;function n(e){e[0]=+e[0].toFixed(7),e[1]=+e[1].toFixed(7)}"Point"===t.type?n(t.coordinates):"LineString"===t.type?t.coordinates.forEach(n):t.coordinates.flat().forEach(n)}function ve(e){function t(t){return e.features.find(e=>e.id===t)}return{getFeatures:function(){return e.features},getFeature:t,addFeature:function(t){t.properties.coordinateGridReference=Be(t),t.properties.centroidGridReference=Ge(t),me(t),e.features.push(t)},updateFeature:function(e,n){const r=t(e);return r&&(r.geometry=n,r.properties.coordinateGridReference=Be(r),r.properties.centroidGridReference=Ge(r),me(r)),r},removeFeature:function(t){const n=e.features.findIndex(e=>e.id===t);return n>-1?e.features.splice(n,1):void 0}}}function ge(e,t,n,r,o,i,a=j){function s(){return null!=i&&i.geometryTypes?i.geometryTypes.split(","):["point","line","shape"]}const l=function(e,t){return function(){t.value=JSON.stringify(e.features,null,2)}}(e,o),u=function(e,t,n,r,o=j){return function(i=!1){const a=de(e.features,t,i,!1,o);n.innerHTML=a,r()}}(e,n,r,l,a);return{renderList:u,renderValue:l,listEl:r,toggleActionButtons:function(e){const n=s();n.includes("point")&&t.toggleButtonState("btnAddPoint","hidden",e),n.includes("shape")&&t.toggleButtonState("btnAddPolygon","hidden",e),n.includes("line")&&t.toggleButtonState("btnAddLine","hidden",e)},focusDescriptionInput:function(){const e=r.querySelectorAll("input");if(e.length){const t=e.item(e.length-1);t.focus(),t.select()}},getAllowableGeometryTypes:s}}const _e=Y.dK.Bt.T,ye=z.dK.Bt.T,be="input.govuk-input",we={[B]:_e,[G]:ye};function Ee(e=j){return we[e]}function ke(e){switch(e.dataset.locationtype){case"latlongfield":return function(e){const{latInput:t,longInput:n}=Ne(e),r=Ae(t.value,n.value);if(r.valid)return Me([r.value.long,r.value.lat])}(e);case"eastingnorthingfield":return function(e){const{eastingInput:t,northingInput:n}=xe(e),r=Se(t.value,n.value);if(!r.valid)return;const o=Re(r.value);return Me([o.long,o.lat])}(e);case"osgridreffield":return function(e){const t=Te(Pe(e).value);if(!t.valid)return;const n=Fe(t.value);return Me([n.long,n.lat])}(e);default:throw new Error("Not implemented")}}function Ae(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=49.85&&n<=60.859&&r>=-13.687&&r<=1.767?{valid:!0,value:{lat:n,long:r}}:{valid:!1}}function Se(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=0&&n<=7e5&&r>=0&&r<=13e5?{valid:!0,value:{easting:n,northing:r}}:{valid:!1}}function Te(e){if(!e)return{valid:!1};const t=/^((([sS]|[nN])[a-hA-Hj-zJ-Z])|(([tT]|[oO])[abfglmqrvwABFGLMQRVW])|([hH][l-zL-Z])|([jJ][lmqrvwLMQRVW]))\s?(([0-9]{3})\s?([0-9]{3})|([0-9]{4})\s?([0-9]{4})|([0-9]{5})\s?([0-9]{5}))$/.exec(e);return null===t?{valid:!1}:{valid:!0,value:t[0]}}function Ne(e){const t=e.querySelectorAll(be);if(2!==t.length)throw new Error("Expected 2 inputs for lat and long");return{latInput:t[0],longInput:t[1]}}function xe(e){const t=e.querySelectorAll(be);if(2!==t.length)throw new Error("Expected 2 inputs for easting and northing");return{eastingInput:t[0],northingInput:t[1]}}function Pe(e){const t=e.querySelector(be);if(null===t)throw new Error("Expected 1 input for osgridref");return t}function Me(e){return{zoom:"16",center:e,markers:[{id:"location",coords:e}]}}function Le(e,t,n){var r;if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".app-location-field-inputs");if(!(o instanceof HTMLDivElement))return;const i=t.dataset.locationtype;if(!i||!["latlongfield","eastingnorthingfield","osgridreffield"].includes(i))return;const a=document.createElement("div"),s=`map_${n}`;a.setAttribute("id",s),a.setAttribute("class","map-container");const l=null!=(r=ke(t))?r:je();o.after(a);const u=t.dataset.country,c=Ye(t.dataset.maplayers),d=Ke(e.apiPath,u);c.includes("sssi")&&d.push(...V),d.length&&(l.plugins=[D({datasets:d})]);const h=t.dataset.lang||j,{map:p,interactPlugin:f}=Ve(s,l,e);p.on(We.mapReady,function(e){switch(i){case"latlongfield":!function(e,t,n){const{latInput:r,longInput:o}=Ne(e);function i(){const e=Ae(r.value,o.value);if(e.valid){const r=[e.value.long,e.value.lat];ze(t,n,r)}}t.on(We.interactMarkerChange,function(e){r.value=e.coords[1].toFixed(7),o.value=e.coords[0].toFixed(7)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,p,e.map);break;case"eastingnorthingfield":!function(e,t,n){const{eastingInput:r,northingInput:o}=xe(e);function i(){const e=Se(r.value,o.value);if(e.valid){const r=Re(e.value),o=[r.long,r.lat];ze(t,n,o)}}t.on(We.interactMarkerChange,function(e){const t=Ie({lat:e.coords[1],long:e.coords[0]});r.value=t.easting.toFixed(0),o.value=t.northing.toFixed(0)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,p,e.map);break;case"osgridreffield":!function(e,t,n){const r=Pe(e);t.on(We.interactMarkerChange,function(e){const t=De({lat:e.coords[1],long:e.coords[0]});r.value=t}),r.addEventListener("change",function(){const e=Te(r.value);if(e.valid){const r=Fe(e.value),o=[r.long,r.lat];ze(t,n,o)}},!1)}(t,p,e.map);break;default:throw new Error("Not implemented")}const n=Ee(h);p.addPanel("info",{focus:!1,showLabel:!0,label:n.helpPanel.label,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1},html:`<ul><li>${n.helpPanel.point1}</li><li>${n.helpPanel.point2}</li><li>${n.helpPanel.point3}</li><li>${n.helpPanel.point4}</li></ul>`}),f.enable()})}function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(null,arguments)}const Oe=169,$e={VTS_OUTDOOR_URL:"/api/maps/vts/OS_VTS_3857_Outdoor.json",VTS_DARK_URL:"/api/maps/vts/OS_VTS_3857_Dark.json",VTS_BLACK_AND_WHITE_URL:"/api/maps/vts/OS_VTS_3857_Black_and_White.json",VTS_AERIAL_URL:"/api/maps/vts/esri-aerial.json"};function Ie({lat:e,long:t}){return new R(e,t).toOsGrid()}function Re({easting:e,northing:t}){const n=new I(e,t).toLatLon();return{lat:n.latitude,long:n.longitude}}function De({lat:e,long:t}){return new R(e,t).toOsGrid().toString()}function Fe(e){const t=I.parse(e).toLatLon();return{lat:t.latitude,long:t.longitude}}function Be(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new R(n,t).toOsGrid().toString()}if("LineString"===e.geometry.type){const[t,n]=e.geometry.coordinates[0];return new R(n,t).toOsGrid().toString()}{const[t,n]=e.geometry.coordinates[0][0];return new R(n,t).toOsGrid().toString()}}function Ge(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new R(n,t).toOsGrid().toString()}{const t=b(e),[n,r]=t.geometry.coordinates;return new R(r,n).toOsGrid().toString()}}const je=()=>({zoom:"6",center:[-2.421975,53.825564]}),We={mapReady:"map:ready",interactMarkerChange:"interact:markerchange",drawReady:"draw:ready",drawCreated:"draw:created",drawEdited:"draw:edited",drawCancelled:"draw:cancelled"};function Ue(e){return function(t){t.submitter instanceof HTMLButtonElement&&e.includes(t.submitter)||t.preventDefault()}}function He(e={}){const{assetPath:t="/assets",apiPath:n="/form/api",workerPath:r="/assets/interactive-map/maplibre-gl-worker.mjs",data:o=$e}=e,i=document.querySelectorAll(".app-location-field"),a=document.querySelectorAll(".app-geospatial-field");if(i.length){const e=i[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ue(t),!1)}if(a.length){const e=a[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ue(t),!1)}i.forEach((e,i)=>{Le({assetPath:t,apiPath:n,workerPath:r,data:o},e,i)}),a.forEach((e,i)=>{ue({assetPath:t,apiPath:n,workerPath:r,data:o},e,i)})}function qe(e){return function(t,n){if(t.startsWith("https://api.os.uk")){if("Tile"===n)return{url:t.replace("https://api.os.uk/maps/vector/v1/vts",`${window.location.origin}${e}`),headers:{}};if("Style"!==n)return{url:`${e}/map-proxy?url=${encodeURIComponent(t)}`,headers:{}}}if(t.startsWith("https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main")){const n=t.substring(84);return{url:`${e}/maps/vts${n}`,headers:{}}}return{url:t,headers:{}}}}function Ve(e,t,r){var o;const{assetPath:i,apiPath:a,workerPath:p,data:m=$e}=r,v="Ordnance survey logo",_=function(){var e;return(0,c.A)((0,c.A)({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"interact",load:(e=(0,u.A)((0,l.A)().m(function e(){var t;return(0,l.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(402).then(n.bind(n,706));case 1:return t=e.v.manifest,e.a(2,t)}},e)})),function(){return e.apply(this,arguments)})})}({markerColor:{outdoor:"#ff0000",dark:"#00ff00"},interactionModes:["placeMarker"],multiSelect:!1});return{map:new s.I(e,Ce({enableFullscreen:!0,autoColorScheme:!1,mapProvider:g({workerUrl:p}),behaviour:"inline",minZoom:6,maxZoom:18,containerHeight:"400px",enableZoomControls:!0,transformRequest:qe(a)},t,{plugins:[d({mapStyles:[{id:"outdoor",label:"Outdoor",url:m.VTS_OUTDOOR_URL,thumbnail:`${i}/interactive-map/assets/images/outdoor-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo.svg`,logoAltText:v,attribution:`Contains OS data ${String.fromCodePoint(Oe)} Crown copyright and database rights ${(new Date).getFullYear()}`,backgroundColor:"#f5f5f0"},{id:"dark",label:"Dark",url:m.VTS_DARK_URL,mapColorScheme:"dark",appColorScheme:"dark",thumbnail:`${i}/interactive-map/assets/images/dark-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-white.svg`,logoAltText:v,attribution:`Contains OS data ${String.fromCodePoint(Oe)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"black-and-white",label:"Black/White",url:m.VTS_BLACK_AND_WHITE_URL,thumbnail:`${i}/interactive-map/assets/images/black-and-white-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-black.svg`,logoAltText:v,attribution:`Contains OS data ${String.fromCodePoint(Oe)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"aerial",label:"Aerial",url:m.VTS_AERIAL_URL,thumbnail:`${i}/interactive-map/assets/images/aerial-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/esri-logo.png`,logoAltText:"Powered by Esri",attribution:`Tiles ${String.fromCodePoint(Oe)} Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community ${(new Date).getFullYear()}`}]}),_,f({osNamesURL:`${a}/geocode-proxy?query={query}`,width:"300px",showMarker:!1}),h({units:"metric"}),...null!=(o=t.plugins)?o:[]]})),interactPlugin:_}}function ze(e,t,n){e.addMarker("location",n),t.flyTo({center:n,zoom:14,essential:!0})}function Ye(e){const t=null==e?void 0:e.trim();return t?t.split(","):[]}function Ke(e,t){const n=[];return t&&n.push({id:"invalid-area",label:"Invalid areas",geojson:`${e}/maps/countries.geojson?omit=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"gray",strokeWidth:1,fill:"rgba(211,211,211,0.8)"}},{id:"valid-area",label:"Valid areas",geojson:`${e}/maps/countries.geojson?only=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"rgba(0,112,60,1)",strokeWidth:1}}),n}},731:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},321:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)})}}n.d(t,{A:()=>o})},307:(e,t,n)=>{function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>r})},839:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(750);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(0,r.A)(o.key),o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},7:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(590);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=(0,r.A)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},41:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(750);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},781:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(41);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}},505:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{A:()=>r})},399:(e,t,n)=>{function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function a(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},r(e,t,n,o)}function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,o,i,a){var s=o&&o.prototype instanceof u?o:u,c=Object.create(s.prototype);return r(c,"_invoke",function(n,r,o){var i,a,s,u=0,c=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,a=0,s=e,h.n=n,l}};function p(n,r){for(a=n,s=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],p=h.p,f=i[2];n>3?(o=f===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(a=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,a=0))}if(o||n>1)return l;throw d=!0,r}return function(o,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,f),a=c,s=f;(t=a<2?e:s)||!d;){i||(a?a<3?(a>1&&(h.n=-1),p(a,s)):h.n=s:h.v=s);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=h.n<0)?s:n.call(r,h))!==l)break}catch(t){i=e,a=1,s=t}finally{u=1}}return{value:t,done:d}}}(n,i,a),!0),c}var l={};function u(){}function c(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),p=d.prototype=u.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,r(p,"constructor",d),r(d,"constructor",c),c.displayName="GeneratorFunction",r(d,a,"GeneratorFunction"),r(p),r(p,a,"Generator"),r(p,i,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(o=function(){return{w:s,m:f}})()}n.d(t,{A:()=>o})},893:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(731),o=n(590);function i(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,o.A)(e)||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.")}()}},750:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(974);function o(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},974:(e,t,n)=>{function r(e){return r="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},r(e)}n.d(t,{A:()=>r})},590:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(731);function o(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},196:(e,t,n)=>{n.d(t,{E:()=>x,I:()=>J,a:()=>D,b:()=>S,g:()=>m,h:()=>j,l:()=>N,r:()=>W,s:()=>F,t:()=>E});var r=n(41),o=n(893),i=n(307),a=n(839),s=n(399),l=n(321),u=n(505),c=n(7),d=n(781),h=["mapViewParamKey"],p=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)},f=function(e){var t=e.behaviour,n=e.hybridWidth,r=e.maxMobileWidth;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},m=function(e){var t=e.behaviour;return["mapOnly","buttonFirst"].includes(t)||f(e)};function v(){g.forEach(function(e){!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!f(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(e,p(e.config.mapViewQueryParam))})}var g=new Map,_=!1;function y(e){try{return JSON.parse(e)}catch(X){return e}}function b(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var w=function(e,t,n,r){return e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e)};function E(e){var t,n=e.containerEl,r=e.isFullscreen,o=e.boundaryEl,i=void 0===o?document.body:o,a=Array.from(i.querySelectorAll("[data-fm-inert]"));if(n&&(a=a.filter(function(e){return!n.contains(e)})),a.forEach(function(e){e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),r){null===(t=document.activeElement)||void 0===t||t.blur();for(var s=n;null!==(l=s)&&void 0!==l&&l.parentNode&&s!==i&&s!==document.body;){var l,u,d=s.parentNode,h=(0,c.A)(d.children);try{for(h.s();!(u=h.n()).done;){var p=u.value;w(p,s,n,i)&&(p.setAttribute("aria-hidden","true"),p.dataset.fmInert="")}}catch(e){h.e(e)}finally{h.f()}s=d}}}function k(e){var t=e.id,n=e.behaviour,r=e.manageHistoryState;return"mapOnly"===n||("buttonFirst"===n?!1===r||p(e.mapViewQueryParam)===t:f(e)&&p(e.mapViewQueryParam)===t)}function A(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isFullscreen,n=e.config,r=e.rootEl,o=n.pageTitle,i=n.behaviour,a=n.containerHeight,s=null!=t?t:k(n);["mapOnly","buttonFirst","hybrid"].includes(i)&&(E({containerEl:r,isFullscreen:s}),document.documentElement.classList.toggle("im-is-fullscreen",s),r.classList.toggle("im-is-fullscreen",s)),["buttonFirst","hybrid"].includes(i)&&function(e){var t=e.pageTitle,n=e.isFullscreen,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:o,isFullscreen:s});var l=s||"buttonFirst"!==i&&!f(n)?a:"auto";return r.style.height=s?"100%":l,{isFullscreen:s}}function S(){document.body.classList.remove("im-is-loading")}var T="[interactive-map]",N={warn:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).warn.apply(e,[T].concat(n))},error:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).error.apply(e,[T].concat(n))}},x={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",APP_REMOVE_MARKER:"app:removemarker",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_SET_APPLICATION_MODE:"app:setapplicationmode",APP_CLEAR_APPLICATION_MODE:"app:clearapplicationmode",APP_SHOW_HINT:"app:showhint",APP_DISMISS_HINT:"app:dismisshint",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_FULLSCREEN_CHANGE:"app:fullscreenchange",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_SPATIAL_LIST:"map:setspatiallist",MAP_SET_SPATIAL_LIST_SUPPRESSED:"map:setspatiallistsuppressed",MAP_SET_ACTIVE_ITEM:"map:setactiveitem",MAP_SELECT_ITEM:"map:selectitem",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"};function P(e){var t=e.id,n=e.behaviour,r=p(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!f(e)||r}var M={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableMapControls:!0,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,backAndContinue:null,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Shift</kbd> + <span class="im-u-visually-hidden">Question mark</span><kbd aria-hidden="true">?</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapHintText:"Press Tab to focus it. Keyboard commands are only available once it has focus.",mapLabel:"Interactive map application",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewQueryParam:"mv",urlPosition:"sync",maxMobileWidth:640,minDesktopWidth:835,mapControlsHintText:'A "map controls" button is also available, opening further controls for moving and zooming.',nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1},L=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",C=new Set,O=new Set,$=new Set(["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape"]),I=new Set(["button","checkbox","color","file","image","radio","range","reset","submit"]);function R(e){L!==e&&(L=e,O.forEach(function(t){return t(e)}),C.forEach(function(t){return t(e)}))}function D(){return"unknown"===L?(L="mouse","mouse"):L}function F(e){return C.add(e),function(){C.delete(e)}}var B=null;function G(e,t){var n=e.url,r=e.transformRequest,o=e.load;B=function(){var e=(0,l.A)((0,s.A)().m(function e(i,a){var l;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o();case 1:return l=e.v,e.a(2,l(n,r,t,i,a))}},e)}));return function(t,n){return e.apply(this,arguments)}}()}function j(){return null!==B}function W(e,t){if(!B)throw new Error("ReverseGeocode not initialised");return B(e,t)}var U=(0,a.A)(function e(){(0,i.A)(this,e),this.events={},this._queued={}},[{key:"on",value:function(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t.apply(void 0,(0,o.A)(this._queued[e]))}catch(X){console.error("Error in event handler for '".concat(e,"':"),X)}delete this._queued[e]}return this}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,r),t.apply(void 0,arguments)};return this.on(e,r)}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(function(e){return e!==t}):[],this):this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}},{key:"emitWhenReady",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit.apply(this,[e].concat(n)):(this._queued[e]=n,this)}},{key:"emitWhenRequested",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i="".concat(e,"Requested"),a="".concat(e,"Ready"),s=function(){return t.emit.apply(t,[a].concat(r))};return this.on(i,s),s(),function(){return t.off(i,s)}}},{key:"requestOnce",value:function(e,t){var n="".concat(e,"Requested"),r="".concat(e,"Ready");return this.once(r,t),this.emit(n,e),this}},{key:"destroy",value:function(){this.events={},this._queued={}}}]);if("undefined"!=typeof crypto&&!crypto.randomUUID){var H=0;crypto.randomUUID=function(){return H=Math.max(Date.now(),H+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(H.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}}var q=!Object.hasOwn;q&&(Object.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)});var V="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(V&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(V||q)&&"undefined"!=typeof URL&&URL.createObjectURL){var z="text/javascript",Y=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",V?'if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n':""].join(""),K=URL.createObjectURL.bind(URL);if(URL.createObjectURL=function(e){return e instanceof Blob&&e.type===z&&(e=new Blob([Y,e],{type:z})),K(e)},"undefined"!=typeof Worker){var Z=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")&&"module"!==(null==t?void 0:t.type)){var n=new Blob(["".concat(Y,"importScripts(").concat(JSON.stringify(e),")")],{type:z});e=K(n)}return new Z(e,t)},Worker.prototype=Z.prototype}}var X,J=(0,a.A)(function e(t){var n,o,a,s,l,u,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,i.A)(this,e),(0,r.A)(this,"_openButton",null),(0,r.A)(this,"_root",null),(0,r.A)(this,"_breakpointDetector",null),(0,r.A)(this,"_interfaceDetectorCleanup",null),(0,r.A)(this,"_hybridBehaviourCleanup",null),(0,r.A)(this,"_isHidden",!1),(0,r.A)(this,"_isClosingViaBack",!1),(0,r.A)(this,"_isLoading",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new U,this.config=this._buildConfig(c),n=this.rootEl,a=(o=this.config).mapProvider,s=o.deviceNotSupportedText,l=null==a?void 0:a.checkDeviceCapabilities(),(a?null!=l&&l.isSupported||(b(n,s),S(),N.warn(null==l?void 0:l.error),0):(N.warn("No map provider"),0))&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&(u=this,_||(globalThis.addEventListener("popstate",v),_=!0),g.set(u.id,u)),this._breakpointDetector=function(e){var t,n=e.maxMobileWidth,r=e.minDesktopWidth,o=e.containerEl,i="unknown",a=new Set,s=function(e){e!==i&&(i=e,requestAnimationFrame(function(){i===e&&a.forEach(function(t){return t(e)})}))};if(o){var l=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(function(r){var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),s=t(a);e.dataset.breakpoint=s,n(s)});return i.observe(e),{initialType:o,cleanup:function(){i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,function(e){return function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r)},s);i=l.initialType,s(l.initialType),t=l.cleanup}else{var u=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=function(){var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:function(){r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,s);t=u.cleanup}return{subscribe:function(e){return a.add(e),function(){return a.delete(e)}},getBreakpoint:function(){return i},destroy:function(){var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=function(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){R(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=function(e){var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==L&&(L=n,O.forEach(function(e){return e(n)}),setTimeout(function(){C.forEach(function(e){return e(n)})},150))},r=function(e){var t;("Tab"===e.key||$.has(e.key)&&(!(t=e.target)||"TEXTAREA"!==t.tagName&&!t.isContentEditable&&("INPUT"!==t.tagName||I.has(t.type))))&&R("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}(),this._initialize())},[{key:"_buildConfig",value:function(e){var t=function(e){for(var t=(0,d.A)({},null==e?void 0:e.dataset),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=y(t[i])}return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapViewParamKey,n=(0,u.A)(e,h),r=(0,d.A)((0,d.A)({},M),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),"mapOnly"===r.behaviour&&r.hasExitButton&&(console.warn("[InteractiveMap] hasExitButton has no effect when behaviour is 'mapOnly' — there is nothing to exit to."),r.hasExitButton=!1),r}((0,d.A)((0,d.A)({id:this.id,title:document.title},t),e))}},{key:"_initialize",value:function(){var e=this;["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(e,t,n){var r=e.id,o=e.buttonText,i=e.buttonClass,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");t.insertAdjacentHTML("beforebegin",a);var s=t.previousElementSibling,l=new URL(window.location.href);return l.searchParams.set(e.mapViewQueryParam,r),s.setAttribute("href",l.toString()),s.addEventListener("click",function(e){e.preventDefault(),n(e)}),s}(this.config,this.rootEl,function(t){e._handleButtonClick(t)})),this._hybridBehaviourCleanup=function(e){var t=e.config,n=t.behaviour,r=t.hybridWidth,o=t.maxMobileWidth;if("buttonFirst"===n&&e._breakpointDetector.subscribe(function(){P(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),s=function(){if(P(e.config))if(e._isHidden)e.showApp();else if(null==e._root)e.loadApp();else{var t=A(e).isFullscreen;e.eventBus.emit(x.APP_FULLSCREEN_CHANGE,{isFullscreen:t})}else e._root&&e.hideApp()};return a.addEventListener("change",s),function(){return a.removeEventListener("change",s)}}return null}(this),P(this.config)?(k(this.config)||(A(this,{isFullscreen:!1}),S()),this.loadApp()):S()}},{key:"_handleButtonClick",value:function(e){var t;this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp(),null===(t=this.rootEl.querySelector('[role="application"]'))||void 0===t||t.focus()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.loadApp({focusOnMount:!0}))}},{key:"_removeMapParamFromUrl",value:function(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,function(e,t){return"&"===t?"?":""}).replace(/\?$/,""):e}},{key:"_handleExitClick",value:function(){var e,t=this;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(function(){t._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var n=this.config.mapViewQueryParam,r=this._removeMapParamFromUrl(location.href,n);history.replaceState(history.state,"",r)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}},{key:"loadApp",value:(X=(0,l.A)((0,s.A)().m(function e(){var t,r,o,i,a,l,u,c,h,p,f,m,v,g,_=this,y=arguments;return(0,s.A)().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=(y.length>0&&void 0!==y[0]?y[0]:{}).focusOnMount,r=void 0!==t&&t,!this._root&&!this._isLoading){e.n=1;break}return e.a(2);case 1:return this._isLoading=!0,this._openButton&&(this._openButton.style.display="none"),e.p=2,e.n=3,Promise.all([n.e(402),n.e(935)]).then(n.bind(n,967));case 3:return o=e.v,i=o.initialiseApp,e.n=4,this.config.mapProvider.load();case 4:return a=e.v,l=a.MapProvider,u=a.mapFramework,c=a.mapProviderConfig,this.config.reverseGeocodeProvider&&G(this.config.reverseGeocodeProvider,c.crs),e.n=5,i(this.rootEl,(0,d.A)((0,d.A)({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:D(),focusOnMount:r},this.config),{},{MapProvider:l,mapProviderConfig:c,mapFramework:u,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 5:h=e.v,this._root=h._root,delete h._root,p=new Set(["on","off","emit"]),Object.keys(h).forEach(function(e){p.has(e)||(_[e]=h[e])}),f=A(this),m=f.isFullscreen,this.eventBus.emit(x.APP_OPENED,{statePreserved:!1,isFullscreen:m}),e.n=7;break;case 6:throw e.p=6,g=e.v,null===(v=this._openButton)||void 0===v||v.removeAttribute("style"),b(this.rootEl,this.config.genericErrorText),console.error(g),g;case 7:return e.p=7,this._isLoading=!1,e.f(7);case 8:return e.a(2)}},e,this,[[2,6,7,8]])})),function(){return X.apply(this,arguments)})},{key:"removeApp",value:function(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),A(this,{isFullscreen:!1}),this.eventBus.emit(x.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(x.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",E({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(x.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none");var e=A(this).isFullscreen;this.eventBus.emit(x.APP_OPENED,{statePreserved:!0,isFullscreen:e})}},{key:"destroy",value:function(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),function(e){g.delete(e.id),0===g.size&&(globalThis.removeEventListener("popstate",v),_=!1)}(this),this.eventBus.destroy()}},{key:"on",value:function(){var e;(e=this.eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this.eventBus).off.apply(e,arguments)}},{key:"emit",value:function(){var e;(e=this.eventBus).emit.apply(e,arguments)}},{key:"addMarker",value:function(e,t,n){this.eventBus.emit(x.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"updateMarker",value:function(e,t){this.eventBus.emit(x.APP_UPDATE_MARKER,{id:e,options:t})}},{key:"removeMarker",value:function(e){this.eventBus.emit(x.APP_REMOVE_MARKER,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(x.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(x.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"setContinueEnabled",value:function(e){this.toggleButtonState("journeyContinue","disabled",!e)}},{key:"addPanel",value:function(e,t){this.eventBus.emit(x.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(x.APP_REMOVE_PANEL,e)}},{key:"showPanel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.focus,r=void 0===n||n,o=t.triggeringElement,i=null!=o?o:document.activeElement&&document.activeElement!==document.body?document.activeElement:void 0;this.eventBus.emit(x.APP_SHOW_PANEL,{id:e,focus:r,triggeringElement:i})}},{key:"hidePanel",value:function(e){this.eventBus.emit(x.APP_HIDE_PANEL,e)}},{key:"setApplicationMode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.include,r=void 0===n?null:n,o=t.exclude,i=void 0===o?null:o;this.eventBus.emit(x.APP_SET_APPLICATION_MODE,{id:e,include:r,exclude:i})}},{key:"clearApplicationMode",value:function(e){this.eventBus.emit(x.APP_CLEAR_APPLICATION_MODE,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(x.APP_ADD_CONTROL,{id:e,config:t})}},{key:"showHint",value:function(e,t){this.eventBus.emit(x.APP_SHOW_HINT,{text:e,options:t})}},{key:"dismissHint",value:function(){this.eventBus.emit(x.APP_DISMISS_HINT)}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(x.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(x.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}])},647:(e,t,n)=>{n.d(t,{D:()=>x,m:()=>fe});var r=n(41),o=n(505),i=n(7),a=n(399),s=n(321),l=n(893);function u(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},d.apply(null,arguments)}function h(e,t,n,r){var o=d(c(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=n(974);function m(e,t,n){return t=c(t),function(e,t){if(t&&("object"==(0,f.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}var _=n(590);function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||(0,_.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b,w,E=n(307),k=n(839),A=n(781),S=n(452),T=n(247),N=["marker"],x={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"},P="search",M={TOGGLE_EXPANDED:function(e,t){return(0,A.A)((0,A.A)({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_KEYBOARD_FOCUS_WITHIN:function(e,t){return(0,A.A)((0,A.A)({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0})},INPUT_BLUR:function(e,t){return(0,A.A)((0,A.A)({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1})},SET_VALUE:function(e,t){return(0,A.A)((0,A.A)({},e),{},{value:t})},UPDATE_SUGGESTIONS:function(e,t){return(0,A.A)((0,A.A)({},e),{},{suggestions:t.results,hasFetchedSuggestions:!0,hasSearchError:t.hasError})},SHOW_SUGGESTIONS:function(e){return(0,A.A)((0,A.A)({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1})},HIDE_SUGGESTIONS:function(e){return(0,A.A)((0,A.A)({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_SELECTED:function(e,t){return(0,A.A)((0,A.A)({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})}},L=/^<\/?mark>$/i,C=function(){var e=!1,t=0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/(<\/?mark>)/i).flatMap(function(n){var r=t;return t+=n.length,L.test(n)?(e="/"!==n[1],[]):n?[e?(0,T.Y)("mark",{children:n},r):n]:[]})},O=function(e){var t=e.id,n=e.pluginState,r=e.handleSuggestionClick;return(0,T.Y)("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search-input"),className:"im-c-search-suggestions",style:n.areSuggestionsVisible&&n.suggestions.length?void 0:{display:"none"},onMouseDown:function(e){return e.preventDefault()},children:n.suggestions.map(function(e,o){return(0,T.Y)("li",{id:"".concat(t,"-search-suggestion-").concat(o),className:"im-c-search-suggestions__item",role:"option","aria-selected":n.selectedIndex===o,"aria-setsize":n.suggestions.length,"aria-posinset":o+1,onClick:function(){return r(e)},children:(0,T.Y)("span",{className:"im-c-search-suggestions__label",children:C(e.marked)})},"".concat(t,"-").concat(e.type,"-").concat(e.id))})})},$=function(e,t,n){return(0,A.A)({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==n.breakpoint&&(null==e?void 0:e.width)&&{width:e.width})},I=function(e){var t=e.id,n=e.pluginState,r=e.pluginConfig,o=e.appState,i=e.inputRef,a=e.events,s=e.services,l=e.children,u=n.areSuggestionsVisible,c=n.hasFetchedSuggestions,d=n.hasSearchError,h=n.suggestions,p=void 0===h?[]:h,f=r.noResultsMessage,m=r.searchErrorMessage;(0,S.vJ)(function(){u&&c&&s.announce(function(e,t,n,r){if(t)return n;if(0===e)return r;var o=1===e?"result":"results";return"".concat(e," ").concat(o," available")}(p.length,d,m,f))},[p,c]);var v=["im-c-search-form",r.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),g=u&&c&&(d||!p.length);return(0,T.FD)("form",{id:"".concat(t,"-search-form"),role:"search",className:v,style:$(r,n,o),"aria-controls":"".concat(t,"-viewport"),onSubmit:function(e){return a.handleSubmit(e,o,n)},children:[(0,T.Y)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,T.FD)("div",{className:"im-c-search__input-container".concat(n.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,T.Y)("label",{htmlFor:"".concat(t,"-search-input"),className:"im-u-visually-hidden",children:r.placeholder}),(0,T.Y)("input",{id:"".concat(t,"-search-input"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":n.suggestionsVisible,"aria-controls":"".concat(t,"-search-suggestions"),"aria-activedescendant":n.selectedIndex>=0?"".concat(t,"-search-suggestion-").concat(n.selectedIndex):void 0,"aria-describedby":n.value?void 0:"".concat(t,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:r.placeholder,name:"".concat(t,"-search-input"),spellCheck:!1,enterKeyHint:"search",value:n.value,onClick:a.handleInputClick,onChange:function(e){return a.handleInputChange(e,n)},onFocus:function(){return a.handleInputFocus(o.interfaceType)},onBlur:function(){return a.handleInputBlur(o.interfaceType)},onKeyDown:function(e){return a.handleInputKeyDown(e,n)},ref:i}),(0,T.Y)("span",{id:"".concat(t,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),l]}),g&&(0,T.Y)("div",{className:"im-c-search__status","aria-hidden":"true",children:d?m:f}),(0,T.Y)(O,{id:t,appState:o,pluginState:n,handleSuggestionClick:function(e){return a.handleSuggestionClick(e,o)}})]})},R=function(e){var t=e.defaultExpanded,n=e.onClick,r=e.closeIcon;return(0,T.Y)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:n,style:t?{display:"none"}:void 0,children:r&&(0,T.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})},D=function(e){var t=e.defaultExpanded,n=e.submitIcon;return(0,T.Y)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:n&&(0,T.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})},F=" ",B=function(){function e(){(0,E.A)(this,e)}return(0,k.A)(e,null,[{key:"separator",get:function(){return F},set:function(e){F=e}},{key:"parse",value:function(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);var t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;var n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}},{key:"toDms",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(n){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:n="d",r=4}t=Math.abs(t);var o=null,i=null,a=null,s=null;switch(n){default:case"d":case"deg":(i=t.toFixed(r))<100&&(i="0"+i),i<10&&(i="0"+i),o=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),60==(a=(60*t%60).toFixed(r))&&(a=(0).toFixed(r),i++),a<10&&(a="0"+a),o=(i=("000"+i).slice(-3))+"°"+e.separator+a+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),a=Math.floor(3600*t/60)%60,60==(s=(3600*t%60).toFixed(r))&&(s=(0).toFixed(r),a++),60==a&&(a=0,i++),i=("000"+i).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),o=i+"°"+e.separator+a+"′"+e.separator+s+"″"}return o}},{key:"toLat",value:function(t,n,r){var o=e.toDms(e.wrap90(t),n,r);return null===o?"–":o.slice(1)+e.separator+(t<0?"S":"N")}},{key:"toLon",value:function(t,n,r){var o=e.toDms(e.wrap180(t),n,r);return null===o?"–":o+e.separator+(t<0?"W":"E")}},{key:"toBrng",value:function(t,n,r){var o=e.toDms(e.wrap360(t),n,r);return null===o?"–":o.replace("360","0")}},{key:"fromLocale",value:function(e){var t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}},{key:"toLocale",value:function(e){var t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}},{key:"compassPoint",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(![1,2,3].includes(Number(n)))throw new RangeError("invalid precision ‘".concat(n,"’"));t=e.wrap360(t);var r=4*Math.pow(2,n-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}},{key:"wrap90",value:function(e){if(-90<=e&&e<=90)return e;var t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}},{key:"wrap180",value:function(e){if(-180<=e&&e<=180)return e;var t=360;return((360*e/t-180)%t+t)%t-180}},{key:"wrap360",value:function(e){if(0<=e&&e<360)return e;var t=360;return(360*e/t%t+t)%t}}])}();Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var G=function(){function e(t,n,r){if((0,E.A)(this,e),isNaN(t)||isNaN(n)||isNaN(r))throw new TypeError("invalid vector [".concat(t,",").concat(n,",").concat(r,"]"));this.x=Number(t),this.y=Number(n),this.z=Number(r)}return(0,k.A)(e,[{key:"length",get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"plus",value:function(t){if(!(t instanceof e))throw new TypeError("v is not Vector3d object");return new e(this.x+t.x,this.y+t.y,this.z+t.z)}},{key:"minus",value:function(t){if(!(t instanceof e))throw new TypeError("v is not Vector3d object");return new e(this.x-t.x,this.y-t.y,this.z-t.z)}},{key:"times",value:function(t){if(isNaN(t))throw new TypeError("invalid scalar value ‘".concat(t,"’"));return new e(this.x*t,this.y*t,this.z*t)}},{key:"dividedBy",value:function(t){if(isNaN(t))throw new TypeError("invalid scalar value ‘".concat(t,"’"));return new e(this.x/t,this.y/t,this.z/t)}},{key:"dot",value:function(t){if(!(t instanceof e))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"cross",value:function(t){if(!(t instanceof e))throw new TypeError("v is not Vector3d object");return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}},{key:"negate",value:function(){return new e(-this.x,-this.y,-this.z)}},{key:"unit",value:function(){var t=this.length;return 1==t||0==t?this:new e(this.x/t,this.y/t,this.z/t)}},{key:"angleTo",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!(t instanceof e))throw new TypeError("v is not Vector3d object");if(!(n instanceof e||null==n))throw new TypeError("n is not Vector3d object");var r=null==n||this.cross(t).dot(n)>=0?1:-1,o=this.cross(t).length*r,i=this.dot(t);return Math.atan2(o,i)}},{key:"rotateAround",value:function(t,n){if(!(t instanceof e))throw new TypeError("axis is not Vector3d object");var r=n.toRadians(),o=this.unit(),i=t.unit(),a=Math.sin(r),s=Math.cos(r),l=1-s,u=i.x,c=i.y,d=i.z,h=[[l*u*u+s,l*u*c-a*d,l*u*d+a*c],[l*u*c+a*d,l*c*c+s,l*c*d-a*u],[l*u*d-a*c,l*c*d+a*u,l*d*d+s]],p=[h[0][0]*o.x+h[0][1]*o.y+h[0][2]*o.z,h[1][0]*o.x+h[1][1]*o.y+h[1][2]*o.z,h[2][0]*o.x+h[2][1]*o.y+h[2][2]*o.z];return new e(p[0],p[1],p[2])}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return"[".concat(this.x.toFixed(e),",").concat(this.y.toFixed(e),",").concat(this.z.toFixed(e),"]")}}])}();Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var j={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},W={WGS84:{ellipsoid:j.WGS84}};Object.freeze(j.WGS84),Object.freeze(W.WGS84);var U=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,E.A)(this,e),isNaN(t)||null==t)throw new TypeError("invalid lat ‘".concat(t,"’"));if(isNaN(n)||null==n)throw new TypeError("invalid lon ‘".concat(n,"’"));if(isNaN(r)||null==r)throw new TypeError("invalid height ‘".concat(r,"’"));this._lat=B.wrap90(Number(t)),this._lon=B.wrap180(Number(n)),this._height=Number(r)}return(0,k.A)(e,[{key:"lat",get:function(){return this._lat},set:function(e){if(this._lat=isNaN(e)?B.wrap90(B.parse(e)):B.wrap90(Number(e)),isNaN(this._lat))throw new TypeError("invalid lat ‘".concat(e,"’"))}},{key:"latitude",get:function(){return this._lat},set:function(e){if(this._lat=isNaN(e)?B.wrap90(B.parse(e)):B.wrap90(Number(e)),isNaN(this._lat))throw new TypeError("invalid latitude ‘".concat(e,"’"))}},{key:"lon",get:function(){return this._lon},set:function(e){if(this._lon=isNaN(e)?B.wrap180(B.parse(e)):B.wrap180(Number(e)),isNaN(this._lon))throw new TypeError("invalid lon ‘".concat(e,"’"))}},{key:"lng",get:function(){return this._lon},set:function(e){if(this._lon=isNaN(e)?B.wrap180(B.parse(e)):B.wrap180(Number(e)),isNaN(this._lon))throw new TypeError("invalid lng ‘".concat(e,"’"))}},{key:"longitude",get:function(){return this._lon},set:function(e){if(this._lon=isNaN(e)?B.wrap180(B.parse(e)):B.wrap180(Number(e)),isNaN(this._lon))throw new TypeError("invalid longitude ‘".concat(e,"’"))}},{key:"height",get:function(){return this._height},set:function(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError("invalid height ‘".concat(e,"’"))}},{key:"datum",get:function(){return this._datum},set:function(e){this._datum=e}},{key:"toCartesian",value:function(){var e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:j.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,o=e.a,i=e.f,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new H((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}},{key:"equals",value:function(t){if(!(t instanceof e))throw new TypeError("invalid point ‘".concat(t,"’"));return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"d",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!["d","dm","dms","n"].includes(e))throw new RangeError("invalid format ‘".concat(e,"’"));var r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";if("n"==e){null==t&&(t=4);var o=this.lat.toFixed(t),i=this.lon.toFixed(t);return"".concat(o,", ").concat(i).concat(null==n?"":r)}var a=B.toLat(this.lat,e,t),s=B.toLon(this.lon,e,t);return"".concat(a,", ").concat(s).concat(null==n?"":r)}}],[{key:"ellipsoids",get:function(){return j}},{key:"datums",get:function(){return W}},{key:"parse",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0==t.length)throw new TypeError("invalid (empty) point");var r=void 0,o=void 0,i=void 0;if("object"==(0,f.A)(t[0])&&(1==t.length||!isNaN(parseFloat(t[1])))){var a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)){var s=y(a.coordinates,3);o=s[0],r=s[1],i=(i=s[2])||0}else null!=a.latitude&&(r=a.latitude),null!=a.lat&&(r=a.lat),null!=a.longitude&&(o=a.longitude),null!=a.lng&&(o=a.lng),null!=a.lon&&(o=a.lon),null!=a.height&&(i=a.height),r=B.wrap90(B.parse(r)),o=B.wrap180(B.parse(o));if(null!=t[1]&&(i=t[1]),isNaN(r)||isNaN(o))throw new TypeError("invalid point ‘".concat(JSON.stringify(t[0]),"’"))}if("string"==typeof t[0]&&2==t[0].split(",").length){var l=y(t[0].split(","),2);if(r=l[0],o=l[1],r=B.wrap90(B.parse(r)),o=B.wrap180(B.parse(o)),i=t[1]||0,isNaN(r)||isNaN(o))throw new TypeError("invalid point ‘".concat(t[0],"’"))}if(null==r&&null==o&&(r=t[0],o=t[1],r=B.wrap90(B.parse(r)),o=B.wrap180(B.parse(o)),i=t[2]||0,isNaN(r)||isNaN(o)))throw new TypeError("invalid point ‘".concat(t.toString(),"’"));return new this(r,o,i)}}])}(),H=function(){function e(t,n,r){return(0,E.A)(this,e),m(this,e,[t,n,r])}return g(e,G),(0,k.A)(e,[{key:"toLatLon",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j.WGS84;if(!e||!e.a)throw new TypeError("invalid ellipsoid ‘".concat(e,"’"));var t=this.x,n=this.y,r=this.z,o=e.a,i=e.b,a=e.f,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),h=d/c,p=isNaN(h)?0:Math.atan2(r+l*i*d*d*d,u-s*o*h*h*h),f=Math.atan2(n,t),m=Math.sin(p),v=u*Math.cos(p)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new U(p.toDegrees(),f.toDegrees(),v)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.x.toFixed(e),n=this.y.toFixed(e),r=this.z.toFixed(e);return"[".concat(t,",").concat(n,",").concat(r,"]")}}])}(),q={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},V={ED50:{ellipsoid:q.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:q.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:q.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:q.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:q.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:q.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:q.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:q.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:q.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:q.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:q.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(q).forEach(function(e){return Object.freeze(q[e])}),Object.keys(V).forEach(function(e){Object.freeze(V[e]),Object.freeze(V[e].transform)});var z,Y=function(){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:V.WGS84;if((0,E.A)(this,e),!i||null==i.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(i,"’"));return(r=m(this,e,[t,n,o]))._datum=i,r}return g(e,U),(0,k.A)(e,[{key:"datum",get:function(){return this._datum}},{key:"convertDatum",value:function(e){if(!e||null==e.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(e,"’"));return this.toCartesian().convertDatum(e).toLatLon()}},{key:"toCartesian",value:function(){var t=h(e,"toCartesian",this,3)([]);return new K(t.x,t.y,t.z,this.datum)}}],[{key:"ellipsoids",get:function(){return q}},{key:"datums",get:function(){return V}},{key:"parse",value:function(){for(var t=V.WGS84,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];if((4==r.length||3==r.length&&"object"==(0,f.A)(r[2]))&&(t=r.pop()),!t||null==t.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(t,"’"));var i=h(e,"parse",this,2)(r);return i._datum=t,i}}])}(),K=function(){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;if((0,E.A)(this,e),i&&null==i.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(i,"’"));return o=m(this,e,[t,n,r]),i&&(o._datum=i),o}return g(e,H),(0,k.A)(e,[{key:"datum",get:function(){return this._datum},set:function(e){if(!e||null==e.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(e,"’"));this._datum=e}},{key:"toLatLon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);var n=this.datum||V.WGS84;if(!n||null==n.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(n,"’"));var r=h(e,"toLatLon",this,3)([n.ellipsoid]);return new Y(r.lat,r.lon,r.height,this.datum)}},{key:"convertDatum",value:function(e){if(!e||null==e.ellipsoid)throw new TypeError("unrecognised datum ‘".concat(e,"’"));if(!this.datum)throw new TypeError("cartesian coordinate has no datum");var t=null,n=null;null!=this.datum&&this.datum!=V.WGS84||(t=this,n=e.transform),e==V.WGS84&&(t=this,n=this.datum.transform.map(function(e){return-e})),null==n&&(t=this.convertDatum(V.WGS84),n=e.transform);var r=t.applyTransform(n);return r.datum=e,r}},{key:"applyTransform",value:function(t){var n=this.x,r=this.y,o=this.z,i=t[0],a=t[1],s=t[2],l=t[3]/1e6+1,u=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),d=(t[6]/3600).toRadians();return new e(i+n*l-r*d+o*c,a+n*d+r*l-o*u,s-n*c+r*u+o*l)}}])}(),Z={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:Y.ellipsoids.Airy1830},X=function(){function e(t,n){if((0,E.A)(this,e),this.easting=Number(t),this.northing=Number(n),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError("invalid easting ‘".concat(t,"’"));if(isNaN(n)||this.northing<0||this.northing>13e5)throw new RangeError("invalid northing ‘".concat(n,"’"))}return(0,k.A)(e,[{key:"toLatLon",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y.datums.WGS84,t=this.easting,n=this.northing,r=Z.ellipsoid,o=r.a,i=r.b,a=Z.trueOrigin.lat.toRadians(),s=Z.trueOrigin.lon.toRadians(),l=-1e5,u=Z.scaleFactor,c=1-i*i/(o*o),d=(o-i)/(o+i),h=d*d,p=d*d*d,f=a,m=0;do{m=i*u*((1+d+5/4*h+5/4*p)*((f=(n-l-m)/(o*u)+f)-a)-(3*d+3*d*d+21/8*p)*Math.sin(f-a)*Math.cos(f+a)+(15/8*h+15/8*p)*Math.sin(2*(f-a))*Math.cos(2*(f+a))-35/24*p*Math.sin(3*(f-a))*Math.cos(3*(f+a)))}while(Math.abs(n-l-m)>=1e-5);var v=Math.cos(f),g=Math.sin(f),_=o*u/Math.sqrt(1-c*g*g),y=o*u*(1-c)/Math.pow(1-c*g*g,1.5),b=_/y-1,w=Math.tan(f),E=w*w,k=E*E,A=1/v,S=_*_*_,T=S*_*_,N=t-4e5,x=N*N,P=x*N,M=x*x,L=P*x,C=s+A/_*N-A/(6*S)*(_/y+2*E)*P+A/(120*T)*(5+28*E+24*k)*L-A/(T*_*_*5040)*(61+662*E+1320*k+k*E*720)*(L*x),O=new J((f=f-w/(2*y*_)*x+w/(24*y*S)*(5+3*E+b-9*E*b)*M-w/(720*y*T)*(61+90*E+45*k)*(M*x)).toDegrees(),C.toDegrees(),0,Y.datums.OSGB36);return e!=Y.datums.OSGB36&&(O=O.convertDatum(e),O=new J(O.lat,O.lon,O.height,O.datum)),O}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError("invalid precision ‘".concat(e,"’"));var t=this.easting,n=this.northing;if(0==e){var r={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3},o=t.toLocaleString("en",r),i=n.toLocaleString("en",r);return"".concat(o,",").concat(i)}var a=Math.floor(t/1e5),s=Math.floor(n/1e5),l=19-s-(19-s)%5+Math.floor((a+10)/5),u=5*(19-s)%25+a%5;l>7&&l++,u>7&&u++;var c=String.fromCharCode(l+"A".charCodeAt(0),u+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),"".concat(c," ").concat(t," ").concat(n)}}],[{key:"parse",value:function(t){var n=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(n)return new e(n[1],n[2]);if(!(n=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i)))throw new Error("invalid grid reference ‘".concat(t,"’"));var r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),o=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,o>7&&o--;var i=(r-2)%5*5+o%5,a=19-5*Math.floor(r/5)-Math.floor(o/5),s=t.slice(2).trim().split(/\s+/);if(1==s.length&&(s=[s[0].slice(0,s[0].length/2),s[0].slice(s[0].length/2)]),s[0].length!=s[1].length)throw new Error("invalid grid reference ‘".concat(t,"’"));return s[0]=s[0].padEnd(5,"0"),s[1]=s[1].padEnd(5,"0"),new e(i+s[0],a+s[1])}}])}(),J=function(){function e(){return(0,E.A)(this,e),m(this,e,arguments)}return g(e,Y),(0,k.A)(e,[{key:"toOsGrid",value:function(){var e=this.datum==Y.datums.OSGB36?this:this.convertDatum(Y.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),r=Z.ellipsoid,o=r.a,i=r.b,a=Z.trueOrigin.lat.toRadians(),s=Z.trueOrigin.lon.toRadians(),l=Z.scaleFactor,u=1-i*i/(o*o),c=(o-i)/(o+i),d=c*c,h=c*c*c,p=Math.cos(t),f=Math.sin(t),m=o*l/Math.sqrt(1-u*f*f),v=o*l*(1-u)/Math.pow(1-u*f*f,1.5),g=m/v-1,_=i*l*((1+c+5/4*d+5/4*h)*(t-a)-(3*c+3*c*c+21/8*h)*Math.sin(t-a)*Math.cos(t+a)+(15/8*d+15/8*h)*Math.sin(2*(t-a))*Math.cos(2*(t+a))-35/24*h*Math.sin(3*(t-a))*Math.cos(3*(t+a))),y=p*p*p,b=y*p*p,w=Math.tan(t)*Math.tan(t),E=w*w,k=n-s,A=k*k,S=A*k,T=S*k,N=T*k,x=_+-1e5+m/2*f*p*A+m/24*f*y*(5-w+9*g)*T+m/720*f*b*(61-58*w+E)*(N*k),P=4e5+m*p*k+m/6*y*(m/v-w)*S+m/120*b*(5-18*w+E+14*g-58*w*g)*N;x=Number(x.toFixed(3)),P=Number(P.toFixed(3));try{return new X(P,x)}catch(t){throw new Error("".concat(t.message," from (").concat(e.lat.toFixed(6),",").concat(e.lon.toFixed(6),").toOsGrid()"))}}},{key:"convertDatum",value:function(t){var n=h(e,"convertDatum",this,3)([t]);return new e(n.lat,n.lon,n.height,n.datum)}}])}(),Q=500,ee=function(e){var t=e.GAZETTEER_ENTRY,n="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=n,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},te=function(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw(b||(b=u(["$&"],["\\$&"]))))},ne=function(e,t){var n,r,o,i,a=t.MBR_XMIN,s=t.MBR_YMIN,l=t.MBR_XMAX,u=t.MBR_YMAX,c=t.GEOMETRY_X,d=t.GEOMETRY_Y;if(null==a?(n=c-Q,r=d-Q,o=c+Q,i=d+Q):(n=a,r=s,o=l,i=u),"EPSG:27700"===e)return[n,r,o,i];if("EPSG:4326"===e){var h=new X(n,r).toLatLon(),p=new X(o,i).toLatLon();return[h.lon,h.lat,p.lon,p.lat].map(function(e){return Math.round(1e6*e)/1e6})}throw new Error("Unsupported CRS: ".concat(e))},re=function(e,t){var n=t.GEOMETRY_X,r=t.GEOMETRY_Y;if("EPSG:27700"===e)return[n,r];if("EPSG:4326"===e){var o=new X(n,r).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},oe=function(e,t,n,r){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!e||e.error||0===(null===(o=e.header)||void 0===o?void 0:o.totalresults))return[];var a=e.results;return a=function(e,t){var n=t.toLowerCase().replaceAll(",","").split(" ");return e.map(ee).filter(function(e){return n.some(function(n){return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(n)||(r=(r=t).replaceAll(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(r));var r})})}(a,t),a=function(e,t){return e.filter(function(e){var n,r=null==e||null===(n=e.GAZETTEER_ENTRY)||void 0===n||null===(n=n.COUNTRY)||void 0===n?void 0:n.toLowerCase();return r&&t.includes(r)})}(a=function(e){return Array.from(new Map(e.map(function(e){return[e.GAZETTEER_ENTRY.ID,e]})).values())}(a),n),(a=a.slice(0,i)).map(function(e){return(0,A.A)((0,A.A)({id:e.GAZETTEER_ENTRY.ID,bounds:ne(r,e.GAZETTEER_ENTRY),point:re(r,e.GAZETTEER_ENTRY)},function(e,t){var n,r,o,i,a,s=t.NAME1,c=t.COUNTY_UNITARY,d=t.DISTRICT_BOROUGH,h=t.POSTCODE_DISTRICT,p=t.LOCAL_TYPE,f="".concat(["City","Postcode"].includes(p)?"":h+", ").concat("City"===p?"":c||d),m="".concat(s).concat(f?", "+f:"");return{text:m,marked:(n=m,r=e,o=r.replaceAll(/\s+/g,""),i=(0,l.A)(o).map(te).join(String.raw(w||(w=u(["s*"],["\\s*"])))),a=new RegExp("(".concat(i,")"),"i"),n.replace(a,"<mark>$1</mark>"))}}(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"})})},ie=function(e){return e.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim()},ae=function(e){var t=e.url,n=e.options;return new Request(t,n)},se=(z=(0,s.A)((0,a.A)().m(function e(t,n,r){var o,i,s,l;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:if(i={url:null===(o=t.urlTemplate)||void 0===o?void 0:o.replace("{query}",encodeURIComponent(n)),options:{method:"GET"}},!t.buildRequest){e.n=1;break}return s=t.buildRequest(n,function(){return i}),e.a(2,s instanceof Request?s:ae(s));case 1:if(!r){e.n=3;break}return l=ae,e.n=2,r(i,n);case 2:return e.a(2,l(e.v));case 3:return e.a(2,ae(i))}},e)})),function(e,t,n){return z.apply(this,arguments)}),le=function(){var e=(0,s.A)((0,a.A)().m(function e(t,n,r){var o,i,s;return(0,a.A)().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fetch(n);case 1:if((o=e.v).ok){e.n=2;break}return console.error("Fetch error for ".concat(t.label||"dataset",": ").concat(o.status)),e.a(2,{error:!0});case 2:return e.n=3,o.json();case 3:return i=e.v,e.a(2,t.parseResults(i,r));case 4:return e.p=4,s=e.v,console.error("Network error for ".concat(t.label||"dataset",":"),s),e.a(2,{error:!0})}},e,null,[[0,4]])}));return function(t,n,r){return e.apply(this,arguments)}}(),ue=function(){var e=(0,s.A)((0,a.A)().m(function e(t,n,r,o){var s,u,c,d,h,p,f,m,v,g;return(0,a.A)().w(function(e){for(;;)switch(e.p=e.n){case 0:s=ie(t),u=n.filter(function(e){var n=!e.includeRegex||e.includeRegex.test(t),r=!!e.excludeRegex&&e.excludeRegex.test(s);return n&&!r}),c=[],d=!1,h=(0,i.A)(u),e.p=1,h.s();case 2:if((p=h.n()).done){e.n=6;break}return f=p.value,e.n=3,se(f,s,o);case 3:return m=e.v,e.n=4,le(f,m,s);case 4:if(null!=(v=e.v)&&v.error?d=!0:null!=v&&v.length&&(c=[].concat((0,l.A)(c),(0,l.A)(v))),!f.exclusive||!c.length){e.n=5;break}return e.a(3,6);case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,g=e.v,h.e(g);case 8:return e.p=8,h.f(),e.f(8);case 9:return r({type:"UPDATE_SUGGESTIONS",payload:{results:c,hasError:d}}),e.a(2,{results:c,sanitisedValue:s})}},e,null,[[1,7,8,9]])}));return function(t,n,r,o){return e.apply(this,arguments)}}(),ce=function(e){var t=e.suggestion,n=e.query,r=e.services,o=e.mapProvider,i=e.markers,a=e.showMarker,s=e.markerOptions;r.focusMap({message:"Map moved to {query}".replace("{query}",n)}),function(e){var t=e.bounds,n=e.point,r=e.markers,o=e.showMarker,i=e.markerOptions;e.mapProvider.fitToBounds(t),o&&r.add("search",n,i)}({mapProvider:o,bounds:t.bounds,point:t.point,markers:i,showMarker:a,markerOptions:s}),r.eventBus.emit("search:match",(0,A.A)({query:n},t))},de=function(e){var t;return(null==e||null===(t=e.current)||void 0===t?void 0:t.search)||document.querySelector(".im-c-map-button--search")};function he(e){var t,n,r,o=e.dispatch,i=e.searchContainerRef,l=(t=function(t){return ue(t,e.datasets,o,e.transformRequest)},n=null,r=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout(function(){t.apply(void 0,r)},350)},r.cancel=function(){n&&(clearTimeout(n),n=null)},r),u=function(e){var t=e.dispatch,n=e.services,r=e.searchContainerRef,o=e.mapProvider,i=e.markers,l=e.datasets,u=e.transformRequest,c=e.showMarker,d=e.markerOptions,h="";return{handleTabOut:function(e,t){!function(e,t,n){var r,o=de(t);if("Tab"===e.key&&o){var i=Array.from(document.querySelectorAll("input, button, select, textarea, a[href], [tabindex]")).filter(function(e){return e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0}),a=i[i.indexOf(e.target)+(e.shiftKey?-1:1)];if(null===(r=n.current)||void 0===r||!r.contains(a)){var s=e.shiftKey?o:i[i.indexOf(o)+1];s&&(e.preventDefault(),s.focus())}}}(e,t,r)},handleCloseClick:function(e,r){var o,a,s;t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),t({type:"SET_VALUE",payload:""}),o=null==r?void 0:r.buttonRefs,a=0,s=function(){var e=de(o);e&&(e.focus(),document.activeElement===e)||a<30&&(a+=1,requestAnimationFrame(s))},requestAnimationFrame(s),i.remove("search"),n.eventBus.emit("search:clear"),n.eventBus.emit("search:close")},handleSubmit:function(e,r,p){return(0,s.A)((0,a.A)().m(function s(){var f,m,v,g,_,y,b,w,E;return(0,a.A)().w(function(a){for(;;)switch(a.n){case 0:if(e.preventDefault(),f=p.suggestions,m=p.selectedIndex,v=p.value,g=null==v?void 0:v.trim(),t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),!(m>=0)){a.n=1;break}return _=f[m],t({type:"SET_VALUE",payload:_.text}),ce({suggestion:_,query:_.text,services:n,mapProvider:o,markers:i,showMarker:c,markerOptions:d}),a.a(2);case 1:if(!((null==g?void 0:g.length)<x.minSearchLength)){a.n=2;break}return a.a(2);case 2:if(y=f,f.length&&g===h){a.n=4;break}return a.n=3,ue(g,l,t,u);case 3:b=a.v,w=b.results,E=b.sanitisedValue,y=w,h=E;case 4:y.length&&("mobile"===r.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close")),ce({suggestion:y[0],query:v,services:n,mapProvider:o,markers:i,showMarker:c,markerOptions:d}));case 5:return a.a(2)}},s)}))()}}}(e),c=function(e){var t=e.dispatch,n=e.debouncedFetchSuggestions;return{handleInputClick:function(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus:function(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur:function(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange:function(e,r){var o=e.target.value;if(t({type:"SET_VALUE",payload:o}),(null==r?void 0:r.selectedIndex)>=0&&(t({type:"SET_SELECTED",payload:-1}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0})),o.length<x.minSearchLength)return n.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),n(o)}}}((0,A.A)((0,A.A)({},e),{},{debouncedFetchSuggestions:l})),d=function(e){var t=e.dispatch,n=e.services,r=e.mapProvider,o=e.markers,i=e.showMarker,a=e.markerOptions,s=function(e,t){var n;return t>=0?"".concat(null===(n=e[t])||void 0===n?void 0:n.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick:function(e,s){t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===s.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close")),ce({suggestion:e,query:e.text,services:n,mapProvider:r,markers:o,showMarker:i,markerOptions:a})},handleInputKeyDown:function(e,r){var o=r.suggestions,i=r.selectedIndex;switch(e.key){case"ArrowDown":if(null==o||!o.length)return;if(e.preventDefault(),i<o.length-1){var a=i+1;n.announce(s(o,a)),t({type:"SET_SELECTED",payload:a}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;e.preventDefault();var l=i>0?i-1:-1;n.announce(s(o,l)),t({type:"SET_SELECTED",payload:l}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:l<0});break;case"Escape":e.preventDefault(),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}}(e);return(0,A.A)((0,A.A)((0,A.A)((0,A.A)({},u),c),d),{},{handleOutside:function(t){i.current.contains(t.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var pe={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:M},applicationModes:(0,r.A)({},P,{}),buttons:[{id:"search",label:"Search",iconId:"search",ariaControls:function(e){var t=e.appConfig;return"".concat(t.id,"-search-form")},expandedWhen:function(e){return e.pluginState.isExpanded},excludeWhen:function(e){var t=e.pluginConfig;return Boolean(t.expanded)},keepFocus:!0,onClick:function(e,t){var n=t.pluginState,r=t.services;n.dispatch({type:"TOGGLE_EXPANDED",payload:!0}),r.eventBus.emit("search:open")},mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1}}],controls:[{id:"search",mobile:{slot:"header"},tablet:{slot:"top-left"},desktop:{slot:"top-left"},render:function(e){var t=e.appConfig,n=e.iconRegistry,r=e.pluginState,i=e.pluginConfig,a=e.appState,s=e.mapState,u=e.services,c=e.mapProvider,d=e.setApplicationMode,h=e.clearApplicationMode,p=t.id,f=a.interfaceType,m=i.expanded,v=i.customDatasets,g=i.osNamesURL,_=i.regions,y=i.maxSuggestions,b=r.dispatch,w=r.isExpanded,E=r.areSuggestionsVisible,k=r.suggestions,x=n.close,M=n.search,L=(0,S.li)(null),C=(0,S.li)(null),O=a.layoutRefs.viewportRef,$=function(e){var t=e.customDatasets,n=void 0===t?[]:t,r=e.osNamesURL,o=e.crs,i=e.regions,a=void 0===i?["england","scotland","wales"]:i,s=e.maxSuggestions;return r?[].concat([{name:"osNames",urlTemplate:r,parseResults:function(e,t){return oe(e,t,a,o,s)},includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i}],(0,l.A)(n)):n}({customDatasets:v,osNamesURL:g,regions:_,maxSuggestions:y,crs:c.crs}),F=(0,S.li)(null);if(!F.current){var B=i.marker,G=(0,o.A)(i,N);F.current=he((0,A.A)({dispatch:b,datasets:$,services:u,mapProvider:c,searchContainerRef:L,markers:s.markers,markerOptions:B},G))}var j=F.current,W=w||!!(m&&E&&k.length);return(0,S.vJ)(function(){var e;w&&(null===(e=C.current)||void 0===e||e.focus())},[w]),(0,S.Nf)(function(){if(w)return d(P),function(){return h(P)}},[w]),(0,S.Nf)(function(){if(W)return O.current.style.pointerEvents="none",document.addEventListener("focusin",j.handleOutside),document.addEventListener("pointerdown",j.handleOutside),function(){O.current.style.pointerEvents="auto",document.removeEventListener("focusin",j.handleOutside),document.removeEventListener("pointerdown",j.handleOutside)}},[w,f,E,k]),(0,T.Y)("div",{className:"im-c-search".concat(m||w?"":" im-c-search--collapsed"),ref:L,onKeyDown:function(e){return j.handleTabOut(e,a.buttonRefs)},children:(0,T.FD)(I,{id:p,pluginState:r,pluginConfig:i,appState:a,inputRef:C,events:j,services:u,children:[(0,T.Y)(R,{defaultExpanded:m,onClick:function(e){return j.handleCloseClick(e,a)},closeIcon:x}),(0,T.Y)(D,{defaultExpanded:m,submitIcon:M})]})})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]},fe=Object.freeze({__proto__:null,manifest:pe})}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}function a(e){const t=e.currentTarget;if("true"===t.dataset.debouncing)return e.preventDefault(),void e.stopImmediatePropagation();t.dataset.debouncing="true",setTimeout(()=>{delete t.dataset.debouncing},1e4)}function s(e){a(e)}function l(e){"Enter"!==e.key&&" "!==e.key||a(e)}i.m=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"javascripts/"+{7:"vendor/accessible-autocomplete",264:"vendor/maplibre-gl",402:"vendor/@defra",935:"im-core"}[e]+".min.js",i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i.l=(e,t,r,o)=>{if(n[e])n[e].push(t);else{var a,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==e){a=c;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.src=e),n[e]=[t];var d=(t,r)=>{a.onerror=a.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(e=>e(r)),t)return t(r)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{i.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={804:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var a=i.p+i.u(t),s=new Error;i.l(a,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,a=n[0],s=n[1],l=n[2],u=0;if(a.some(t=>0!==e[t])){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);l&&l(i)}for(t&&t(n);u<a.length;u++)o=a[u],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();const u="aria-describedby",c="error-summary-title";function d(e,t,n){var r;const o=document.getElementById("uploadedFilesContainer"),i=o?o.closest("form"):null;if(!(i&&i instanceof HTMLFormElement))return;const a=i.querySelector("p.govuk-body");if(!a)return;const s=function(e,t){let n=null==e?void 0:e.querySelector("#statusInformation");if(!n){n=document.createElement("div"),n.id="statusInformation",n.className="govuk-visually-hidden",n.setAttribute("aria-live","polite");try{!function(e,t,n){var r;null!=t&&t.nextSibling&&t.parentNode===e?e.insertBefore(n,t.nextSibling):(null!=(r=null==t?void 0:t.parentNode)?r:e).appendChild(n)}(e,t,n)}catch(r){try{null==e||e.appendChild(n)}catch(o){document.body.appendChild(n)}}}return n}(i,a),l=n.querySelector('input[type="file"]');l&&l.setAttribute(u,"statusInformation");const c=function(e,t){let n=e.querySelector("dl.govuk-summary-list");if(!n){n=document.createElement("dl"),n.className="govuk-summary-list govuk-summary-list--long-key";const r=e.querySelector(".govuk-button-group");r?e.insertBefore(n,r):e.insertBefore(n,t.nextSibling)}return n}(i,a),d=document.querySelector(`[data-filename="${null==e?void 0:e.name}"]`);d&&d.remove();const h=function(e,t){var n,r;const o=document.createElement("div");return o.className="govuk-summary-list__row",o.setAttribute("data-filename",null!=(n=null==e?void 0:e.name)?n:""),o.innerHTML=`\n <dt class="govuk-summary-list__key">\n ${null!=(r=null==e?void 0:e.name)?r:""}\n </dt>\n <dd class="govuk-summary-list__value">\n <strong class="govuk-tag govuk-tag--yellow">${t}</strong>\n </dd>\n <dd class="govuk-summary-list__actions">\n </dd>\n `,o}(e,t);c.insertBefore(h,c.firstChild),s.textContent=`${null!=(r=null==e?void 0:e.name)?r:""} ${t}`}function h(e,t,n){if(document.querySelector(".govuk-error-summary"))return void(document.getElementById(c)?n.setAttribute(u,c):n.removeAttribute(u));t&&(t.innerHTML=`\n <div class="govuk-error-summary" data-module="govuk-error-summary">\n <div role="alert">\n <h2 class="govuk-error-summary__title" id="${c}">\n There is a problem\n </h2>\n <div class="govuk-error-summary__body">\n <ul class="govuk-list govuk-error-summary__list">\n <li>\n <a href="#file-upload">${e}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n `,n.setAttribute(u,c));const r=n.closest(".govuk-form-group");if(r){r.classList.add("govuk-form-group--error"),n.classList.add("govuk-file-upload--error");const t=n.id;let o=document.getElementById(`${t}-error`);o||(o=document.createElement("p"),o.id=`${t}-error`,o.className="govuk-error-message",o.innerHTML=`<span class="govuk-visually-hidden">Error:</span> ${e}`,r.insertBefore(o,n)),n.setAttribute(u,`error-summary-title ${t}-error`)}}function p(){window.history.replaceState(null,"",window.location.href),window.location.href=window.location.pathname}function f(){var e,t,n;const r=document.querySelector('form:has(input[type="file"])'),o=r?r.querySelector('input[type="file"]'):null,i=r?r.querySelector(".upload-file-button"):null,a=null!=(e=Array.from(document.querySelectorAll("button.govuk-button")).find(e=>"Continue"===e.textContent.trim()))?e:null,s=document.querySelector(".govuk-error-summary-container");if(!r||!o||!i)return;const l=null!=(t=null==(n=document.getElementById("uploadedFilesContainer"))?void 0:n.dataset.uploadinglabel)?t:"Uploading…",u=r;let c=[],f=!1;const m=u.dataset.uploadId;o.addEventListener("change",()=>{s&&(s.innerHTML=""),o.files&&o.files.length>0&&(c=Array.from(o.files),i.click())}),i.addEventListener("click",e=>{if(0===c.length)return e.preventDefault(),void h("Select a file",s,o);f?e.preventDefault():(f=!0,function(e,t,n,r,o,i){for(let a=o.length-1;a>=0;a--)d(o[a],i,e);t.focus(),setTimeout(()=>{t.disabled=!0,n.disabled=!0,r.disabled=!0},100)}(u,o,i,a,c,l),function(e,t,n,r,o,i){var a;if(!t.action||!i)return!1;e.preventDefault();const s=new FormData(t),l=!!t.dataset.proxyUrl,u=null!=(a=t.dataset.proxyUrl)?a:t.action,c={method:"POST",body:s,redirect:l?"follow":"manual"};l&&(c.mode="no-cors"),fetch(u,c).then(()=>{!function(e){let t=0;const n=setInterval(()=>{if(t++,t>=300)return clearInterval(n),void p();const r=function(e,t){const n=e.replace(/\/preview\/(draft|live)/g,"").replace(/\/{2,}/g,"/").replace(/\/$/,"").split("/").filter(Boolean);return`${n.length>2?`/${n.slice(0,n.length-2).join("/")}`:""}/upload-status/${t}`}(window.location.pathname,e);fetch(r,{headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>{"ready"===e.uploadStatus&&(clearInterval(n),p())}).catch(()=>{clearInterval(n),p()})},1e3)}(i)}).catch(()=>(n.disabled=!1,r.disabled=!1,h("There was a problem uploading the file",o,n),null))}(e,u,o,i,s,m))})}function m(e,t={}){var n;const r=e.getAttribute("tabindex");function o(){var n;null==(n=t.onBlur)||n.call(e),r||e.removeAttribute("tabindex")}r||e.setAttribute("tabindex","-1"),e.addEventListener("focus",function(){e.addEventListener("blur",o,{once:!0})},{once:!0}),null==(n=t.onBeforeFocus)||n.call(e),e.focus()}function v(e=document.body){return!!e&&e.classList.contains("govuk-frontend-supported")}function g(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function _(e){return!!e&&(e instanceof Element||e instanceof Document)}function y(e,t){return`${e.moduleName}: ${t}`}class b extends Error{constructor(...e){super(...e),this.name="GOVUKFrontendError"}}class w extends b{constructor(e=document.body){const t="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(e?t:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class E extends b{constructor(...e){super(...e),this.name="ConfigError"}}class k extends b{constructor(e){let t="string"==typeof e?e:"";if(g(e)){const{component:n,identifier:r,element:o,expectedType:i}=e;t=r,t+=o?` is not of type ${null!=i?i:"HTMLElement"}`:" not found",n&&(t=y(n,t))}super(t),this.name="ElementError"}}class A extends b{constructor(e){super("string"==typeof e?e:y(e,"Root element (`$root`) already initialised")),this.name="InitError"}}class S{get $root(){return this._$root}constructor(e){this._$root=void 0;const t=this.constructor;if("string"!=typeof t.moduleName)throw new A("`moduleName` not defined in component");if(!(e instanceof t.elementType))throw new k({element:e,component:t,identifier:"Root element (`$root`)",expectedType:t.elementType.name});this._$root=e,t.checkSupport(),this.checkInitialised();const n=t.moduleName;this.$root.setAttribute(`data-${n}-init`,"")}checkInitialised(){const e=this.constructor,t=e.moduleName;if(t&&function(e,t){return e instanceof HTMLElement&&e.hasAttribute(`data-${t}-init`)}(this.$root,t))throw new A(e)}static checkSupport(){if(!v())throw new w}}S.elementType=HTMLElement;const T=Symbol.for("configOverride");class N extends S{[T](e){return{}}get config(){return this._config}constructor(e,t){super(e),this._config=void 0;const n=this.constructor;if(!g(n.defaults))throw new E(y(n,"Config passed as parameter into constructor but no defaults defined"));const r=function(e,t){if(!g(e.schema))throw new E(y(e,"Config passed as parameter into constructor but no schema defined"));const n={},r=Object.entries(e.schema.properties);for(const o of r){const[r,i]=o,a=r.toString();a in t&&(n[a]=x(t[a],i)),"object"===(null==i?void 0:i.type)&&(n[a]=M(e.schema,t,r))}return n}(n,this._$root.dataset);this._config=P(n.defaults,null!=t?t:{},this[T](r),r)}}function x(e,t){const n=e?e.trim():"";let r,o=null==t?void 0:t.type;switch(o||(["true","false"].includes(n)&&(o="boolean"),n.length>0&&isFinite(Number(n))&&(o="number")),o){case"boolean":r="true"===n;break;case"number":r=Number(n);break;default:r=e}return r}function P(...e){const t={};for(const n of e)for(const e of Object.keys(n)){const r=t[e],o=n[e];g(r)&&g(o)?t[e]=P(r,o):t[e]=o}return t}function M(e,t,n){const r=e.properties[n];if("object"!==(null==r?void 0:r.type))return;const o={[n]:{}};for(const[i,a]of Object.entries(t)){let e=o;const t=i.split(".");for(const[r,o]of t.entries())g(e)&&(r<t.length-1?(g(e[o])||(e[o]={}),e=e[o]):i!==n&&(e[o]=x(a)))}return o[n]}function L(e,t,n){let r;const o=function(e){let t,n=document;if(g(e)){const r=e;(_(r.scope)||null===r.scope)&&(n=r.scope),"function"==typeof r.onError&&(t=r.onError)}return _(e)?n=e:null===e?n=null:"function"==typeof e&&(t=e),{scope:n,onError:t}}(n);try{var i;if(!v())throw new w;if(null===o.scope)throw new k({element:o.scope,component:e,identifier:"Scope element (`$scope`)"});r=null==(i=o.scope)?void 0:i.querySelectorAll(`[data-module="${e.moduleName}"]`)}catch(a){return o.onError?o.onError(a,{component:e,config:t}):console.log(a),[]}return Array.from(null!=r?r:[]).map(n=>{try{return void 0!==t?new e(n,t):new e(n)}catch(a){return o.onError?o.onError(a,{element:n,component:e,config:t}):console.log(a),null}}).filter(Boolean)}class C extends N{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",e=>this.handleKeyDown(e)),this.$root.addEventListener("click",e=>this.debounce(e))}handleKeyDown(e){const t=e.target;" "===e.key&&t instanceof HTMLElement&&"button"===t.getAttribute("role")&&(e.preventDefault(),t.click())}debounce(e){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout(()=>{this.debounceFormSubmitTimer=null},1e3))}}function O(e,t){const n=e.closest(`[${t}]`);return n?n.getAttribute(t):null}C.moduleName="govuk-button",C.defaults=Object.freeze({preventDoubleClick:!1}),C.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class ${constructor(e={},t={}){var n;this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(n=t.locale)?n:document.documentElement.lang||"en"}t(e,t){if(!e)throw new Error("i18n: lookup key missing");let n=this.translations[e];if("number"==typeof(null==t?void 0:t.count)&&g(n)){const r=n[this.getPluralSuffix(e,t.count)];r&&(n=r)}if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!t)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,t)}return n}return e}replacePlaceholders(e,t){const n=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,function(e,r){if(Object.prototype.hasOwnProperty.call(t,r)){const e=t[r];return!1===e||"number"!=typeof e&&"string"!=typeof e?"":"number"==typeof e?n?n.format(e):`${e}`:e}throw new Error(`i18n: no data found to replace ${e} placeholder in string`)})}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(e,t){if(t=Number(t),!isFinite(t))return"other";const n=this.translations[e],r=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(t):"other";if(g(n)){if(r in n)return r;if("other"in n)return console.warn(`i18n: Missing plural form ".${r}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class I extends N{[T](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var n,r;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const o=this.$root.querySelector(".govuk-js-character-count");if(!(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement))throw new k({component:I,element:o,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const i=function(e,t){const n=[];for(const[r,o]of Object.entries(e)){const e=[];if(Array.isArray(o)){for(const{required:n,errorMessage:r}of o)n.every(e=>!!t[e])||e.push(r);"anyOf"!==r||o.length-e.length>=1||n.push(...e)}}return n}(I.schema,this.config);if(i[0])throw new E(y(I,i[0]));this.i18n=new $(this.config.i18n,{locale:O(this.$root,"lang")}),this.maxLength=null!=(n=null!=(r=this.config.maxwords)?r:this.config.maxlength)?n:1/0,this.$textarea=o;const a=`${this.$textarea.id}-info`,s=document.getElementById(a);if(!s)throw new k({component:I,element:s,identifier:`Count message (\`id="${a}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),s.textContent.match(/^\s*$/)&&(s.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",s);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,s.insertAdjacentElement("afterend",l);const u=document.createElement("div");u.className=s.className,u.classList.add("govuk-character-count__status"),u.setAttribute("aria-hidden","true"),this.$visibleCountMessage=u,s.insertAdjacentElement("afterend",u),s.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",()=>this.updateCountMessage()),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",()=>this.handleKeyUp()),this.$textarea.addEventListener("focus",()=>this.handleFocus()),this.$textarea.addEventListener("blur",()=>this.handleBlur())}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval(()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()},1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){var t;return this.config.maxwords?(null!=(t=e.match(/\S+/g))?t:[]).length:e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}I.moduleName="govuk-character-count",I.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),I.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class R extends S{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="checkbox"]');if(!t.length)throw new k({component:R,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new k({component:R,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-checkboxes__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!t)}}unCheckAllInputsExcept(e){document.querySelectorAll(`input[type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&t!==e&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}unCheckExclusiveInputs(e){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}handleClick(e){const t=e.target;t instanceof HTMLInputElement&&"checkbox"===t.type&&(t.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(t),t.checked&&("exclusive"===t.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(t):this.unCheckExclusiveInputs(t)))}}R.moduleName="govuk-checkboxes";class D extends N{constructor(e,t={}){super(e,t),this.config.disableAutoFocus||m(this.$root),this.$root.addEventListener("click",e=>this.handleClick(e))}handleClick(e){const t=e.target;t&&this.focusTarget(t)&&e.preventDefault()}focusTarget(e){if(!(e instanceof HTMLAnchorElement))return!1;const t=e.hash.replace("#","");if(!t)return!1;const n=document.getElementById(t);if(!n)return!1;const r=this.getAssociatedLegendOrLabel(n);return!!r&&(r.scrollIntoView(),n.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(e){var t;const n=e.closest("fieldset");if(n){const t=n.getElementsByTagName("legend");if(t.length){const n=t[0];if(e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type))return n;const r=n.getBoundingClientRect().top,o=e.getBoundingClientRect();if(o.height&&window.innerHeight&&o.top+o.height-r<window.innerHeight/2)return n}}return null!=(t=document.querySelector(`label[for='${e.getAttribute("id")}']`))?t:e.closest("label")}}D.moduleName="govuk-error-summary",D.defaults=Object.freeze({disableAutoFocus:!1}),D.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class F extends S{constructor(e){super(e),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const t=this.$root.querySelector(".govuk-js-header-toggle");if(!t)return this;this.$root.classList.add("govuk-header--with-js-navigation");const n=t.getAttribute("aria-controls");if(!n)throw new k({component:F,identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const r=document.getElementById(n);if(!r)throw new k({component:F,element:r,identifier:`Navigation (\`<ul id="${n}">\`)`});this.$menu=r,this.$menuButton=t,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",()=>this.handleMenuButtonClick())}setupResponsiveChecks(){const e=function(){const e="--govuk-breakpoint-desktop";return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}();if(!e.value)throw new k({component:F,identifier:`CSS custom property (\`${e.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${e.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",()=>this.checkMode()):this.mql.addListener(()=>this.checkMode()),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}F.moduleName="govuk-header";class B extends N{constructor(e,t={}){super(e,t),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const n=this.$root.querySelector("input");if(null===n)throw new k({component:B,identifier:'File inputs (`<input type="file">`)'});if("file"!==n.type)throw new k(y(B,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(this.$input=n,!this.$input.id)throw new k({component:B,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new $(this.config.i18n,{locale:O(this.$root,"lang")});const r=this.findLabel();r.id||(r.id=`${this.id}-label`),this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","true");const o=document.createElement("button");o.classList.add("govuk-file-upload-button"),o.type="button",o.id=this.id,o.classList.add("govuk-file-upload-button--empty");const i=this.$input.getAttribute("aria-describedby");i&&o.setAttribute("aria-describedby",i);const a=document.createElement("span");a.className="govuk-body govuk-file-upload-button__status",a.setAttribute("aria-live","polite"),a.innerText=this.i18n.t("noFileChosen"),o.appendChild(a);const s=document.createElement("span");s.className="govuk-visually-hidden",s.innerText=", ",s.id=`${this.id}-comma`,o.appendChild(s);const l=document.createElement("span");l.className="govuk-file-upload-button__pseudo-button-container";const u=document.createElement("span");u.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",u.innerText=this.i18n.t("chooseFilesButton"),l.appendChild(u),l.insertAdjacentText("beforeend"," ");const c=document.createElement("span");c.className="govuk-body govuk-file-upload-button__instruction",c.innerText=this.i18n.t("dropInstruction"),l.appendChild(c),o.appendChild(l),o.setAttribute("aria-labelledby",`${r.id} ${s.id} ${o.id}`),o.addEventListener("click",this.onClick.bind(this)),o.addEventListener("dragover",e=>{e.preventDefault()}),this.$root.insertAdjacentElement("afterbegin",o),this.$input.setAttribute("tabindex","-1"),this.$input.setAttribute("aria-hidden","true"),this.$button=o,this.$status=a,this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",()=>{this.enteredAnotherElement=!0}),document.addEventListener("dragleave",()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1})}updateDropzoneVisibility(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(e){return this.matchesInputCapacity(e.files.length)}canDrop(e){return e.items.length?this.matchesInputCapacity(function(e){let t=0;for(let n=0;n<e.length;n++)"file"===e[n].kind&&t++;return t}(e.items)):!e.types.length||e.types.includes("Files")}matchesInputCapacity(e){return this.$input.multiple?e>0:1===e}onChange(){const e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const e=document.querySelector(`label[for="${this.$input.id}"]`);if(!e)throw new k({component:B,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return e}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver(e=>{for(const t of e)"attributes"===t.type&&"disabled"===t.attributeName&&this.updateDisabledState()}).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)}}B.moduleName="govuk-file-upload",B.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),B.schema=Object.freeze({properties:{i18n:{type:"object"}}});class G extends N{constructor(e,t={}){super(e,t),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||m(this.$root)}}G.moduleName="govuk-notification-banner",G.defaults=Object.freeze({disableAutoFocus:!1}),G.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class j extends S{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="radio"]');if(!t.length)throw new k({component:j,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new k({component:j,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-radios__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!t)}}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"radio"!==t.type)return;const n=document.querySelectorAll('input[type="radio"][aria-controls]'),r=t.form,o=t.name;n.forEach(e=>{const t=e.form===r;e.name===o&&t&&this.syncConditionalRevealWithInputState(e)})}}j.moduleName="govuk-radios";class W extends S{constructor(e){var t;super(e);const n=this.$root.hash,r=null!=(t=this.$root.getAttribute("href"))?t:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const o=n.replace("#","");if(!o)throw new k(`Skip link: Target link (\`href="${r}"\`) has no hash fragment`);const i=document.getElementById(o);if(!i)throw new k({component:W,element:i,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",()=>m(i,{onBeforeFocus(){i.classList.add("govuk-skip-link-focused-element")},onBlur(){i.classList.remove("govuk-skip-link-focused-element")}}))}}W.elementType=HTMLAnchorElement,W.moduleName="govuk-skip-link";var U=i(402);const H=function(){L(C),L(I),L(R),L(D),L(F),L(B),L(G),L(j),L(W)},q=function(){const e=document.querySelectorAll('[data-module="govuk-accessible-autocomplete"]');e.length&&i.e(7).then(i.t.bind(i,60,19)).then(t=>{const{default:n}=t;e.forEach(e=>function(e,t){if(!e)return;const n={id:e.id,selectElement:e};t(n);const r=document.querySelector(`#${n.id}`),o=[...e.options].map(e=>e.text);null==r||r.addEventListener("blur",()=>{r.value&&o.includes(r.value)||(e.value="")})}(e.querySelector("select"),n.enhanceSelectElement))}).catch(console.error)},V=function(){const e=document.querySelectorAll(".prevent-multiple-clicks");for(const t of e)t.addEventListener("click",s),t.addEventListener("keydown",l)},z=function(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()},Y=function(){if(window.opener){const e=document.querySelector(".js-preview-banner-close");null==e||e.removeAttribute("hidden"),null==e||e.addEventListener("click",e=>{e.preventDefault(),window.close()})}};function K(){H(),q(),V(),z(),Y()}export{K as initAll,q as initAllAutocomplete,H as initAllGovuk,V as initDebounceClick,z as initFileUpload,Y as initPreviewCloseLink};export const geospatialMap=U.g5;export const initMaps=U.Yv;export const locationMap=U.g$;export const map=U.Tj;export const sssiDataset=U.zp;
|
|
3
3
|
//# sourceMappingURL=shared.min.js.map
|