nhsuk-frontend
Advanced tools
Comparing version 0.3.0 to 0.4.0
# NHS.UK Frontend Changelog | ||
## 0.4.0 (Prerelease) - Dec 03, 2018 | ||
:boom: **Breaking changes** | ||
- Breadcrumb - Updated nunjucks macro so now you do not need duplicate entries for it to work ([PR 276](https://github.com/nhsuk/nhsuk-frontend/pull/276)) | ||
Use the latest [Breadcrumb nunjucks macro arguments](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/breadcrumb#nunjucks-macro) and [Breadcrumb HTML markup](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/breadcrumb#html-markup) in your app. | ||
- Care card - Change the way triangle is generated in care cards for accessiblity purposes ([PR 269](https://github.com/nhsuk/nhsuk-frontend/pull/269)) | ||
Use the latest [Care card HTML markup](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/care-card#quick-start-examples) in your app. | ||
:wrench: **Fixes** | ||
- Header - Removed icon includes from nunjucks macro and added the SVG's inline ([PR 276](https://github.com/nhsuk/nhsuk-frontend/pull/276)) | ||
- Footer - Removed icon includes from nunjucks macro and added the SVG's inline ([PR 272](https://github.com/nhsuk/nhsuk-frontend/pull/272)) | ||
## 0.3.0 (Prerelease) - Dec 03, 2018 | ||
@@ -4,0 +22,0 @@ |
@@ -267,4 +267,18 @@ /*! | ||
var bannerCloseButton = document.querySelector('#nhsuk-feedback-banner-close'); | ||
var footer = document.getElementById('nhsuk-footer'); | ||
// taken from https://stackoverflow.com/a/22480938 | ||
function isScrolledIntoView(el) { | ||
var rect = el.getBoundingClientRect(); | ||
var elemTop = rect.top; | ||
var elemBottom = rect.bottom; | ||
// Only completely visible elements return true: | ||
// var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight); | ||
// Partially visible elements return true: | ||
var isVisible = elemTop < window.innerHeight && elemBottom >= 0; | ||
return isVisible; | ||
} | ||
document.addEventListener("DOMContentLoaded", function(){ | ||
setTimeout(function () { | ||
@@ -275,2 +289,28 @@ if (typeof(banner) != 'undefined' && banner != null) { | ||
}, 3000); | ||
var didScroll = false, | ||
timer = false; | ||
// set a timer when scrolling, so as not to be constantly calling the | ||
// isScrolledIntoView function and spiking CPU, to check when the footer | ||
// comes in to view, to make the banner not sticky but position it in the | ||
// normal flow of the page below the footer | ||
$(window).scroll(function() { | ||
if (!didScroll) { | ||
timer = setInterval(function() { | ||
if (didScroll) { | ||
didScroll = false; | ||
clearTimeout(timer); | ||
if (isScrolledIntoView(footer)) { | ||
banner.classList.add("js-inview") | ||
} else { | ||
banner.classList.remove("js-inview") | ||
} | ||
} | ||
}, 500); | ||
} | ||
didScroll = true; | ||
}); | ||
}); | ||
@@ -277,0 +317,0 @@ |
{ | ||
"name": "nhsuk-frontend", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "The NHS website frontend styles, for creating NHS websites and services.", | ||
@@ -5,0 +5,0 @@ "sasslintConfig": "config/sass-lint.yml", |
@@ -17,3 +17,3 @@ # Back link | ||
<div class="nhsuk-back-link"> | ||
<a href="#" class="nhsuk-back-link"> | ||
<a href="#" class="nhsuk-back-link__link"> | ||
<svg class="nhsuk-icon nhsuk-icon__chevron-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"> | ||
@@ -20,0 +20,0 @@ <path d="M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z"></path> |
@@ -19,6 +19,7 @@ # Breadcrumb | ||
<ol class="nhsuk-breadcrumb__list"> | ||
<li class="nhsuk-breadcrumb__item"><a href="https://www.nhs.uk/" class="nhsuk-breadcrumb__link">Home</a></li> | ||
<li class="nhsuk-breadcrumb__item"><a href="https://www.nhs.uk/conditions" class="nhsuk-breadcrumb__link">Health A-Z</a></li> | ||
<li class="nhsuk-breadcrumb__item"><a href="/level-one" class="nhsuk-breadcrumb__link">Level one</a></li> | ||
<li class="nhsuk-breadcrumb__item"><a href="/level-one/level-two" class="nhsuk-breadcrumb__link">Level two</a></li> | ||
<li class="nhsuk-breadcrumb__item"><a href="/level-one/level-two/level-three" class="nhsuk-breadcrumb__link">Level three</a></li> | ||
</ol> | ||
<p class="nhsuk-breadcrumb__back"><a href="https://www.nhs.uk/conditions/abscess/" class="nhsuk-breadcrumb__backlink">Back to Abscess</a></p> | ||
<p class="nhsuk-breadcrumb__back"><a href="/level-one/level-two/level-three" class="nhsuk-breadcrumb__backlink">Level three</a></p> | ||
</div> | ||
@@ -38,12 +39,12 @@ </nav> | ||
{ | ||
text: "Home", | ||
href: "https://www.nhs.uk/" | ||
href: "/level-one", | ||
text: "Level one" | ||
}, | ||
{ | ||
text: "Health A-Z", | ||
href: "https://www.nhs.uk/conditions" | ||
href: "/level-one/level-two", | ||
text: "Level two" | ||
} | ||
], | ||
href: "https://www.nhs.uk/conditions/abscess/", | ||
text: "Abscess" | ||
href: "/level-one/level-two/level-three", | ||
text: "Level three" | ||
}) }} | ||
@@ -50,0 +51,0 @@ ``` |
@@ -19,2 +19,3 @@ # Care cards | ||
<h3 class="nhsuk-care-card__heading"><span role="text"><span class="nhsuk-u-visually-hidden">Non-urgent advice: </span>Speak to a GP if:</span></h3> | ||
<span class="nhsuk-care-card__arrow" aria-hidden="true"></span> | ||
</div> | ||
@@ -78,2 +79,3 @@ <div class="nhsuk-care-card__content"> | ||
<h3 class="nhsuk-care-card__heading"><span role="text"><span class="nhsuk-u-visually-hidden">Urgent advice: </span>Ask for an urgent GP appointment if:</span></h3> | ||
<span class="nhsuk-care-card__arrow" aria-hidden="true"></span> | ||
</div> | ||
@@ -137,2 +139,3 @@ <div class="nhsuk-care-card__content"> | ||
<h3 class="nhsuk-care-card__heading"><span role="text"><span class="nhsuk-u-visually-hidden">Immediate action required: </span>Call 999 if you have sudden chest pain that:</span></h3> | ||
<span class="nhsuk-care-card__arrow" aria-hidden="true"></span> | ||
</div> | ||
@@ -139,0 +142,0 @@ <div class="nhsuk-care-card__content"> |
@@ -16,12 +16,13 @@ # Error summary | ||
```html | ||
<div class="govuk-error-summary" aria-labelledby="error-summary-title" role="alert" tabindex="-1" data-module="error-summary"> | ||
<h2 class="govuk-error-summary__title" id="error-summary-title"> | ||
Message to alert the user to a problem goes here | ||
</h2> | ||
<div class="govuk-error-summary__body"> | ||
<div class="nhsuk-error-summary" aria-labelledby="error-summary-title" role="alert" tabindex="-1" data-module="error-summary"> | ||
<h2 class="nhsuk-error-summary__title" id="error-summary-title">Message to alert the user to a problem goes here</h2> | ||
<div class="nhsuk-error-summary__body"> | ||
<p>Optional description of the errors and how to correct them</p> | ||
<ul class="govuk-list govuk-error-summary__list"> | ||
<li><a href="#example-error-1">Descriptive link to the question with an error</a></li> | ||
<li><a href="#example-error-1">Descriptive link to the question with an error</a></li> | ||
<ul class="nhsuk-list nhsuk-error-summary__list"> | ||
<li> | ||
<a href="#example-error-1">Descriptive link to the question with an error</a> | ||
</li> | ||
<li> | ||
<a href="#example-error-1">Descriptive link to the question with an error</a> | ||
</li> | ||
</ul> | ||
@@ -28,0 +29,0 @@ </div> |
@@ -5,4 +5,18 @@ // Feedback banner | ||
var bannerCloseButton = document.querySelector('#nhsuk-feedback-banner-close'); | ||
var footer = document.getElementById('nhsuk-footer'); | ||
// taken from https://stackoverflow.com/a/22480938 | ||
function isScrolledIntoView(el) { | ||
var rect = el.getBoundingClientRect(); | ||
var elemTop = rect.top; | ||
var elemBottom = rect.bottom; | ||
// Only completely visible elements return true: | ||
// var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight); | ||
// Partially visible elements return true: | ||
var isVisible = elemTop < window.innerHeight && elemBottom >= 0; | ||
return isVisible; | ||
} | ||
document.addEventListener("DOMContentLoaded", function(){ | ||
setTimeout(function () { | ||
@@ -13,2 +27,28 @@ if (typeof(banner) != 'undefined' && banner != null) { | ||
}, 3000); | ||
var didScroll = false, | ||
timer = false; | ||
// set a timer when scrolling, so as not to be constantly calling the | ||
// isScrolledIntoView function and spiking CPU, to check when the footer | ||
// comes in to view, to make the banner not sticky but position it in the | ||
// normal flow of the page below the footer | ||
$(window).scroll(function() { | ||
if (!didScroll) { | ||
timer = setInterval(function() { | ||
if (didScroll) { | ||
didScroll = false; | ||
clearTimeout(timer); | ||
if (isScrolledIntoView(footer)) { | ||
banner.classList.add("js-inview") | ||
} else { | ||
banner.classList.remove("js-inview") | ||
} | ||
} | ||
}, 500); | ||
} | ||
didScroll = true; | ||
}); | ||
}); | ||
@@ -15,0 +55,0 @@ |
@@ -20,11 +20,8 @@ # Footer | ||
<div class="nhsuk-footer__logo"> | ||
<a href="/" class="global-footer__link"> | ||
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false"> | ||
<g fill="none"> | ||
<path fill="#fff" d="M0 39.842h98.203V0H0z"></path> | ||
<path fill="#0058ad" d="M9.548 3.817H20.16l6.52 22.08h.09l4.465-22.08h8.021l-6.74 31.84H21.939l-6.65-22.032h-.09l-4.424 22.031H2.754l6.794-31.84m32.852.001h8.518l-2.502 12.18h10.069l2.508-12.18h8.519l-6.61 31.84h-8.518l2.826-13.638H47.135L44.31 35.656h-8.518L42.4 3.816m49.53 7.209c-1.64-.773-3.873-1.457-7.016-1.457-3.37 0-6.106.498-6.106 3.056 0 4.512 12.35 2.828 12.35 12.499 0 8.802-8.16 11.085-15.54 11.085-3.281 0-7.065-.78-9.842-1.648l2.006-6.477c1.682 1.096 5.058 1.827 7.835 1.827 2.646 0 6.789-.503 6.789-3.786 0-5.111-12.35-3.194-12.35-12.176 0-8.214 7.202-10.676 14.176-10.676 3.92 0 7.608.413 9.75 1.413l-2.052 6.34"></path> | ||
</g> | ||
<image xlink:href="" src="/assets/logos/fallback/logo-nhs.png"></image> | ||
<a href="/" class="global-footer__link" aria-label="NHS homepage"> | ||
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" viewBox="0 0 40 16"> | ||
<path fill="#005eb8" d="M0 0h40v16H0z"></path> | ||
<path fill="#fff" d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"></path> | ||
<image xlink:href="" src="https://assets.nhs.uk/images/nhs-logo.png"></image> | ||
</svg> | ||
<span class="nhsuk-u-visually-hidden">NHS homepage</span> | ||
</a> | ||
@@ -31,0 +28,0 @@ </div> |
@@ -1,1 +0,1 @@ | ||
window.jQuery&&(function(e,n){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.Bloodhound=n(t)}):"object"==typeof module&&module.exports?module.exports=n(require("jquery")):e.Bloodhound=n(e.jQuery)}(this,function(f){var p=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:f.isArray,isFunction:f.isFunction,isObject:f.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof f},toStr:function(t){return p.isUndefined(t)||null===t?"":t+""},bind:f.proxy,each:function(t,n){f.each(t,function(t,e){return n(e,t)})},map:f.map,filter:f.grep,every:function(n,i){var s=!0;return n?(f.each(n,function(t,e){if(!(s=i.call(null,e,t,n)))return!1}),!!s):s},some:function(n,i){var s=!1;return n?(f.each(n,function(t,e){if(s=i.call(null,e,t,n))return!1}),!!s):s},mixin:f.extend,identity:function(t){return t},clone:function(t){return f.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return f.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(s,r,o){var a,u;return function(){var t,e,n=this,i=arguments;return t=function(){a=null,o||(u=s.apply(n,i))},e=o&&!a,clearTimeout(a),a=setTimeout(t,r),e&&(u=s.apply(n,i)),u}},throttle:function(n,i){var s,r,o,a,u,c;return u=0,c=function(){u=new Date,o=null,a=n.apply(s,r)},function(){var t=new Date,e=i-(t-u);return s=this,r=arguments,e<=0?(clearTimeout(o),o=null,u=t,a=n.apply(s,r)):o||(o=setTimeout(c,e)),a}},stringify:function(t){return p.isString(t)?t:JSON.stringify(t)},guid:function(){function t(t){var e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return"tt-"+t()+t(!0)+t(!0)+t()},noop:function(){}}}(),n=function(){"use strict";function t(t){return(t=p.toStr(t))?t.split(/\s+/):[]}function e(t){return(t=p.toStr(t))?t.split(/\W+/):[]}function n(t){t=p.toStr(t);var e=[],n="";return p.each(t.split(""),function(t){t.match(/\s+/)?n="":(e.push(n+t),n+=t)}),e}function i(i){return function(t){return t=p.isArray(t)?t:[].slice.call(arguments,0),function(e){var n=[];return p.each(t,function(t){n=n.concat(i(p.toStr(e[t])))}),n}}}return{nonword:e,whitespace:t,ngram:n,obj:{nonword:i(e),whitespace:i(t),ngram:i(n)}}}(),i=function(){"use strict";function t(t){this.maxSize=p.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=f.noop)}function e(){this.head=this.tail=null}function s(t,e){this.key=t,this.val=e,this.prev=this.next=null}return p.mixin(t.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new s(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new e}}),p.mixin(e.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),e=function(){"use strict";function t(t,e){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+p.escapeRegExChars(this.prefix)),this.ls=e||r,!this.ls&&this._noop()}function i(){return(new Date).getTime()}function s(t){return JSON.stringify(p.isUndefined(t)?null:t)}function n(t){return f.parseJSON(t)}var r;try{(r=window.localStorage).setItem("~~~","!"),r.removeItem("~~~")}catch(t){r=null}return p.mixin(t.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=p.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),n(this.ls.getItem(this._prefix(t)))},set:function(t,e,n){return p.isNumber(n)?this._safeSet(this._ttlKey(t),s(i()+n)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),s(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=function(t){var e,n,i=[],s=r.length;for(e=0;e<s;e++)(n=r.key(e)).match(t)&&i.push(n.replace(t,""));return i}(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var e=n(this.ls.getItem(this._ttlKey(t)));return!!(p.isNumber(e)&&i()>e)}}),t}(),s=function(){"use strict";function t(t){t=t||{},this.maxPendingRequests=t.maxPendingRequests||6,this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new i(0):e}var a=0,u={},e=new i(10);return t.setMaxPendingRequests=function(t){this.maxPendingRequests=t},t.resetCache=function(){e.reset()},p.mixin(t.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+f.param(t.data||{})},_get:function(t,e){function n(t){e(null,t),o._cache.set(s,t)}function i(){e(!0)}var s,r,o=this;s=this._fingerprint(t),this.cancelled||s!==this.lastReq||((r=u[s])?r.done(n).fail(i):a<this.maxPendingRequests?(a++,u[s]=this._send(t).done(n).fail(i).always(function(){a--,delete u[s],o.onDeckRequestArgs&&(o._get.apply(o,o.onDeckRequestArgs),o.onDeckRequestArgs=null)})):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(t,e){var n,i;e=e||f.noop,t=p.isString(t)?{url:t}:t||{},i=this._fingerprint(t),this.cancelled=!1,this.lastReq=i,(n=this._cache.get(i))?e(null,n):this._get(t,e)},cancel:function(){this.cancelled=!0}}),t}(),r=window.SearchIndex=function(){"use strict";function t(t){(t=t||{}).datumTokenizer&&t.queryTokenizer||f.error("datumTokenizer and queryTokenizer are both required"),this.identify=t.identify||p.stringify,this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.matchAnyQueryToken=t.matchAnyQueryToken,this.reset()}function n(t){return t=p.filter(t,function(t){return!!t}),p.map(t,function(t){return t.toLowerCase()})}function o(){var t={};return t[u]=[],t[a]={},t}var a="c",u="i";return p.mixin(t.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var r=this;t=p.isArray(t)?t:[t],p.each(t,function(t){var s,e;r.datums[s=r.identify(t)]=t,e=n(r.datumTokenizer(t)),p.each(e,function(t){var e,n,i;for(e=r.trie,n=t.split("");i=n.shift();)(e=e[a][i]||(e[a][i]=o()))[u].push(s)})})},get:function(t){var e=this;return p.map(t,function(t){return e.datums[t]})},search:function(t){var e,r,o=this;return e=n(this.queryTokenizer(t)),p.each(e,function(t){var e,n,i,s;if(r&&0===r.length&&!o.matchAnyQueryToken)return!1;for(e=o.trie,n=t.split("");e&&(i=n.shift());)e=e[a][i];if(e&&0===n.length)s=e[u].slice(0),r=r?function(t,e){var n=0,i=0,s=[];t=t.sort(),e=e.sort();for(var r=t.length,o=e.length;n<r&&i<o;)t[n]<e[i]?n++:(t[n]>e[i]||(s.push(t[n]),n++),i++);return s}(r,s):s;else if(!o.matchAnyQueryToken)return!(r=[])}),r?p.map(function(t){for(var e={},n=[],i=0,s=t.length;i<s;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}(r),function(t){return o.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=o()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),t}(),o=function(){"use strict";function t(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new e(t.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},p.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(n.data),e.protocol=this.storage.get(n.protocol),e.thumbprint=this.storage.get(n.thumbprint),t=e.thumbprint!==this.thumbprint||e.protocol!==location.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(e){var t,n=this;e&&(t=this.prepare(this._settings()),this.transport(t).fail(function(){e(!0)}).done(function(t){e(null,n.transform(t))}))},clear:function(){return this.storage.clear(),this}}),t}(),a=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.indexResponse=t.indexResponse,this.transport=new s({cache:t.cache,limiter:t.limiter,transport:t.transport,maxPendingRequests:t.maxPendingRequests})}return p.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,n){var e,i=this;if(n)return t=t||"",e=this.prepare(t,this._settings()),this.transport.get(e,function(t,e){n(t?[]:i.transform(e))})},cancelLastRequest:function(){this.transport.cancel()}}),t}(),u=function(){"use strict";function r(t){var e,n,i,s,r,o,a,u,c,h,l;if(t)return e={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:p.identity,transport:null},t=p.isString(t)?{url:t}:t,!(t=p.mixin(e,t)).url&&f.error("remote requires url to be set"),t.transform=t.filter||t.transform,t.prepare=(c=(u=t).prepare,h=u.replace,l=u.wildcard,c||(c=h?function(t,e){return e.url=h(e.url,t),e}:u.wildcard?function(t,e){return e.url=e.url.replace(l,encodeURIComponent(t)),e}:function(t,e){return e})),t.limiter=(i=(n=t).limiter,s=n.rateLimitBy,r=n.rateLimitWait,i||(i=/^throttle$/i.test(s)?(a=r,function(t){return p.throttle(t,a)}):(o=r,function(t){return p.debounce(t,o)})),i),t.transport=t.transport?d(t.transport):f.ajax,delete t.replace,delete t.wildcard,delete t.rateLimitBy,delete t.rateLimitWait,t}function d(n){return function(t){var e=f.Deferred();return n(t,function(t){p.defer(function(){e.resolve(t)})},function(t){p.defer(function(){e.reject(t)})}),e}}return function(t){var e,n,i,s;return e={initialize:!0,identify:p.stringify,datumTokenizer:null,queryTokenizer:null,matchAnyQueryToken:!1,sufficient:5,indexRemote:!1,sorter:null,local:[],prefetch:null,remote:null},!(t=p.mixin(e,t||{})).datumTokenizer&&f.error("datumTokenizer is required"),!t.queryTokenizer&&f.error("queryTokenizer is required"),n=t.sorter,t.sorter=n?function(t){return t.sort(n)}:p.identity,t.local=p.isFunction(t.local)?t.local():t.local,t.prefetch=(i=t.prefetch)?(s={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:p.identity,transform:p.identity,transport:null},i=p.isString(i)?{url:i}:i,!(i=p.mixin(s,i)).url&&f.error("prefetch requires url to be set"),i.transform=i.filter||i.transform,i.cacheKey=i.cacheKey||i.url,i.thumbprint="1.2.1"+i.thumbprint,i.transport=i.transport?d(i.transport):f.ajax,i):null,t.remote=r(t.remote),t}}();return function(){"use strict";function t(t){t=u(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.indexRemote=t.indexRemote,this.local=t.local,this.remote=t.remote?new a(t.remote):null,this.prefetch=t.prefetch?new o(t.prefetch):null,this.index=new r({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}var e;return e=window&&window.Bloodhound,t.noConflict=function(){return window&&(window.Bloodhound=e),t},t.tokenizers=n,p.mixin(t.prototype,{__ttAdapter:function(){var i=this;return this.remote?function(t,e,n){return i.search(t,e,n)}:function(t,e){return i.search(t,e)}},_loadPrefetch:function(){var n,t,i=this;return n=f.Deferred(),this.prefetch?(t=this.prefetch.fromCache())?(this.index.bootstrap(t),n.resolve()):this.prefetch.fromNetwork(function(t,e){if(t)return n.reject();i.add(e),i.prefetch.store(i.index.serialize()),n.resolve()}):n.resolve(),n.promise()},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(function(){t.add(t.local)}),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=p.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,e,i){var s,r=this;return e=e||p.noop,i=i||p.noop,s=this.sorter(this.index.search(t)),e(this.remote?s.slice():s),this.remote&&s.length<this.sufficient?this.remote.get(t,function(t){var n=[];p.each(t,function(e){!p.some(s,function(t){return r.identify(e)===r.identify(t)})&&n.push(e)}),r.indexRemote&&r.add(n),i(n)}):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return s.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),t}()}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(t.jQuery)}(this,function(b){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:b.isArray,isFunction:b.isFunction,isObject:b.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof b},toStr:function(t){return _.isUndefined(t)||null===t?"":t+""},bind:b.proxy,each:function(t,n){b.each(t,function(t,e){return n(e,t)})},map:b.map,filter:b.grep,every:function(n,i){var s=!0;return n?(b.each(n,function(t,e){if(!(s=i.call(null,e,t,n)))return!1}),!!s):s},some:function(n,i){var s=!1;return n?(b.each(n,function(t,e){if(s=i.call(null,e,t,n))return!1}),!!s):s},mixin:b.extend,identity:function(t){return t},clone:function(t){return b.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return b.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(s,r,o){var a,u;return function(){var t,e,n=this,i=arguments;return t=function(){a=null,o||(u=s.apply(n,i))},e=o&&!a,clearTimeout(a),a=setTimeout(t,r),e&&(u=s.apply(n,i)),u}},throttle:function(n,i){var s,r,o,a,u,c;return u=0,c=function(){u=new Date,o=null,a=n.apply(s,r)},function(){var t=new Date,e=i-(t-u);return s=this,r=arguments,e<=0?(clearTimeout(o),o=null,u=t,a=n.apply(s,r)):o||(o=setTimeout(c,e)),a}},stringify:function(t){return _.isString(t)?t:JSON.stringify(t)},guid:function(){function t(t){var e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return"tt-"+t()+t(!0)+t(!0)+t()},noop:function(){}}}(),n=function(){"use strict";var c={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return function(t,e){var n,i,s,r,o,a,u;return i=_.mixin({},c,t),{css:(n={css:(u={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}},_.isMsie()&&_.mixin(u.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),u),classes:i,html:(o=i,a=e,{wrapper:'<span class="'+o.wrapper+'"></span>',menu:'<div id="'+a+'_listbox" role="listbox" class="'+o.menu+'"></div>'}),selectors:(s=i,r={},_.each(s,function(t,e){r[e]="."+t}),r)}).css,html:n.html,classes:n.classes,selectors:n.selectors,mixin:function(t){_.mixin(t,n)}}}}(),w=function(){"use strict";function t(t){t&&t.el||b.error("EventBus initialized without el"),this.$el=b(t.el)}var n;return"typeahead:",n={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},_.mixin(t.prototype,{_trigger:function(t,e){var n=b.Event("typeahead:"+t);return this.$el.trigger.call(this.$el,n,e||[]),n},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=n[t])&&this._trigger(e,[].slice.call(arguments,1))}}),t}(),e=function(){"use strict";function i(t,e,n,i){var s;if(!n)return this;for(e=e.split(a),n=i?function(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}(n,i):n,this._callbacks=this._callbacks||{};s=e.shift();)this._callbacks[s]=this._callbacks[s]||{sync:[],async:[]},this._callbacks[s][t].push(n);return this}function o(i,s,r){return function(){for(var t,e=0,n=i.length;!t&&e<n;e+=1)t=!1===i[e].apply(s,r);return!t}}var a=/\s+/,u=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)};return{onSync:function(t,e,n){return i.call(this,"sync",t,e,n)},onAsync:function(t,e,n){return i.call(this,"async",t,e,n)},off:function(t){var e;if(!this._callbacks)return this;for(t=t.split(a);e=t.shift();)delete this._callbacks[e];return this},trigger:function(t){var e,n,i,s,r;if(!this._callbacks)return this;for(t=t.split(a),i=[].slice.call(arguments,1);(e=t.shift())&&(n=this._callbacks[e]);)s=o(n.sync,this,[e].concat(i)),r=o(n.async,this,[e].concat(i)),s()&&u(r);return this}}}(),u=function(o){"use strict";function c(t){return e[t.toUpperCase()]||t}var t={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1,diacriticInsensitive:!1},e={A:"[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",B:"[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",C:"[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",D:"[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",E:"[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",F:"[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",G:"[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",H:"[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",I:"[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",J:"[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",K:"[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",L:"[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",M:"[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",N:"[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",O:"[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",P:"[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",Q:"[Qqℚ⒬Ⓠⓠ㏃Qq]",R:"[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",S:"[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",T:"[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",U:"[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",V:"[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",W:"[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",X:"[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",Y:"[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",Z:"[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"};return function(s){var r;(s=_.mixin({},t,s)).node&&s.pattern&&(s.pattern=_.isArray(s.pattern)?s.pattern:[s.pattern],r=function(t,e,n,i){for(var s,r=[],o=0,a=t.length;o<a;o++){var u=_.escapeRegExChars(t[o]);i&&(u=u.replace(/\S/g,c)),r.push(u)}return s=n?"\\b("+r.join("|")+")\\b":"("+r.join("|")+")",e?new RegExp(s):new RegExp(s,"i")}(s.pattern,s.caseSensitive,s.wordsOnly,s.diacriticInsensitive),function t(e,n){for(var i,s=0;s<e.childNodes.length;s++)3===(i=e.childNodes[s]).nodeType?s+=n(i)?1:0:t(i,n)}(s.node,function(t){var e,n,i;return(e=r.exec(t.data))&&(i=o.createElement(s.tagName),s.className&&(i.className=s.className),(n=t.splitText(e.index)).splitText(e[0].length),i.appendChild(n.cloneNode(!0)),t.parentNode.replaceChild(i,n)),!!e}))}}(window.document),x=function(){"use strict";function o(t,e){var n;(t=t||{}).input||b.error("input is missing"),e.mixin(this),this.$hint=b(t.hint),this.$input=b(t.input),this.$input.attr({"aria-owns":this.$input.attr("id")+"_listbox",role:"textbox","aria-readonly":"true","aria-autocomplete":"list"}),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=(n=this.$input,b('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:n.css("font-family"),fontSize:n.css("font-size"),fontStyle:n.css("font-style"),fontVariant:n.css("font-variant"),fontWeight:n.css("font-weight"),wordSpacing:n.css("word-spacing"),letterSpacing:n.css("letter-spacing"),textIndent:n.css("text-indent"),textRendering:n.css("text-rendering"),textTransform:n.css("text-transform")}).insertAfter(n)),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop),this.onSync("cursorchange",this._updateDescendent)}function i(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}var r;return r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},o.normalizeQuery=function(t){return _.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},_.mixin(o.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(t){var e=r[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var n;switch(t){case"up":case"down":n=!i(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!i(e);break;default:n=!0}return n},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var n,i,s,r;s=t,r=this.query,i=!!(n=o.normalizeQuery(s)===o.normalizeQuery(r))&&this.query.length!==t.length,this.query=t,e||n?!e&&i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},_updateDescendent:function(t,e){this.$input.attr("aria-activedescendant",e)},bind:function(){var t,e,n,i,s=this;return t=_.bind(this._onBlur,this),e=_.bind(this._onFocus,this),n=_.bind(this._onKeydown,this),i=_.bind(this._onInput,this),this.$input.on("blur.tt",t).on("focus.tt",e).on("keydown.tt",n),!_.isMsie()||9<_.isMsie()?this.$input.on("input.tt",i):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){r[t.which||t.keyCode]||_.defer(_.bind(s._onInput,s,t))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,e,n;return t=this.$input.val().length,e=this.$input[0].selectionStart,_.isNumber(e)?e===t:!document.selection||((n=document.selection.createRange()).moveStart("character",-t),t===n.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=b("<div>")}}),o}(),s=function(){"use strict";function t(t,e){var n,i,s,r;(t=t||{}).templates=t.templates||{},t.templates.notFound=t.templates.notFound||t.templates.empty,t.source||b.error("missing source"),t.node||b.error("missing node"),t.name&&(r=t.name,!/^[_a-zA-Z0-9-]+$/.test(r))&&b.error("invalid dataset name: "+t.name),e.mixin(this),this.highlight=!!t.highlight,this.name=_.toStr(t.name||a()),this.limit=t.limit||5,this.displayFn=(s=(s=t.display||t.displayKey)||_.stringify,_.isFunction(s)?s:function(t){return t[s]}),this.templates=(n=t.templates,i=this.displayFn,{notFound:n.notFound&&_.templatify(n.notFound),pending:n.pending&&_.templatify(n.pending),header:n.header&&_.templatify(n.header),footer:n.footer&&_.templatify(n.footer),suggestion:n.suggestion?function(t){var e=n.suggestion;return b(e(t)).attr("id",_.guid())}:function(t){return b('<div role="option">').attr("id",_.guid()).text(i(t))}}),this.source=t.source.__ttAdapter?t.source.__ttAdapter():t.source,this.async=_.isUndefined(t.async)?2<this.source.length:!!t.async,this._resetLastSuggestion(),this.$el=b(t.node).attr("role","presentation").addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}var o,a;return o={dataset:"tt-selectable-dataset",val:"tt-selectable-display",obj:"tt-selectable-object"},a=_.getIdGenerator(),t.extractData=function(t){var e=b(t);return e.data(o.obj)?{dataset:e.data(o.dataset)||"",val:e.data(o.val)||"",obj:e.data(o.obj)||null}:null},_.mixin(t.prototype,e,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",e,!1,this.name)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",e,!0,this.name)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,i;i=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(i,t){var s,r=this;return s=document.createDocumentFragment(),_.each(t,function(t){var e,n;n=r._injectQuery(i,t),e=b(r.templates.suggestion(n)).data(o.dataset,r.name).data(o.obj,t).data(o.val,r.displayFn(t)).addClass(r.classes.suggestion+" "+r.classes.selectable),s.appendChild(e[0])}),this.highlight&&u({className:this.classes.highlight,node:s,pattern:i}),b(s)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=b()},_injectQuery:function(t,e){return _.isObject(e)?_.mixin({_query:t},e):e},update:function(n){function t(t){e||(e=!0,t=(t||[]).slice(0,i.limit),r=t.length,i._overwrite(n,t),r<i.limit&&i.async&&i.trigger("asyncRequested",n,i.name))}var i=this,s=!1,e=!1,r=0;this.cancel(),this.cancel=function(){s=!0,i.cancel=b.noop,i.async&&i.trigger("asyncCanceled",n,i.name)},this.source(n,t,function(t){if(t=t||[],!s&&r<i.limit){i.cancel=b.noop;var e=Math.abs(r-i.limit);r+=e,i._append(n,t.slice(0,e)),i.async&&i.trigger("asyncReceived",n,i.name)}}),!e&&t([])},cancel:b.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=b("<div>")}}),t}(),k=function(){"use strict";function t(t,n){var i=this;(t=t||{}).node||b.error("node is required"),n.mixin(this),this.$node=b(t.node),this.query=null,this.datasets=_.map(t.datasets,function(t){var e=i.$node.find(t.node).first();return t.node=e.length?e:b("<div>").appendTo(i.$node),new s(t,n)})}return _.mixin(t.prototype,e,{_onSelectableClick:function(t){this.trigger("selectableClicked",b(t.currentTarget))},_onRendered:function(t,e,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return _.every(this.datasets,_.bind(function(t){var e=t.isEmpty();return this.$node.attr("aria-expanded",!e),e},this))},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,i,s;n=(e=t.position().top)+t.outerHeight(!0),i=this.$node.scrollTop(),s=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(i+e):s<n&&this.$node.scrollTop(i+(n-s))},bind:function(){var t,e=this;return t=_.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),this.$node.on("mouseover",this.selectors.selectable,function(){e.setCursor(b(this))}),this.$node.on("mouseleave",function(){e._removeCursor()}),_.each(this.datasets,function(t){t.onSync("asyncRequested",e._propagate,e).onSync("asyncCanceled",e._propagate,e).onSync("asyncReceived",e._propagate,e).onSync("rendered",e._onRendered,e).onSync("cleared",e._onCleared,e)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.scrollTop(0),this.$node.addClass(this.classes.open)},close:function(){this.$node.attr("aria-expanded",!1),this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,n,i;return n=this.getActiveSelectable(),e=this._getSelectables(),-1===(i=(i=((i=(n?e.index(n):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:i)?null:e.eq(i)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?s.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(e){var t=e!==this.query;return t&&(this.query=e,_.each(this.datasets,function(t){t.update(e)})),t},empty:function(){_.each(this.datasets,function(t){t.clear()}),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){this.$node.off(".tt"),this.$node=b("<div>"),_.each(this.datasets,function(t){t.destroy()})}}),t}(),S=function(){"use strict";function t(t){this.$el=b("<span></span>",{role:"status","aria-live":"polite"}).css({position:"absolute",padding:"0",border:"0",height:"1px",width:"1px","margin-bottom":"-1px","margin-right":"-1px",overflow:"hidden",clip:"rect(0 0 0 0)","white-space":"nowrap"}),t.$input.after(this.$el),_.each(t.menu.datasets,_.bind(function(t){t.onSync&&(t.onSync("rendered",_.bind(this.update,this)),t.onSync("cleared",_.bind(this.cleared,this)))},this))}return _.mixin(t.prototype,{update:function(t,e){if(arguments[2]){var n,i=e.length;n=1===i?{result:"result",is:"is"}:{result:"results",is:"are"},this.$el.text(i+" "+n.result+" "+n.is+" available. Keyboard users can use up and down arrow keys to navigate.")}},cleared:function(){this.$el.text("")}}),t}(),C=function(){"use strict";function t(){k.apply(this,[].slice.call(arguments,0))}var e=k.prototype;return _.mixin(t.prototype,k.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),e.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),e.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(t){return this.$node.css("ltr"===t?this.css.ltr:this.css.rtl),e.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),t}(),A=function(){"use strict";function t(t,e){var n,i,s,r,o,a,u,c,h,l,d;(t=t||{}).input||b.error("missing input"),t.menu||b.error("missing menu"),t.eventBus||b.error("missing event bus"),e.mixin(this),this.eventBus=t.eventBus,this.minLength=_.isNumber(t.minLength)?t.minLength:1,this.input=t.input,this.menu=t.menu,this.enabled=!0,this.autoselect=!!t.autoselect,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),n=f(this,"activate","open","_onFocused"),i=f(this,"deactivate","_onBlurred"),s=f(this,"isActive","isOpen","_onEnterKeyed"),r=f(this,"isActive","isOpen","_onTabKeyed"),o=f(this,"isActive","_onEscKeyed"),a=f(this,"isActive","open","_onUpKeyed"),u=f(this,"isActive","open","_onDownKeyed"),c=f(this,"isActive","isOpen","_onLeftKeyed"),h=f(this,"isActive","isOpen","_onRightKeyed"),l=f(this,"_openIfActive","_onQueryChanged"),d=f(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",n,this).onSync("blurred",i,this).onSync("enterKeyed",s,this).onSync("tabKeyed",r,this).onSync("escKeyed",o,this).onSync("upKeyed",a,this).onSync("downKeyed",u,this).onSync("leftKeyed",c,this).onSync("rightKeyed",h,this).onSync("queryChanged",l,this).onSync("whitespaceChanged",d,this).onSync("langDirChanged",this._onLangDirChanged,this)}function f(n){var t=[].slice.call(arguments,1);return function(){var e=[].slice.call(arguments);_.each(t,function(t){return n[t].apply(n,e)})}}return _.mixin(t.prototype,{_hacks:function(){var s,r;s=this.input.$input||b("<div>"),r=this.menu.$node||b("<div>"),s.on("blur.tt",function(t){var e,n,i;e=document.activeElement,n=r.is(e),i=0<r.has(e).length,_.isMsie()&&(n||i)&&(t.preventDefault(),t.stopImmediatePropagation(),_.defer(function(){s.focus()}))}),r.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){if(this._updateHint(),this.autoselect){var s=this.selectors.cursor.substr(1);this.menu.$node.find(this.selectors.suggestion).first().addClass(s)}this.eventBus.trigger("render",e,n,i)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&(e.preventDefault(),e.stopPropagation()):this.autoselect&&this.select(this.menu.getTopSelectable())&&(e.preventDefault(),e.stopPropagation())},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=_.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,e,n,i,s,r;t=this.menu.getTopSelectable(),e=this.menu.getSelectableData(t),n=this.input.getInputValue(),!e||_.isBlankString(n)||this.input.hasOverflow()?this.input.clearHint():(i=x.normalizeQuery(n),s=_.escapeRegExChars(i),(r=new RegExp("^(?:"+s+")(.+$)","i").exec(e.val))&&this.input.setHint(n+r[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(_.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj,e.dataset)||(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj,e.dataset),this.close(),0))},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!(n=this.menu.getSelectableData(t))||e===n.val||this.eventBus.before("autocomplete",n.obj,n.dataset)||(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj,n.dataset),0))},moveCursor:function(t){var e,n,i,s,r,o;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),s=(i=this.menu.getSelectableData(n))?i.obj:null,r=i?i.dataset:null,o=n?n.attr("id"):null,this.input.trigger("cursorchange",o),!(this._minLengthMet()&&this.menu.update(e)||this.eventBus.before("cursorchange",s,r)||(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",s,r),0))},destroy:function(){this.input.destroy(),this.menu.destroy()}}),t}();!function(){"use strict";function i(t,n){t.each(function(){var t,e=b(this);(t=e.data(v.typeahead))&&n(t,e)})}function y(t){var e;return(e=_.isJQuery(t)||_.isElement(t)?b(t).first():[]).length?e:null}var t,v,e;t=b.fn.typeahead,v={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},e={initialize:function(p,g){var m;g=_.isArray(g)?g:[].slice.call(arguments,1),p=p||{};var t=b(this).attr("id");return m=n(p.classNames,t),this.each(function(){var t,e,n,i,s,r,o,a,u,c,h,l,d,f;_.each(g,function(t){t.highlight=!!p.highlight}),t=b(this),e=b(m.html.wrapper),n=y(p.hint),i=y(p.menu),s=!1!==p.hint&&!n,r=!1!==p.menu&&!i,s&&(d=m,n=(l=t).clone().addClass(d.classes.hint).removeData().css(d.css.hint).css((f=l,{backgroundAttachment:f.css("background-attachment"),backgroundClip:f.css("background-clip"),backgroundColor:f.css("background-color"),backgroundImage:f.css("background-image"),backgroundOrigin:f.css("background-origin"),backgroundPosition:f.css("background-position"),backgroundRepeat:f.css("background-repeat"),backgroundSize:f.css("background-size")})).prop({readonly:!0,required:!1}).removeAttr("id name placeholder").removeClass("required").attr({spellcheck:"false",tabindex:-1})),r&&(i=b(m.html.menu).css(m.css.menu)),n&&n.val(""),t=function(t,e){t.data(v.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}(t,m),(s||r)&&(e.css(m.css.wrapper),t.css(s?m.css.input:m.css.inputWithNoHint),t.wrap(e).parent().prepend(s?n:null).append(r?i:null)),h=r?C:k,o=new w({el:t}),a=new x({hint:n,input:t},m),u=new h({node:i,datasets:g},m),new S({$input:t,menu:u}),c=new A({input:a,menu:u,eventBus:o,minLength:p.minLength,autoselect:p.autoselect},m),t.data(v.www,m),t.data(v.typeahead,c)})},isEnabled:function(){var e;return i(this.first(),function(t){e=t.isEnabled()}),e},enable:function(){return i(this,function(t){t.enable()}),this},disable:function(){return i(this,function(t){t.disable()}),this},isActive:function(){var e;return i(this.first(),function(t){e=t.isActive()}),e},activate:function(){return i(this,function(t){t.activate()}),this},deactivate:function(){return i(this,function(t){t.deactivate()}),this},isOpen:function(){var e;return i(this.first(),function(t){e=t.isOpen()}),e},open:function(){return i(this,function(t){t.open()}),this},close:function(){return i(this,function(t){t.close()}),this},select:function(t){var e=!1,n=b(t);return i(this.first(),function(t){e=t.select(n)}),e},autocomplete:function(t){var e=!1,n=b(t);return i(this.first(),function(t){e=t.autocomplete(n)}),e},moveCursor:function(e){var n=!1;return i(this.first(),function(t){n=t.moveCursor(e)}),n},val:function(e){var n;return arguments.length?(i(this,function(t){t.setVal(_.toStr(e))}),this):(i(this.first(),function(t){n=t.getVal()}),n)},destroy:function(){return i(this,function(t,e){var n,i,s;i=(n=e).data(v.www),s=n.parent().filter(i.selectors.wrapper),_.each(n.data(v.attrs),function(t,e){_.isUndefined(t)?n.removeAttr(e):n.attr(e,t)}),n.removeData(v.typeahead).removeData(v.www).removeData(v.attr).removeClass(i.classes.input),s.length&&(n.detach().insertAfter(s),s.remove()),t.destroy()}),this}},b.fn.typeahead=function(t){return e[t]?e[t].apply(this,[].slice.call(arguments,1)):e.initialize.apply(this,arguments)},b.fn.typeahead.noConflict=function(){return b.fn.typeahead=t,this}}()})),window.onload=function(){if(window.jQuery){var t=t||{};t.typeahead=(l=jQuery,d="https://www.nhs.uk/search?collection=nhs-meta",f=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("disp"),queryTokenizer:Bloodhound.tokenizers.whitespace,limit:10,remote:{url:"https://nhs.funnelback.co.uk/s/suggest.json?collection=nhs-meta&partial_query=%QUERY&sort=0&fmt=json++&profile=&show=10",wildcard:"%QUERY"}}),p="#search-field",{init:function(){f.initialize();var n="suggestions-menu",i="suggestions-list",s="suggestions-wrapper",e='<svg class="nhsuk-icon nhsuk-icon__search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M19.71 18.29l-4.11-4.1a7 7 0 1 0-1.41 1.41l4.1 4.11a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 10a5 5 0 1 1 5 5 5 5 0 0 1-5-5z"></path><text aria-hidden="true">Search</text></svg>',r="nhsuk-header__search",o="nhsuk-header__search-form",a="nhsuk-search__input",u="nhsuk-search__submit",c="nhsuk-search__input--withdropdown",h="nhsuk-search__submit--withdropdown";l(p).typeahead({minLength:2,highlight:!0,classNames:{menu:n,suggestion:"suggestions-item",highlight:"",selectable:"s",dataset:s,cursor:"suggestions-item--selected",hint:"nhsuk-search__input--shadow"}},{name:"-suggestions",limit:10,display:"disp",source:f.ttAdapter(),templates:{header:'<li class="suggestions-title">Search suggestions</li>',notFound:'<li class="suggestions-none">No suggestions</li>',suggestion:function(t){var n="";switch(t.disp_t){case"J":l.each(t.disp,function(t,e){n+=e,n+=" "});break;default:n=36<t.disp.length?t.disp.substring(0,36)+"...":t.disp}switch(t.action_t){case"Q":n="<li>"+e+'<a href="'+d+"&query="+t.action+'">'+n+"</a></li>";break;case"E":n="<li>"+e+'<a href="'+d+"&query="+t.key+"&"+t.action+'">'+n+"</a></li>";break;case"U":n="<li>"+e+'<a href="'+t.action+'">'+n+"</a></li>";break;case"C":n="<li>"+e+'<a href="#" onClick="'+t.action+'">'+n+"</a></li>";break;default:n="<li>"+e+'<a href="'+d+"&query="+t.disp+'">'+n+"</a></li>"}return n}}}).bind("typeahead:open",function(){var t=l(p).typeahead("val"),e=l(p).attr("value");t===e&&l(p).typeahead("val",e),"enter a search term"===t.toLowerCase()&&l(p).typeahead("val","")}).bind("typeahead:render",function(){l("."+s).wrapInner('<ul class="'+i+'"></ul>'),l("."+i).css("width",l("."+o).width()),l("."+a).addClass(c),l("."+u).addClass(h),l("."+n).insertAfter(l("."+r));var t=l("."+o).offset().top+l("."+a).height(),e=l("."+r).position();l("."+n).css({top:t+2,left:e.left})}).bind("typeahead:close",function(){l("."+a).removeClass(c),l("."+u).removeClass(h)}).bind("typeahead:idle",function(){l("."+i).hide()})}}),$(function(){t.typeahead.init(),$(".nhsuk-search__input--shadow").attr("aria-hidden","true").addClass("nhsuk-u-visually-hidden")})}var l,d,f,p},document.addEventListener("DOMContentLoaded",function(){var e;(e={searchToggleButton:document.getElementById("toggle-search"),searchClose:document.getElementById("close-search"),searchContainer:document.getElementById("wrap-search"),menuSearchContainer:document.getElementById("content-header"),doToggle:function(t){function e(t,e){var n=t.className,i=new RegExp("\\b "+e+"\\b"),s=n.match(i);e=e.replace(/\s+/g,""),t.className=s?n.replace(i,""):n+" "+e}t.preventDefault(),this.searchToggleButton.hasAttribute("aria-expanded")?this.searchToggleButton.removeAttribute("aria-expanded"):this.searchToggleButton.setAttribute("aria-expanded","true"),e(this.searchToggleButton,"is-active"),e(this.searchContainer,"js-show"),e(this.menuSearchContainer,"js-show")}}).searchToggleButton&&e.searchToggleButton.addEventListener("click",function(t){e.doToggle(t)}),e.searchClose&&e.searchClose.addEventListener("click",function(t){e.doToggle(t)})}),document.addEventListener("DOMContentLoaded",function(){var e;(e={menuToggleButton:document.getElementById("toggle-menu"),menuClose:document.getElementById("close-menu"),nav:document.getElementById("header-navigation"),doToggle:function(t){function e(t,e){var n=t.className,i=new RegExp("\\b "+e+"\\b"),s=n.match(i);e=e.replace(/\s+/g,""),t.className=s?n.replace(i,""):n+" "+e}t.preventDefault(),this.menuToggleButton.hasAttribute("aria-expanded")?this.menuToggleButton.removeAttribute("aria-expanded"):this.menuToggleButton.setAttribute("aria-expanded","true"),e(this.menuToggleButton,"is-active"),e(this.nav,"js-show")}}).menuToggleButton&&e.menuToggleButton.addEventListener("click",function(t){e.doToggle(t)}),e.menuClose&&e.menuClose.addEventListener("click",function(t){e.doToggle(t)})});var banner=document.querySelector("#nhsuk-feedback-banner"),bannerCloseButton=document.querySelector("#nhsuk-feedback-banner-close");document.addEventListener("DOMContentLoaded",function(){setTimeout(function(){void 0!==banner&&null!=banner&&(banner.style.display="block")},3e3)}),bannerCloseButton&&bannerCloseButton.addEventListener("click",function(){banner.style.display="none"}),document.addEventListener("DOMContentLoaded",function(){var e={link:document.querySelector(".nhsuk-skip-link"),header:document.getElementsByTagName("H1")[0],doFocus:function(t){this.header.setAttribute("tabIndex","-1"),this.header.focus()},doLeave:function(t){this.header.removeAttribute("tabIndex")}};e.link&&e.header&&(e.link.addEventListener("click",function(t){t.preventDefault(),e.doFocus(t)}),e.header.addEventListener("blur",function(t){e.doLeave(t)}))}); | ||
window.jQuery&&(function(e,n){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.Bloodhound=n(t)}):"object"==typeof module&&module.exports?module.exports=n(require("jquery")):e.Bloodhound=n(e.jQuery)}(this,function(f){var p=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:f.isArray,isFunction:f.isFunction,isObject:f.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof f},toStr:function(t){return p.isUndefined(t)||null===t?"":t+""},bind:f.proxy,each:function(t,n){f.each(t,function(t,e){return n(e,t)})},map:f.map,filter:f.grep,every:function(n,i){var s=!0;return n?(f.each(n,function(t,e){if(!(s=i.call(null,e,t,n)))return!1}),!!s):s},some:function(n,i){var s=!1;return n?(f.each(n,function(t,e){if(s=i.call(null,e,t,n))return!1}),!!s):s},mixin:f.extend,identity:function(t){return t},clone:function(t){return f.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return f.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(s,r,o){var a,u;return function(){var t,e,n=this,i=arguments;return t=function(){a=null,o||(u=s.apply(n,i))},e=o&&!a,clearTimeout(a),a=setTimeout(t,r),e&&(u=s.apply(n,i)),u}},throttle:function(n,i){var s,r,o,a,u,c;return u=0,c=function(){u=new Date,o=null,a=n.apply(s,r)},function(){var t=new Date,e=i-(t-u);return s=this,r=arguments,e<=0?(clearTimeout(o),o=null,u=t,a=n.apply(s,r)):o||(o=setTimeout(c,e)),a}},stringify:function(t){return p.isString(t)?t:JSON.stringify(t)},guid:function(){function t(t){var e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return"tt-"+t()+t(!0)+t(!0)+t()},noop:function(){}}}(),n=function(){"use strict";function t(t){return(t=p.toStr(t))?t.split(/\s+/):[]}function e(t){return(t=p.toStr(t))?t.split(/\W+/):[]}function n(t){t=p.toStr(t);var e=[],n="";return p.each(t.split(""),function(t){t.match(/\s+/)?n="":(e.push(n+t),n+=t)}),e}function i(i){return function(t){return t=p.isArray(t)?t:[].slice.call(arguments,0),function(e){var n=[];return p.each(t,function(t){n=n.concat(i(p.toStr(e[t])))}),n}}}return{nonword:e,whitespace:t,ngram:n,obj:{nonword:i(e),whitespace:i(t),ngram:i(n)}}}(),i=function(){"use strict";function t(t){this.maxSize=p.isNumber(t)?t:100,this.reset(),this.maxSize<=0&&(this.set=this.get=f.noop)}function e(){this.head=this.tail=null}function s(t,e){this.key=t,this.val=e,this.prev=this.next=null}return p.mixin(t.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new s(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new e}}),p.mixin(e.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),e=function(){"use strict";function t(t,e){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+p.escapeRegExChars(this.prefix)),this.ls=e||r,!this.ls&&this._noop()}function i(){return(new Date).getTime()}function s(t){return JSON.stringify(p.isUndefined(t)?null:t)}function n(t){return f.parseJSON(t)}var r;try{(r=window.localStorage).setItem("~~~","!"),r.removeItem("~~~")}catch(t){r=null}return p.mixin(t.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=p.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),n(this.ls.getItem(this._prefix(t)))},set:function(t,e,n){return p.isNumber(n)?this._safeSet(this._ttlKey(t),s(i()+n)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),s(e))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=function(t){var e,n,i=[],s=r.length;for(e=0;e<s;e++)(n=r.key(e)).match(t)&&i.push(n.replace(t,""));return i}(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var e=n(this.ls.getItem(this._ttlKey(t)));return!!(p.isNumber(e)&&i()>e)}}),t}(),s=function(){"use strict";function t(t){t=t||{},this.maxPendingRequests=t.maxPendingRequests||6,this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new i(0):e}var a=0,u={},e=new i(10);return t.setMaxPendingRequests=function(t){this.maxPendingRequests=t},t.resetCache=function(){e.reset()},p.mixin(t.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+f.param(t.data||{})},_get:function(t,e){function n(t){e(null,t),o._cache.set(s,t)}function i(){e(!0)}var s,r,o=this;s=this._fingerprint(t),this.cancelled||s!==this.lastReq||((r=u[s])?r.done(n).fail(i):a<this.maxPendingRequests?(a++,u[s]=this._send(t).done(n).fail(i).always(function(){a--,delete u[s],o.onDeckRequestArgs&&(o._get.apply(o,o.onDeckRequestArgs),o.onDeckRequestArgs=null)})):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(t,e){var n,i;e=e||f.noop,t=p.isString(t)?{url:t}:t||{},i=this._fingerprint(t),this.cancelled=!1,this.lastReq=i,(n=this._cache.get(i))?e(null,n):this._get(t,e)},cancel:function(){this.cancelled=!0}}),t}(),r=window.SearchIndex=function(){"use strict";function t(t){(t=t||{}).datumTokenizer&&t.queryTokenizer||f.error("datumTokenizer and queryTokenizer are both required"),this.identify=t.identify||p.stringify,this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.matchAnyQueryToken=t.matchAnyQueryToken,this.reset()}function n(t){return t=p.filter(t,function(t){return!!t}),p.map(t,function(t){return t.toLowerCase()})}function o(){var t={};return t[u]=[],t[a]={},t}var a="c",u="i";return p.mixin(t.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var r=this;t=p.isArray(t)?t:[t],p.each(t,function(t){var s,e;r.datums[s=r.identify(t)]=t,e=n(r.datumTokenizer(t)),p.each(e,function(t){var e,n,i;for(e=r.trie,n=t.split("");i=n.shift();)(e=e[a][i]||(e[a][i]=o()))[u].push(s)})})},get:function(t){var e=this;return p.map(t,function(t){return e.datums[t]})},search:function(t){var e,r,o=this;return e=n(this.queryTokenizer(t)),p.each(e,function(t){var e,n,i,s;if(r&&0===r.length&&!o.matchAnyQueryToken)return!1;for(e=o.trie,n=t.split("");e&&(i=n.shift());)e=e[a][i];if(e&&0===n.length)s=e[u].slice(0),r=r?function(t,e){var n=0,i=0,s=[];t=t.sort(),e=e.sort();for(var r=t.length,o=e.length;n<r&&i<o;)t[n]<e[i]?n++:(t[n]>e[i]||(s.push(t[n]),n++),i++);return s}(r,s):s;else if(!o.matchAnyQueryToken)return!(r=[])}),r?p.map(function(t){for(var e={},n=[],i=0,s=t.length;i<s;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}(r),function(t){return o.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=o()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),t}(),o=function(){"use strict";function t(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new e(t.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},p.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(n.data),e.protocol=this.storage.get(n.protocol),e.thumbprint=this.storage.get(n.thumbprint),t=e.thumbprint!==this.thumbprint||e.protocol!==location.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(e){var t,n=this;e&&(t=this.prepare(this._settings()),this.transport(t).fail(function(){e(!0)}).done(function(t){e(null,n.transform(t))}))},clear:function(){return this.storage.clear(),this}}),t}(),a=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.indexResponse=t.indexResponse,this.transport=new s({cache:t.cache,limiter:t.limiter,transport:t.transport,maxPendingRequests:t.maxPendingRequests})}return p.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,n){var e,i=this;if(n)return t=t||"",e=this.prepare(t,this._settings()),this.transport.get(e,function(t,e){n(t?[]:i.transform(e))})},cancelLastRequest:function(){this.transport.cancel()}}),t}(),u=function(){"use strict";function r(t){var e,n,i,s,r,o,a,u,c,h,l;if(t)return e={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:p.identity,transport:null},t=p.isString(t)?{url:t}:t,!(t=p.mixin(e,t)).url&&f.error("remote requires url to be set"),t.transform=t.filter||t.transform,t.prepare=(c=(u=t).prepare,h=u.replace,l=u.wildcard,c||(c=h?function(t,e){return e.url=h(e.url,t),e}:u.wildcard?function(t,e){return e.url=e.url.replace(l,encodeURIComponent(t)),e}:function(t,e){return e})),t.limiter=(i=(n=t).limiter,s=n.rateLimitBy,r=n.rateLimitWait,i||(i=/^throttle$/i.test(s)?(a=r,function(t){return p.throttle(t,a)}):(o=r,function(t){return p.debounce(t,o)})),i),t.transport=t.transport?d(t.transport):f.ajax,delete t.replace,delete t.wildcard,delete t.rateLimitBy,delete t.rateLimitWait,t}function d(n){return function(t){var e=f.Deferred();return n(t,function(t){p.defer(function(){e.resolve(t)})},function(t){p.defer(function(){e.reject(t)})}),e}}return function(t){var e,n,i,s;return e={initialize:!0,identify:p.stringify,datumTokenizer:null,queryTokenizer:null,matchAnyQueryToken:!1,sufficient:5,indexRemote:!1,sorter:null,local:[],prefetch:null,remote:null},!(t=p.mixin(e,t||{})).datumTokenizer&&f.error("datumTokenizer is required"),!t.queryTokenizer&&f.error("queryTokenizer is required"),n=t.sorter,t.sorter=n?function(t){return t.sort(n)}:p.identity,t.local=p.isFunction(t.local)?t.local():t.local,t.prefetch=(i=t.prefetch)?(s={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:p.identity,transform:p.identity,transport:null},i=p.isString(i)?{url:i}:i,!(i=p.mixin(s,i)).url&&f.error("prefetch requires url to be set"),i.transform=i.filter||i.transform,i.cacheKey=i.cacheKey||i.url,i.thumbprint="1.2.1"+i.thumbprint,i.transport=i.transport?d(i.transport):f.ajax,i):null,t.remote=r(t.remote),t}}();return function(){"use strict";function t(t){t=u(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.indexRemote=t.indexRemote,this.local=t.local,this.remote=t.remote?new a(t.remote):null,this.prefetch=t.prefetch?new o(t.prefetch):null,this.index=new r({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}var e;return e=window&&window.Bloodhound,t.noConflict=function(){return window&&(window.Bloodhound=e),t},t.tokenizers=n,p.mixin(t.prototype,{__ttAdapter:function(){var i=this;return this.remote?function(t,e,n){return i.search(t,e,n)}:function(t,e){return i.search(t,e)}},_loadPrefetch:function(){var n,t,i=this;return n=f.Deferred(),this.prefetch?(t=this.prefetch.fromCache())?(this.index.bootstrap(t),n.resolve()):this.prefetch.fromNetwork(function(t,e){if(t)return n.reject();i.add(e),i.prefetch.store(i.index.serialize()),n.resolve()}):n.resolve(),n.promise()},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(function(){t.add(t.local)}),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=p.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,e,i){var s,r=this;return e=e||p.noop,i=i||p.noop,s=this.sorter(this.index.search(t)),e(this.remote?s.slice():s),this.remote&&s.length<this.sufficient?this.remote.get(t,function(t){var n=[];p.each(t,function(e){!p.some(s,function(t){return r.identify(e)===r.identify(t)})&&n.push(e)}),r.indexRemote&&r.add(n),i(n)}):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return s.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),t}()}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(t.jQuery)}(this,function(b){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:b.isArray,isFunction:b.isFunction,isObject:b.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(t){return t instanceof b},toStr:function(t){return _.isUndefined(t)||null===t?"":t+""},bind:b.proxy,each:function(t,n){b.each(t,function(t,e){return n(e,t)})},map:b.map,filter:b.grep,every:function(n,i){var s=!0;return n?(b.each(n,function(t,e){if(!(s=i.call(null,e,t,n)))return!1}),!!s):s},some:function(n,i){var s=!1;return n?(b.each(n,function(t,e){if(s=i.call(null,e,t,n))return!1}),!!s):s},mixin:b.extend,identity:function(t){return t},clone:function(t){return b.extend(!0,{},t)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(t){return b.isFunction(t)?t:function(){return String(t)}},defer:function(t){setTimeout(t,0)},debounce:function(s,r,o){var a,u;return function(){var t,e,n=this,i=arguments;return t=function(){a=null,o||(u=s.apply(n,i))},e=o&&!a,clearTimeout(a),a=setTimeout(t,r),e&&(u=s.apply(n,i)),u}},throttle:function(n,i){var s,r,o,a,u,c;return u=0,c=function(){u=new Date,o=null,a=n.apply(s,r)},function(){var t=new Date,e=i-(t-u);return s=this,r=arguments,e<=0?(clearTimeout(o),o=null,u=t,a=n.apply(s,r)):o||(o=setTimeout(c,e)),a}},stringify:function(t){return _.isString(t)?t:JSON.stringify(t)},guid:function(){function t(t){var e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e}return"tt-"+t()+t(!0)+t(!0)+t()},noop:function(){}}}(),n=function(){"use strict";var c={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return function(t,e){var n,i,s,r,o,a,u;return i=_.mixin({},c,t),{css:(n={css:(u={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}},_.isMsie()&&_.mixin(u.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),u),classes:i,html:(o=i,a=e,{wrapper:'<span class="'+o.wrapper+'"></span>',menu:'<div id="'+a+'_listbox" role="listbox" class="'+o.menu+'"></div>'}),selectors:(s=i,r={},_.each(s,function(t,e){r[e]="."+t}),r)}).css,html:n.html,classes:n.classes,selectors:n.selectors,mixin:function(t){_.mixin(t,n)}}}}(),w=function(){"use strict";function t(t){t&&t.el||b.error("EventBus initialized without el"),this.$el=b(t.el)}var n;return"typeahead:",n={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},_.mixin(t.prototype,{_trigger:function(t,e){var n=b.Event("typeahead:"+t);return this.$el.trigger.call(this.$el,n,e||[]),n},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=n[t])&&this._trigger(e,[].slice.call(arguments,1))}}),t}(),e=function(){"use strict";function i(t,e,n,i){var s;if(!n)return this;for(e=e.split(a),n=i?function(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}(n,i):n,this._callbacks=this._callbacks||{};s=e.shift();)this._callbacks[s]=this._callbacks[s]||{sync:[],async:[]},this._callbacks[s][t].push(n);return this}function o(i,s,r){return function(){for(var t,e=0,n=i.length;!t&&e<n;e+=1)t=!1===i[e].apply(s,r);return!t}}var a=/\s+/,u=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)};return{onSync:function(t,e,n){return i.call(this,"sync",t,e,n)},onAsync:function(t,e,n){return i.call(this,"async",t,e,n)},off:function(t){var e;if(!this._callbacks)return this;for(t=t.split(a);e=t.shift();)delete this._callbacks[e];return this},trigger:function(t){var e,n,i,s,r;if(!this._callbacks)return this;for(t=t.split(a),i=[].slice.call(arguments,1);(e=t.shift())&&(n=this._callbacks[e]);)s=o(n.sync,this,[e].concat(i)),r=o(n.async,this,[e].concat(i)),s()&&u(r);return this}}}(),u=function(o){"use strict";function c(t){return e[t.toUpperCase()]||t}var t={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1,diacriticInsensitive:!1},e={A:"[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",B:"[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",C:"[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",D:"[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",E:"[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",F:"[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",G:"[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",H:"[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",I:"[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",J:"[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",K:"[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",L:"[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",M:"[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",N:"[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",O:"[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",P:"[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",Q:"[Qqℚ⒬Ⓠⓠ㏃Qq]",R:"[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",S:"[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",T:"[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",U:"[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",V:"[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",W:"[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",X:"[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",Y:"[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",Z:"[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"};return function(s){var r;(s=_.mixin({},t,s)).node&&s.pattern&&(s.pattern=_.isArray(s.pattern)?s.pattern:[s.pattern],r=function(t,e,n,i){for(var s,r=[],o=0,a=t.length;o<a;o++){var u=_.escapeRegExChars(t[o]);i&&(u=u.replace(/\S/g,c)),r.push(u)}return s=n?"\\b("+r.join("|")+")\\b":"("+r.join("|")+")",e?new RegExp(s):new RegExp(s,"i")}(s.pattern,s.caseSensitive,s.wordsOnly,s.diacriticInsensitive),function t(e,n){for(var i,s=0;s<e.childNodes.length;s++)3===(i=e.childNodes[s]).nodeType?s+=n(i)?1:0:t(i,n)}(s.node,function(t){var e,n,i;return(e=r.exec(t.data))&&(i=o.createElement(s.tagName),s.className&&(i.className=s.className),(n=t.splitText(e.index)).splitText(e[0].length),i.appendChild(n.cloneNode(!0)),t.parentNode.replaceChild(i,n)),!!e}))}}(window.document),x=function(){"use strict";function o(t,e){var n;(t=t||{}).input||b.error("input is missing"),e.mixin(this),this.$hint=b(t.hint),this.$input=b(t.input),this.$input.attr({"aria-owns":this.$input.attr("id")+"_listbox",role:"textbox","aria-readonly":"true","aria-autocomplete":"list"}),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=(n=this.$input,b('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:n.css("font-family"),fontSize:n.css("font-size"),fontStyle:n.css("font-style"),fontVariant:n.css("font-variant"),fontWeight:n.css("font-weight"),wordSpacing:n.css("word-spacing"),letterSpacing:n.css("letter-spacing"),textIndent:n.css("text-indent"),textRendering:n.css("text-rendering"),textTransform:n.css("text-transform")}).insertAfter(n)),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop),this.onSync("cursorchange",this._updateDescendent)}function i(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}var r;return r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},o.normalizeQuery=function(t){return _.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},_.mixin(o.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(t){var e=r[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var n;switch(t){case"up":case"down":n=!i(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!i(e);break;default:n=!0}return n},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var n,i,s,r;s=t,r=this.query,i=!!(n=o.normalizeQuery(s)===o.normalizeQuery(r))&&this.query.length!==t.length,this.query=t,e||n?!e&&i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},_updateDescendent:function(t,e){this.$input.attr("aria-activedescendant",e)},bind:function(){var t,e,n,i,s=this;return t=_.bind(this._onBlur,this),e=_.bind(this._onFocus,this),n=_.bind(this._onKeydown,this),i=_.bind(this._onInput,this),this.$input.on("blur.tt",t).on("focus.tt",e).on("keydown.tt",n),!_.isMsie()||9<_.isMsie()?this.$input.on("input.tt",i):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){r[t.which||t.keyCode]||_.defer(_.bind(s._onInput,s,t))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,e,n;return t=this.$input.val().length,e=this.$input[0].selectionStart,_.isNumber(e)?e===t:!document.selection||((n=document.selection.createRange()).moveStart("character",-t),t===n.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=b("<div>")}}),o}(),s=function(){"use strict";function t(t,e){var n,i,s,r;(t=t||{}).templates=t.templates||{},t.templates.notFound=t.templates.notFound||t.templates.empty,t.source||b.error("missing source"),t.node||b.error("missing node"),t.name&&(r=t.name,!/^[_a-zA-Z0-9-]+$/.test(r))&&b.error("invalid dataset name: "+t.name),e.mixin(this),this.highlight=!!t.highlight,this.name=_.toStr(t.name||a()),this.limit=t.limit||5,this.displayFn=(s=(s=t.display||t.displayKey)||_.stringify,_.isFunction(s)?s:function(t){return t[s]}),this.templates=(n=t.templates,i=this.displayFn,{notFound:n.notFound&&_.templatify(n.notFound),pending:n.pending&&_.templatify(n.pending),header:n.header&&_.templatify(n.header),footer:n.footer&&_.templatify(n.footer),suggestion:n.suggestion?function(t){var e=n.suggestion;return b(e(t)).attr("id",_.guid())}:function(t){return b('<div role="option">').attr("id",_.guid()).text(i(t))}}),this.source=t.source.__ttAdapter?t.source.__ttAdapter():t.source,this.async=_.isUndefined(t.async)?2<this.source.length:!!t.async,this._resetLastSuggestion(),this.$el=b(t.node).attr("role","presentation").addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}var o,a;return o={dataset:"tt-selectable-dataset",val:"tt-selectable-display",obj:"tt-selectable-object"},a=_.getIdGenerator(),t.extractData=function(t){var e=b(t);return e.data(o.obj)?{dataset:e.data(o.dataset)||"",val:e.data(o.val)||"",obj:e.data(o.obj)||null}:null},_.mixin(t.prototype,e,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",e,!1,this.name)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",e,!0,this.name)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,i;i=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(i,t){var s,r=this;return s=document.createDocumentFragment(),_.each(t,function(t){var e,n;n=r._injectQuery(i,t),e=b(r.templates.suggestion(n)).data(o.dataset,r.name).data(o.obj,t).data(o.val,r.displayFn(t)).addClass(r.classes.suggestion+" "+r.classes.selectable),s.appendChild(e[0])}),this.highlight&&u({className:this.classes.highlight,node:s,pattern:i}),b(s)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=b()},_injectQuery:function(t,e){return _.isObject(e)?_.mixin({_query:t},e):e},update:function(n){function t(t){e||(e=!0,t=(t||[]).slice(0,i.limit),r=t.length,i._overwrite(n,t),r<i.limit&&i.async&&i.trigger("asyncRequested",n,i.name))}var i=this,s=!1,e=!1,r=0;this.cancel(),this.cancel=function(){s=!0,i.cancel=b.noop,i.async&&i.trigger("asyncCanceled",n,i.name)},this.source(n,t,function(t){if(t=t||[],!s&&r<i.limit){i.cancel=b.noop;var e=Math.abs(r-i.limit);r+=e,i._append(n,t.slice(0,e)),i.async&&i.trigger("asyncReceived",n,i.name)}}),!e&&t([])},cancel:b.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=b("<div>")}}),t}(),k=function(){"use strict";function t(t,n){var i=this;(t=t||{}).node||b.error("node is required"),n.mixin(this),this.$node=b(t.node),this.query=null,this.datasets=_.map(t.datasets,function(t){var e=i.$node.find(t.node).first();return t.node=e.length?e:b("<div>").appendTo(i.$node),new s(t,n)})}return _.mixin(t.prototype,e,{_onSelectableClick:function(t){this.trigger("selectableClicked",b(t.currentTarget))},_onRendered:function(t,e,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return _.every(this.datasets,_.bind(function(t){var e=t.isEmpty();return this.$node.attr("aria-expanded",!e),e},this))},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,i,s;n=(e=t.position().top)+t.outerHeight(!0),i=this.$node.scrollTop(),s=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(i+e):s<n&&this.$node.scrollTop(i+(n-s))},bind:function(){var t,e=this;return t=_.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),this.$node.on("mouseover",this.selectors.selectable,function(){e.setCursor(b(this))}),this.$node.on("mouseleave",function(){e._removeCursor()}),_.each(this.datasets,function(t){t.onSync("asyncRequested",e._propagate,e).onSync("asyncCanceled",e._propagate,e).onSync("asyncReceived",e._propagate,e).onSync("rendered",e._onRendered,e).onSync("cleared",e._onCleared,e)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.scrollTop(0),this.$node.addClass(this.classes.open)},close:function(){this.$node.attr("aria-expanded",!1),this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,n,i;return n=this.getActiveSelectable(),e=this._getSelectables(),-1===(i=(i=((i=(n?e.index(n):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:i)?null:e.eq(i)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?s.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(e){var t=e!==this.query;return t&&(this.query=e,_.each(this.datasets,function(t){t.update(e)})),t},empty:function(){_.each(this.datasets,function(t){t.clear()}),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){this.$node.off(".tt"),this.$node=b("<div>"),_.each(this.datasets,function(t){t.destroy()})}}),t}(),S=function(){"use strict";function t(t){this.$el=b("<span></span>",{role:"status","aria-live":"polite"}).css({position:"absolute",padding:"0",border:"0",height:"1px",width:"1px","margin-bottom":"-1px","margin-right":"-1px",overflow:"hidden",clip:"rect(0 0 0 0)","white-space":"nowrap"}),t.$input.after(this.$el),_.each(t.menu.datasets,_.bind(function(t){t.onSync&&(t.onSync("rendered",_.bind(this.update,this)),t.onSync("cleared",_.bind(this.cleared,this)))},this))}return _.mixin(t.prototype,{update:function(t,e){if(arguments[2]){var n,i=e.length;n=1===i?{result:"result",is:"is"}:{result:"results",is:"are"},this.$el.text(i+" "+n.result+" "+n.is+" available. Keyboard users can use up and down arrow keys to navigate.")}},cleared:function(){this.$el.text("")}}),t}(),C=function(){"use strict";function t(){k.apply(this,[].slice.call(arguments,0))}var e=k.prototype;return _.mixin(t.prototype,k.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),e.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),e.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(t){return this.$node.css("ltr"===t?this.css.ltr:this.css.rtl),e.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),t}(),A=function(){"use strict";function t(t,e){var n,i,s,r,o,a,u,c,h,l,d;(t=t||{}).input||b.error("missing input"),t.menu||b.error("missing menu"),t.eventBus||b.error("missing event bus"),e.mixin(this),this.eventBus=t.eventBus,this.minLength=_.isNumber(t.minLength)?t.minLength:1,this.input=t.input,this.menu=t.menu,this.enabled=!0,this.autoselect=!!t.autoselect,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),n=f(this,"activate","open","_onFocused"),i=f(this,"deactivate","_onBlurred"),s=f(this,"isActive","isOpen","_onEnterKeyed"),r=f(this,"isActive","isOpen","_onTabKeyed"),o=f(this,"isActive","_onEscKeyed"),a=f(this,"isActive","open","_onUpKeyed"),u=f(this,"isActive","open","_onDownKeyed"),c=f(this,"isActive","isOpen","_onLeftKeyed"),h=f(this,"isActive","isOpen","_onRightKeyed"),l=f(this,"_openIfActive","_onQueryChanged"),d=f(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",n,this).onSync("blurred",i,this).onSync("enterKeyed",s,this).onSync("tabKeyed",r,this).onSync("escKeyed",o,this).onSync("upKeyed",a,this).onSync("downKeyed",u,this).onSync("leftKeyed",c,this).onSync("rightKeyed",h,this).onSync("queryChanged",l,this).onSync("whitespaceChanged",d,this).onSync("langDirChanged",this._onLangDirChanged,this)}function f(n){var t=[].slice.call(arguments,1);return function(){var e=[].slice.call(arguments);_.each(t,function(t){return n[t].apply(n,e)})}}return _.mixin(t.prototype,{_hacks:function(){var s,r;s=this.input.$input||b("<div>"),r=this.menu.$node||b("<div>"),s.on("blur.tt",function(t){var e,n,i;e=document.activeElement,n=r.is(e),i=0<r.has(e).length,_.isMsie()&&(n||i)&&(t.preventDefault(),t.stopImmediatePropagation(),_.defer(function(){s.focus()}))}),r.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){if(this._updateHint(),this.autoselect){var s=this.selectors.cursor.substr(1);this.menu.$node.find(this.selectors.suggestion).first().addClass(s)}this.eventBus.trigger("render",e,n,i)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&(e.preventDefault(),e.stopPropagation()):this.autoselect&&this.select(this.menu.getTopSelectable())&&(e.preventDefault(),e.stopPropagation())},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=_.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,e,n,i,s,r;t=this.menu.getTopSelectable(),e=this.menu.getSelectableData(t),n=this.input.getInputValue(),!e||_.isBlankString(n)||this.input.hasOverflow()?this.input.clearHint():(i=x.normalizeQuery(n),s=_.escapeRegExChars(i),(r=new RegExp("^(?:"+s+")(.+$)","i").exec(e.val))&&this.input.setHint(n+r[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(_.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj,e.dataset)||(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj,e.dataset),this.close(),0))},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!(n=this.menu.getSelectableData(t))||e===n.val||this.eventBus.before("autocomplete",n.obj,n.dataset)||(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj,n.dataset),0))},moveCursor:function(t){var e,n,i,s,r,o;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),s=(i=this.menu.getSelectableData(n))?i.obj:null,r=i?i.dataset:null,o=n?n.attr("id"):null,this.input.trigger("cursorchange",o),!(this._minLengthMet()&&this.menu.update(e)||this.eventBus.before("cursorchange",s,r)||(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",s,r),0))},destroy:function(){this.input.destroy(),this.menu.destroy()}}),t}();!function(){"use strict";function i(t,n){t.each(function(){var t,e=b(this);(t=e.data(v.typeahead))&&n(t,e)})}function y(t){var e;return(e=_.isJQuery(t)||_.isElement(t)?b(t).first():[]).length?e:null}var t,v,e;t=b.fn.typeahead,v={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},e={initialize:function(p,g){var m;g=_.isArray(g)?g:[].slice.call(arguments,1),p=p||{};var t=b(this).attr("id");return m=n(p.classNames,t),this.each(function(){var t,e,n,i,s,r,o,a,u,c,h,l,d,f;_.each(g,function(t){t.highlight=!!p.highlight}),t=b(this),e=b(m.html.wrapper),n=y(p.hint),i=y(p.menu),s=!1!==p.hint&&!n,r=!1!==p.menu&&!i,s&&(d=m,n=(l=t).clone().addClass(d.classes.hint).removeData().css(d.css.hint).css((f=l,{backgroundAttachment:f.css("background-attachment"),backgroundClip:f.css("background-clip"),backgroundColor:f.css("background-color"),backgroundImage:f.css("background-image"),backgroundOrigin:f.css("background-origin"),backgroundPosition:f.css("background-position"),backgroundRepeat:f.css("background-repeat"),backgroundSize:f.css("background-size")})).prop({readonly:!0,required:!1}).removeAttr("id name placeholder").removeClass("required").attr({spellcheck:"false",tabindex:-1})),r&&(i=b(m.html.menu).css(m.css.menu)),n&&n.val(""),t=function(t,e){t.data(v.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}(t,m),(s||r)&&(e.css(m.css.wrapper),t.css(s?m.css.input:m.css.inputWithNoHint),t.wrap(e).parent().prepend(s?n:null).append(r?i:null)),h=r?C:k,o=new w({el:t}),a=new x({hint:n,input:t},m),u=new h({node:i,datasets:g},m),new S({$input:t,menu:u}),c=new A({input:a,menu:u,eventBus:o,minLength:p.minLength,autoselect:p.autoselect},m),t.data(v.www,m),t.data(v.typeahead,c)})},isEnabled:function(){var e;return i(this.first(),function(t){e=t.isEnabled()}),e},enable:function(){return i(this,function(t){t.enable()}),this},disable:function(){return i(this,function(t){t.disable()}),this},isActive:function(){var e;return i(this.first(),function(t){e=t.isActive()}),e},activate:function(){return i(this,function(t){t.activate()}),this},deactivate:function(){return i(this,function(t){t.deactivate()}),this},isOpen:function(){var e;return i(this.first(),function(t){e=t.isOpen()}),e},open:function(){return i(this,function(t){t.open()}),this},close:function(){return i(this,function(t){t.close()}),this},select:function(t){var e=!1,n=b(t);return i(this.first(),function(t){e=t.select(n)}),e},autocomplete:function(t){var e=!1,n=b(t);return i(this.first(),function(t){e=t.autocomplete(n)}),e},moveCursor:function(e){var n=!1;return i(this.first(),function(t){n=t.moveCursor(e)}),n},val:function(e){var n;return arguments.length?(i(this,function(t){t.setVal(_.toStr(e))}),this):(i(this.first(),function(t){n=t.getVal()}),n)},destroy:function(){return i(this,function(t,e){var n,i,s;i=(n=e).data(v.www),s=n.parent().filter(i.selectors.wrapper),_.each(n.data(v.attrs),function(t,e){_.isUndefined(t)?n.removeAttr(e):n.attr(e,t)}),n.removeData(v.typeahead).removeData(v.www).removeData(v.attr).removeClass(i.classes.input),s.length&&(n.detach().insertAfter(s),s.remove()),t.destroy()}),this}},b.fn.typeahead=function(t){return e[t]?e[t].apply(this,[].slice.call(arguments,1)):e.initialize.apply(this,arguments)},b.fn.typeahead.noConflict=function(){return b.fn.typeahead=t,this}}()})),window.onload=function(){if(window.jQuery){var t=t||{};t.typeahead=(l=jQuery,d="https://www.nhs.uk/search?collection=nhs-meta",f=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("disp"),queryTokenizer:Bloodhound.tokenizers.whitespace,limit:10,remote:{url:"https://nhs.funnelback.co.uk/s/suggest.json?collection=nhs-meta&partial_query=%QUERY&sort=0&fmt=json++&profile=&show=10",wildcard:"%QUERY"}}),p="#search-field",{init:function(){f.initialize();var n="suggestions-menu",i="suggestions-list",s="suggestions-wrapper",e='<svg class="nhsuk-icon nhsuk-icon__search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M19.71 18.29l-4.11-4.1a7 7 0 1 0-1.41 1.41l4.1 4.11a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 10a5 5 0 1 1 5 5 5 5 0 0 1-5-5z"></path><text aria-hidden="true">Search</text></svg>',r="nhsuk-header__search",o="nhsuk-header__search-form",a="nhsuk-search__input",u="nhsuk-search__submit",c="nhsuk-search__input--withdropdown",h="nhsuk-search__submit--withdropdown";l(p).typeahead({minLength:2,highlight:!0,classNames:{menu:n,suggestion:"suggestions-item",highlight:"",selectable:"s",dataset:s,cursor:"suggestions-item--selected",hint:"nhsuk-search__input--shadow"}},{name:"-suggestions",limit:10,display:"disp",source:f.ttAdapter(),templates:{header:'<li class="suggestions-title">Search suggestions</li>',notFound:'<li class="suggestions-none">No suggestions</li>',suggestion:function(t){var n="";switch(t.disp_t){case"J":l.each(t.disp,function(t,e){n+=e,n+=" "});break;default:n=36<t.disp.length?t.disp.substring(0,36)+"...":t.disp}switch(t.action_t){case"Q":n="<li>"+e+'<a href="'+d+"&query="+t.action+'">'+n+"</a></li>";break;case"E":n="<li>"+e+'<a href="'+d+"&query="+t.key+"&"+t.action+'">'+n+"</a></li>";break;case"U":n="<li>"+e+'<a href="'+t.action+'">'+n+"</a></li>";break;case"C":n="<li>"+e+'<a href="#" onClick="'+t.action+'">'+n+"</a></li>";break;default:n="<li>"+e+'<a href="'+d+"&query="+t.disp+'">'+n+"</a></li>"}return n}}}).bind("typeahead:open",function(){var t=l(p).typeahead("val"),e=l(p).attr("value");t===e&&l(p).typeahead("val",e),"enter a search term"===t.toLowerCase()&&l(p).typeahead("val","")}).bind("typeahead:render",function(){l("."+s).wrapInner('<ul class="'+i+'"></ul>'),l("."+i).css("width",l("."+o).width()),l("."+a).addClass(c),l("."+u).addClass(h),l("."+n).insertAfter(l("."+r));var t=l("."+o).offset().top+l("."+a).height(),e=l("."+r).position();l("."+n).css({top:t+2,left:e.left})}).bind("typeahead:close",function(){l("."+a).removeClass(c),l("."+u).removeClass(h)}).bind("typeahead:idle",function(){l("."+i).hide()})}}),$(function(){t.typeahead.init(),$(".nhsuk-search__input--shadow").attr("aria-hidden","true").addClass("nhsuk-u-visually-hidden")})}var l,d,f,p},document.addEventListener("DOMContentLoaded",function(){var e;(e={searchToggleButton:document.getElementById("toggle-search"),searchClose:document.getElementById("close-search"),searchContainer:document.getElementById("wrap-search"),menuSearchContainer:document.getElementById("content-header"),doToggle:function(t){function e(t,e){var n=t.className,i=new RegExp("\\b "+e+"\\b"),s=n.match(i);e=e.replace(/\s+/g,""),t.className=s?n.replace(i,""):n+" "+e}t.preventDefault(),this.searchToggleButton.hasAttribute("aria-expanded")?this.searchToggleButton.removeAttribute("aria-expanded"):this.searchToggleButton.setAttribute("aria-expanded","true"),e(this.searchToggleButton,"is-active"),e(this.searchContainer,"js-show"),e(this.menuSearchContainer,"js-show")}}).searchToggleButton&&e.searchToggleButton.addEventListener("click",function(t){e.doToggle(t)}),e.searchClose&&e.searchClose.addEventListener("click",function(t){e.doToggle(t)})}),document.addEventListener("DOMContentLoaded",function(){var e;(e={menuToggleButton:document.getElementById("toggle-menu"),menuClose:document.getElementById("close-menu"),nav:document.getElementById("header-navigation"),doToggle:function(t){function e(t,e){var n=t.className,i=new RegExp("\\b "+e+"\\b"),s=n.match(i);e=e.replace(/\s+/g,""),t.className=s?n.replace(i,""):n+" "+e}t.preventDefault(),this.menuToggleButton.hasAttribute("aria-expanded")?this.menuToggleButton.removeAttribute("aria-expanded"):this.menuToggleButton.setAttribute("aria-expanded","true"),e(this.menuToggleButton,"is-active"),e(this.nav,"js-show")}}).menuToggleButton&&e.menuToggleButton.addEventListener("click",function(t){e.doToggle(t)}),e.menuClose&&e.menuClose.addEventListener("click",function(t){e.doToggle(t)})});var banner=document.querySelector("#nhsuk-feedback-banner"),bannerCloseButton=document.querySelector("#nhsuk-feedback-banner-close"),footer=document.getElementById("nhsuk-footer");function isScrolledIntoView(t){var e=t.getBoundingClientRect(),n=e.top,i=e.bottom;return n<window.innerHeight&&0<=i}document.addEventListener("DOMContentLoaded",function(){setTimeout(function(){void 0!==banner&&null!=banner&&(banner.style.display="block")},3e3);var t=!1,e=!1;$(window).scroll(function(){t||(e=setInterval(function(){t&&(t=!1,clearTimeout(e),isScrolledIntoView(footer)?banner.classList.add("js-inview"):banner.classList.remove("js-inview"))},500)),t=!0})}),bannerCloseButton&&bannerCloseButton.addEventListener("click",function(){banner.style.display="none"}),document.addEventListener("DOMContentLoaded",function(){var e={link:document.querySelector(".nhsuk-skip-link"),header:document.getElementsByTagName("H1")[0],doFocus:function(t){this.header.setAttribute("tabIndex","-1"),this.header.focus()},doLeave:function(t){this.header.removeAttribute("tabIndex")}};e.link&&e.header&&(e.link.addEventListener("click",function(t){t.preventDefault(),e.doFocus(t)}),e.header.addEventListener("blur",function(t){e.doLeave(t)}))}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
976330
237
6275