<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">'use strict';

var ready = false,
	queue = [],
	resultCount = 40,
	fuzzySearchOptions,
	priceRanges,
	moreMarkup,
	evtData,
	fuse,
	data;


// More than 40 results... show a more thingy
moreMarkup = '&lt;p class="u-paddingH40px u-spacing120px u-textCenter"&gt;&lt;a class="button button--primary button--circular" href="/gaff-search/${term}#gaff_search_' + (resultCount - 1) + '"&gt;More...&lt;/a&gt;&lt;/p&gt;';


// Simple templater
var templater = (function (undefined) {
	var proxyRegEx = /\$\{([^\}]+)?\}/g,
		templates = {},
		API = {};

	function template(data, templateName) {
		var string = templates[templateName];

		return string.replace(proxyRegEx, function (_, key) {
			var keyParts = key.split('.'),
				value = data,
				i;

			for (i = 0; i &lt; keyParts.length; i++) {
				value = value[keyParts[i]];
			}

			return value || '';
		});
	}
	API.apply = template;

	// Precache a template
	var cache = function (name, value) {
		templates[name] = value;
	};
	API.add = cache;

	return API;
} ());


// Simple fuzzy search
function fuzzysearch (needle, haystack) {
	var hlen = haystack.length,
		nlen = needle.length;

	if (nlen &gt; hlen) {
		return false;
	}
	if (nlen === hlen) {
		return needle === haystack;
	}
	outer: for (var i = 0, j = 0; i &lt; nlen; i++) {
		var nch = needle.charCodeAt(i);
		while (j &lt; hlen) {
			if (haystack.charCodeAt(j++) === nch) {
				continue outer;
			}
		}
		return false;
	}
	return true;
}


// Init fuzzy search
function init () {
	fuse = new Fuse(data, fuzzySearchOptions);
	ready = true;
}


/* Find stuff. Also, things ----------------- */
var search = function (searchObj) {
	var near = searchObj.near.toLowerCase(),
		results = [],
		obj = {};

	// No data? HOOOLLLLLLDDDDDD!!
	if (!data) {
		return setTimeout(function () {
			search(searchObj);
		}, 99);
	}

	// perform basic search
	data.map(findCriteriaMatches);

	// Bail early if we don't get a good match with a college / town
	if (near.length &lt; 5 &amp;&amp; results.length === 0) {
		return updateQueue(searchObj);
	}

	// Fallback fuzzy search
	if (results.length === 0) {
		Array.prototype.push.apply(results, fuse.search(near));
	}

	// Lets allude to massive result counts while not killing the DOM
	obj.result_count = results.length;
	obj.results = results.slice(0, resultCount);

	updateQueue(searchObj);

	// Build markup
	obj.markup = results
					.map(buildMarkup)
					.join('');

	// Over comfortable result count? Offload to network
	if (obj.result_count &gt; resultCount) {
		obj.markup += moreMarkup.replace('${term}', near);
	}

	// Callback
	self.postMessage(obj);

	// Build first 40 results
	function buildMarkup (result, index) {
		if (index &gt; resultCount) {
			return '';
		}
		return templater.apply(result, 'template-search-result');
	}

	// Match search criteria
	function findCriteriaMatches (gaff) {
		var match = false;

		// town / county - TODO: reconsider
		if (fuzzysearch(near, gaff.county_id.toLowerCase()) || fuzzysearch(near, gaff.college_id.toLowerCase())) {
			match = true;
		}

		// rent range
		if (searchObj.rent &gt; -1) {
			match = (gaff.rent &gt;= priceRanges[searchObj.rent].min &amp;&amp; gaff.rent &lt;= priceRanges[searchObj.rent].max);
		}

		// gaff type
		if (searchObj.type !== 'any') {
			match = (searchObj.type.toLowerCase() === gaff.gaff_type.toLowerCase());
		}

		if (match) {
			results.push(gaff);
		}
	}
};


// Post search update ----------------------- */
function updateQueue (msg) {
	var searchTerms = msg.near;

	queue
		.map(function (term, index) {
			if (term === searchTerms) {
				queue.splice(index, 1);
			}
		});
}


/* Prevent dupe searches -------------------- */
function maintainQueue (msg) {
	var searchTerms = msg.near;

	if (queue.indexOf(searchTerms) &gt; -1) {
		console.log('Dropping dupe search ' + searchTerms);
		return false;
	}

	return true;
}


/* Seed data into the right places --------- */
function seedData (str) {
	try {
		if (typeof str === 'string') {
			evtData = JSON.parse(str);
		} else {
			evtData = str;
		}

		data = evtData.data.quick_search;
		priceRanges = evtData.data.price_ranges;
		fuzzySearchOptions = evtData.data.searchSettings;
		templater.add('template-search-result', evtData.data.resultTemplate);

		init();
	} catch (err) {
		console.error(err);
	}
}


/* Get data we can work with --------------- */
function getData () {
	localforage.getItem('GaG', function (err, str) {
		if (err || !str) {
			console.log('Nothing stored locally, fetching from GaG');
			return getRemoteData();
		}

		console.log('Data has been stored locally');
		seedData(JSON.parse(str));

		setTimeout(isThereUpdates, 999);
	});
}


/* Import fresh data ----------------------- */
function getRemoteData () {
	XHR('/api/gaffs', function (err, txt) {
		var tst;

		try {
			tst = JSON.parse(txt);
		} catch (err) {
			console.error(err);
		}

		// Do we have usable data
		if (tst &amp;&amp; tst.data) {
			localforage.setItem('GaG', txt, function (err) {
				if (err) {
					console.error(err);
				}
			});
			seedData(tst);
		}
	});
}


/* Is there a data delta? ------------------ */
function isThereUpdates () {
	XHR('/api/gaff-delta', function(err, str) {
		var evt;

		try {
			evt = JSON.parse(str);

			if (evt.data['last-update'] &gt; evtData.data.delta) {
				getRemoteData();
			}
		} catch (ignore) {}
	});
}


/* Je oldie XHR ---------------------------- */
function XHR (url, callback) {
	var xhr = new XMLHttpRequest();

	console.log('Fetching ' + url);

	xhr.open('GET', url, true);
	xhr.onreadystatechange = function () {
		if (xhr.readyState === 4) {
			callback(null, xhr.responseText);
		}
	};
	xhr.send(null);
}


// Kick off a search
self.addEventListener('message', function (evt) {
	if (maintainQueue(evt.data) === true) {
		search(evt.data);
	}
}, {passive: true});


/**
 * @license
 * Fuse - Lightweight fuzzy-search
 *
 * Copyright (c) 2012-2016 Kirollos Risk &lt;kirollos@gmail.com&gt;.
 * All Rights Reserved. Apache Software License 2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
!function(t){"use strict";function e(){console.log.apply(console,arguments)}function s(t,e){var s,n,o,i;for(this.list=t,this.options=e=e||{},s=0,i=["sort","shouldSort","verbose","tokenize"],n=i.length;n&gt;s;s++)o=i[s],this.options[o]=o in e?e[o]:r[o];for(s=0,i=["searchFn","sortFn","keys","getFn","include","tokenSeparator"],n=i.length;n&gt;s;s++)o=i[s],this.options[o]=e[o]||r[o]}function n(t,e,s){var i,r,h,a,c,p;if(e){if(h=e.indexOf("."),-1!==h?(i=e.slice(0,h),r=e.slice(h+1)):i=e,a=t[i],null!==a&amp;&amp;void 0!==a)if(r||"string"!=typeof a&amp;&amp;"number"!=typeof a)if(o(a))for(c=0,p=a.length;p&gt;c;c++)n(a[c],r,s);else r&amp;&amp;n(a,r,s);else s.push(a)}else s.push(t);return s}function o(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t,e){e=e||{},this.options=e,this.options.location=e.location||i.defaultOptions.location,this.options.distance="distance"in e?e.distance:i.defaultOptions.distance,this.options.threshold="threshold"in e?e.threshold:i.defaultOptions.threshold,this.options.maxPatternLength=e.maxPatternLength||i.defaultOptions.maxPatternLength,this.pattern=e.caseSensitive?t:t.toLowerCase(),this.patternLen=t.length,this.patternLen&lt;=this.options.maxPatternLength&amp;&amp;(this.matchmask=1&lt;&lt;this.patternLen-1,this.patternAlphabet=this._calculatePatternAlphabet())}var r={id:null,caseSensitive:!1,include:[],shouldSort:!0,searchFn:i,sortFn:function(t,e){return t.score-e.score},getFn:n,keys:[],verbose:!1,tokenize:!1,matchAllTokens:!1,tokenSeparator:/ +/g};s.VERSION="2.5.0",s.prototype.set=function(t){return this.list=t,t},s.prototype.search=function(t){this.options.verbose&amp;&amp;e("\nSearch term:",t,"\n"),this.pattern=t,this.results=[],this.resultMap={},this._keyMap=null,this._prepareSearchers(),this._startSearch(),this._computeScore(),this._sort();var s=this._format();return s},s.prototype._prepareSearchers=function(){var t=this.options,e=this.pattern,s=t.searchFn,n=e.split(t.tokenSeparator),o=0,i=n.length;if(this.options.tokenize)for(this.tokenSearchers=[];i&gt;o;o++)this.tokenSearchers.push(new s(n[o],t));this.fullSeacher=new s(e,t)},s.prototype._startSearch=function(){var t,e,s,n,o=this.options,i=o.getFn,r=this.list,h=r.length,a=this.options.keys,c=a.length,p=null;if("string"==typeof r[0])for(s=0;h&gt;s;s++)this._analyze("",r[s],s,s);else for(this._keyMap={},s=0;h&gt;s;s++)for(p=r[s],n=0;c&gt;n;n++){if(t=a[n],"string"!=typeof t){if(e=1-t.weight||1,this._keyMap[t.name]={weight:e},t.weight&lt;=0||t.weight&gt;1)throw new Error("Key weight has to be &gt; 0 and &lt;= 1");t=t.name}else this._keyMap[t]={weight:1};this._analyze(t,i(p,t,[]),p,s)}},s.prototype._analyze=function(t,s,n,i){var r,h,a,c,p,l,u,f,d,g,m,y,k,v,S,b=this.options,_=!1;if(void 0!==s&amp;&amp;null!==s){h=[];var M=0;if("string"==typeof s){if(r=s.split(b.tokenSeparator),b.verbose&amp;&amp;e("---------\nKey:",t),this.options.tokenize){for(v=0;v&lt;this.tokenSearchers.length;v++){for(f=this.tokenSearchers[v],b.verbose&amp;&amp;e("Pattern:",f.pattern),d=[],y=!1,S=0;S&lt;r.length;S++){g=r[S],m=f.search(g);var L={};m.isMatch?(L[g]=m.score,_=!0,y=!0,h.push(m.score)):(L[g]=1,this.options.matchAllTokens||h.push(1)),d.push(L)}y&amp;&amp;M++,b.verbose&amp;&amp;e("Token scores:",d)}for(c=h[0],l=h.length,v=1;l&gt;v;v++)c+=h[v];c/=l,b.verbose&amp;&amp;e("Token score average:",c)}u=this.fullSeacher.search(s),b.verbose&amp;&amp;e("Full text score:",u.score),p=u.score,void 0!==c&amp;&amp;(p=(p+c)/2),b.verbose&amp;&amp;e("Score average:",p),k=this.options.tokenize&amp;&amp;this.options.matchAllTokens?M&gt;=this.tokenSearchers.length:!0,b.verbose&amp;&amp;e("Check Matches",k),(_||u.isMatch)&amp;&amp;k&amp;&amp;(a=this.resultMap[i],a?a.output.push({key:t,score:p,matchedIndices:u.matchedIndices}):(this.resultMap[i]={item:n,output:[{key:t,score:p,matchedIndices:u.matchedIndices}]},this.results.push(this.resultMap[i])))}else if(o(s))for(v=0;v&lt;s.length;v++)this._analyze(t,s[v],n,i)}},s.prototype._computeScore=function(){var t,s,n,o,i,r,h,a,c,p=this._keyMap,l=this.results;for(this.options.verbose&amp;&amp;e("\n\nComputing score:\n"),t=0;t&lt;l.length;t++){for(n=0,o=l[t].output,i=o.length,a=1,s=0;i&gt;s;s++)r=o[s].score,h=p?p[o[s].key].weight:1,c=r*h,1!==h?a=Math.min(a,c):(n+=c,o[s].nScore=c);1===a?l[t].score=n/i:l[t].score=a,this.options.verbose&amp;&amp;e(l[t])}},s.prototype._sort=function(){var t=this.options;t.shouldSort&amp;&amp;(t.verbose&amp;&amp;e("\n\nSorting...."),this.results.sort(t.sortFn))},s.prototype._format=function(){var t,s,n,o,i,r=this.options,h=r.getFn,a=[],c=this.results,p=r.include;for(r.verbose&amp;&amp;e("\n\nOutput:\n\n",c),o=r.id?function(t){c[t].item=h(c[t].item,r.id,[])[0]}:function(){},i=function(t){var e,s,n,o,i,r=c[t];if(p.length&gt;0){if(e={item:r.item},-1!==p.indexOf("matches"))for(n=r.output,e.matches=[],s=0;s&lt;n.length;s++)o=n[s],i={indices:o.matchedIndices},o.key&amp;&amp;(i.key=o.key),e.matches.push(i);-1!==p.indexOf("score")&amp;&amp;(e.score=c[t].score)}else e=r.item;return e},s=0,n=c.length;n&gt;s;s++)o(s),t=i(s),a.push(t);return a},i.defaultOptions={location:0,distance:100,threshold:.6,maxPatternLength:32},i.prototype._calculatePatternAlphabet=function(){var t={},e=0;for(e=0;e&lt;this.patternLen;e++)t[this.pattern.charAt(e)]=0;for(e=0;e&lt;this.patternLen;e++)t[this.pattern.charAt(e)]|=1&lt;&lt;this.pattern.length-e-1;return t},i.prototype._bitapScore=function(t,e){var s=t/this.patternLen,n=Math.abs(this.options.location-e);return this.options.distance?s+n/this.options.distance:n?1:s},i.prototype.search=function(t){var e,s,n,o,i,r,h,a,c,p,l,u,f,d,g,m,y,k,v,S,b,_,M=this.options;if(t=M.caseSensitive?t:t.toLowerCase(),this.pattern===t)return{isMatch:!0,score:0,matchedIndices:[[0,t.length-1]]};if(this.patternLen&gt;M.maxPatternLength){if(y=t.match(new RegExp(this.pattern.replace(M.tokenSeparator,"|"))),k=!!y)for(S=[],e=0,b=y.length;b&gt;e;e++)_=y[e],S.push([t.indexOf(_),_.length-1]);return{isMatch:k,score:k?.5:1,matchedIndices:S}}for(o=M.location,n=t.length,i=M.threshold,r=t.indexOf(this.pattern,o),v=[],e=0;n&gt;e;e++)v[e]=0;for(-1!=r&amp;&amp;(i=Math.min(this._bitapScore(0,r),i),r=t.lastIndexOf(this.pattern,o+this.patternLen),-1!=r&amp;&amp;(i=Math.min(this._bitapScore(0,r),i))),r=-1,g=1,m=[],c=this.patternLen+n,e=0;e&lt;this.patternLen;e++){for(h=0,a=c;a&gt;h;)this._bitapScore(e,o+a)&lt;=i?h=a:c=a,a=Math.floor((c-h)/2+h);for(c=a,p=Math.max(1,o-a+1),l=Math.min(o+a,n)+this.patternLen,u=Array(l+2),u[l+1]=(1&lt;&lt;e)-1,s=l;s&gt;=p;s--)if(d=this.patternAlphabet[t.charAt(s-1)],d&amp;&amp;(v[s-1]=1),0===e?u[s]=(u[s+1]&lt;&lt;1|1)&amp;d:u[s]=(u[s+1]&lt;&lt;1|1)&amp;d|((f[s+1]|f[s])&lt;&lt;1|1)|f[s+1],u[s]&amp;this.matchmask&amp;&amp;(g=this._bitapScore(e,s-1),i&gt;=g)){if(i=g,r=s-1,m.push(r),!(r&gt;o))break;p=Math.max(1,2*o-r)}if(this._bitapScore(e+1,o)&gt;i)break;f=u}return S=this._getMatchedIndices(v),{isMatch:r&gt;=0,score:0===g?.001:g,matchedIndices:S}},i.prototype._getMatchedIndices=function(t){for(var e,s=[],n=-1,o=-1,i=0,r=t.length;r&gt;i;i++)e=t[i],e&amp;&amp;-1===n?n=i:e||-1===n||(o=i-1,s.push([n,o]),n=-1);return t[i-1]&amp;&amp;s.push([n,i-1]),s},"object"==typeof exports?module.exports=s:"function"==typeof define&amp;&amp;define.amd?define(function(){return s}):self.Fuse=s}(this);


/*!
 localForage -- Offline Storage, Improved
 Version 1.5.0
 https://localforage.github.io/localForage
 (c) 2013-2017 Mozilla, Apache License 2.0
 */
!function(a){if("object"==typeof exports&amp;&amp;"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&amp;&amp;define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.localforage=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&amp;&amp;require;if(!h&amp;&amp;i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&amp;&amp;require,g=0;g&lt;d.length;g++)e(d[g]);return e}({1:[function(a,b,c){(function(a){"use strict";function c(){k=!0;for(var a,b,c=l.length;c;){for(b=l,l=[],a=-1;++a&lt;c;)b[a]();c=l.length}k=!1}function d(a){1!==l.push(a)||k||e()}var e,f=a.MutationObserver||a.WebKitMutationObserver;if(f){var g=0,h=new f(c),i=a.document.createTextNode("");h.observe(i,{characterData:!0}),e=function(){i.data=g=++g%2}}else if(a.setImmediate||void 0===a.MessageChannel)e="document"in a&amp;&amp;"onreadystatechange"in a.document.createElement("script")?function(){var b=a.document.createElement("script");b.onreadystatechange=function(){c(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:function(){setTimeout(c,0)};else{var j=new a.MessageChannel;j.port1.onmessage=c,e=function(){j.port2.postMessage(0)}}var k,l=[];b.exports=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(a,b,c){"use strict";function d(){}function e(a){if("function"!=typeof a)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,a!==d&amp;&amp;i(this,a)}function f(a,b,c){this.promise=a,"function"==typeof b&amp;&amp;(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),"function"==typeof c&amp;&amp;(this.onRejected=c,this.callRejected=this.otherCallRejected)}function g(a,b,c){o(function(){var d;try{d=b(c)}catch(b){return p.reject(a,b)}d===a?p.reject(a,new TypeError("Cannot resolve promise with itself")):p.resolve(a,d)})}function h(a){var b=a&amp;&amp;a.then;if(a&amp;&amp;"object"==typeof a&amp;&amp;"function"==typeof b)return function(){b.apply(a,arguments)}}function i(a,b){function c(b){f||(f=!0,p.reject(a,b))}function d(b){f||(f=!0,p.resolve(a,b))}function e(){b(d,c)}var f=!1,g=j(e);"error"===g.status&amp;&amp;c(g.value)}function j(a,b){var c={};try{c.value=a(b),c.status="success"}catch(a){c.status="error",c.value=a}return c}function k(a){return a instanceof this?a:p.resolve(new this(d),a)}function l(a){var b=new this(d);return p.reject(b,a)}function m(a){function b(a,b){function d(a){g[b]=a,++h!==e||f||(f=!0,p.resolve(j,g))}c.resolve(a).then(d,function(a){f||(f=!0,p.reject(j,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var e=a.length,f=!1;if(!e)return this.resolve([]);for(var g=new Array(e),h=0,i=-1,j=new this(d);++i&lt;e;)b(a[i],i);return j}function n(a){function b(a){c.resolve(a).then(function(a){f||(f=!0,p.resolve(h,a))},function(a){f||(f=!0,p.reject(h,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(a))return this.reject(new TypeError("must be an array"));var e=a.length,f=!1;if(!e)return this.resolve([]);for(var g=-1,h=new this(d);++g&lt;e;)b(a[g]);return h}var o=a(1),p={},q=["REJECTED"],r=["FULFILLED"],s=["PENDING"];b.exports=c=e,e.prototype.catch=function(a){return this.then(null,a)},e.prototype.then=function(a,b){if("function"!=typeof a&amp;&amp;this.state===r||"function"!=typeof b&amp;&amp;this.state===q)return this;var c=new this.constructor(d);if(this.state!==s){g(c,this.state===r?a:b,this.outcome)}else this.queue.push(new f(c,a,b));return c},f.prototype.callFulfilled=function(a){p.resolve(this.promise,a)},f.prototype.otherCallFulfilled=function(a){g(this.promise,this.onFulfilled,a)},f.prototype.callRejected=function(a){p.reject(this.promise,a)},f.prototype.otherCallRejected=function(a){g(this.promise,this.onRejected,a)},p.resolve=function(a,b){var c=j(h,b);if("error"===c.status)return p.reject(a,c.value);var d=c.value;if(d)i(a,d);else{a.state=r,a.outcome=b;for(var e=-1,f=a.queue.length;++e&lt;f;)a.queue[e].callFulfilled(b)}return a},p.reject=function(a,b){a.state=q,a.outcome=b;for(var c=-1,d=a.queue.length;++c&lt;d;)a.queue[c].callRejected(b);return a},c.resolve=k,c.reject=l,c.all=m,c.race=n},{1:1}],3:[function(a,b,c){(function(b){"use strict";"function"!=typeof b.Promise&amp;&amp;(b.Promise=a(2))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(a){}}function f(){try{if(!ja)return!1;var a="undefined"!=typeof openDatabase&amp;&amp;/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&amp;&amp;!/Chrome/.test(navigator.userAgent)&amp;&amp;!/BlackBerry/.test(navigator.platform),b="function"==typeof fetch&amp;&amp;-1!==fetch.toString().indexOf("[native code");return(!a||b)&amp;&amp;"undefined"!=typeof indexedDB&amp;&amp;"undefined"!=typeof IDBKeyRange}catch(a){return!1}}function g(){return"function"==typeof openDatabase}function h(){try{return"undefined"!=typeof localStorage&amp;&amp;"setItem"in localStorage&amp;&amp;localStorage.setItem}catch(a){return!1}}function i(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(f){if("TypeError"!==f.name)throw f;for(var c="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,d=new c,e=0;e&lt;a.length;e+=1)d.append(a[e]);return d.getBlob(b.type)}}function j(a,b){b&amp;&amp;a.then(function(a){b(null,a)},function(a){b(a)})}function k(a,b,c){"function"==typeof b&amp;&amp;a.then(b),"function"==typeof c&amp;&amp;a.catch(c)}function l(a){for(var b=a.length,c=new ArrayBuffer(b),d=new Uint8Array(c),e=0;e&lt;b;e++)d[e]=a.charCodeAt(e);return c}function m(a){return new ma(function(b){var c=a.transaction(na,qa),d=i([""]);c.objectStore(na).put(d,"key"),c.onabort=function(a){a.preventDefault(),a.stopPropagation(),b(!1)},c.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),c=navigator.userAgent.match(/Edge\//);b(c||!a||parseInt(a[1],10)&gt;=43)}}).catch(function(){return!1})}function n(a){return"boolean"==typeof ka?ma.resolve(ka):m(a).then(function(a){return ka=a})}function o(a){var b=la[a.name],c={};c.promise=new ma(function(a){c.resolve=a}),b.deferredOperations.push(c),b.dbReady?b.dbReady=b.dbReady.then(function(){return c.promise}):b.dbReady=c.promise}function p(a){var b=la[a.name],c=b.deferredOperations.pop();c&amp;&amp;c.resolve()}function q(a,b){var c=la[a.name],d=c.deferredOperations.pop();d&amp;&amp;d.reject(b)}function r(a,b){return new ma(function(c,d){if(a.db){if(!b)return c(a.db);o(a),a.db.close()}var e=[a.name];b&amp;&amp;e.push(a.version);var f=ja.open.apply(ja,e);b&amp;&amp;(f.onupgradeneeded=function(b){var c=f.result;try{c.createObjectStore(a.storeName),b.oldVersion&lt;=1&amp;&amp;c.createObjectStore(na)}catch(c){if("ConstraintError"!==c.name)throw c;console.warn('The database "'+a.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),f.onerror=function(a){a.preventDefault(),d(f.error)},f.onsuccess=function(){c(f.result),p(a)}})}function s(a){return r(a,!1)}function t(a){return r(a,!0)}function u(a,b){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),d=a.version&lt;a.db.version,e=a.version&gt;a.db.version;if(d&amp;&amp;(a.version!==b&amp;&amp;console.warn('The database "'+a.name+"\" can't be downgraded from version "+a.db.version+" to version "+a.version+"."),a.version=a.db.version),e||c){if(c){var f=a.db.version+1;f&gt;a.version&amp;&amp;(a.version=f)}return!0}return!1}function v(a){return new ma(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function w(a){return i([l(atob(a.data))],{type:a.type})}function x(a){return a&amp;&amp;a.__local_forage_encoded_blob}function y(a){var b=this,c=b._initReady().then(function(){var a=la[b._dbInfo.name];if(a&amp;&amp;a.dbReady)return a.dbReady});return k(c,a,a),c}function z(a){o(a);for(var b=la[a.name],c=b.forages,d=0;d&lt;c.length;d++)c[d]._dbInfo.db&amp;&amp;(c[d]._dbInfo.db.close(),c[d]._dbInfo.db=null);return r(a,!1).then(function(a){for(var b=0;b&lt;c.length;b++)c[b]._dbInfo.db=a}).catch(function(b){throw q(a,b),b})}function A(a,b,c){try{var d=a.db.transaction(a.storeName,b);c(null,d)}catch(d){if(!a.db||"InvalidStateError"===d.name)return z(a).then(function(){var d=a.db.transaction(a.storeName,b);c(null,d)});c(d)}}function B(a){function b(){return ma.resolve()}var c=this,d={db:null};if(a)for(var e in a)d[e]=a[e];la||(la={});var f=la[d.name];f||(f={forages:[],db:null,dbReady:null,deferredOperations:[]},la[d.name]=f),f.forages.push(c),c._initReady||(c._initReady=c.ready,c.ready=y);for(var g=[],h=0;h&lt;f.forages.length;h++){var i=f.forages[h];i!==c&amp;&amp;g.push(i._initReady().catch(b))}var j=f.forages.slice(0);return ma.all(g).then(function(){return d.db=f.db,s(d)}).then(function(a){return d.db=a,u(d,c._defaultConfig.version)?t(d):a}).then(function(a){d.db=f.db=a,c._dbInfo=d;for(var b=0;b&lt;j.length;b++){var e=j[b];e!==c&amp;&amp;(e._dbInfo.db=d.db,e._dbInfo.version=d.version)}})}function C(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new ma(function(b,d){c.ready().then(function(){A(c._dbInfo,pa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.get(a);h.onsuccess=function(){var a=h.result;void 0===a&amp;&amp;(a=null),x(a)&amp;&amp;(a=w(a)),b(a)},h.onerror=function(){d(h.error)}}catch(a){d(a)}})}).catch(d)});return j(d,b),d}function D(a,b){var c=this,d=new ma(function(b,d){c.ready().then(function(){A(c._dbInfo,pa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.openCursor(),i=1;h.onsuccess=function(){var c=h.result;if(c){var d=c.value;x(d)&amp;&amp;(d=w(d));var e=a(d,c.key,i++);void 0!==e?b(e):c.continue()}else b()},h.onerror=function(){d(h.error)}}catch(a){d(a)}})}).catch(d)});return j(d,b),d}function E(a,b,c){var d=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new ma(function(c,e){var f;d.ready().then(function(){return f=d._dbInfo,"[object Blob]"===oa.call(b)?n(f.db).then(function(a){return a?b:v(b)}):b}).then(function(b){A(d._dbInfo,qa,function(f,g){if(f)return e(f);try{var h=g.objectStore(d._dbInfo.storeName),i=h.put(b,a);null===b&amp;&amp;(b=void 0),g.oncomplete=function(){void 0===b&amp;&amp;(b=null),c(b)},g.onabort=g.onerror=function(){var a=i.error?i.error:i.transaction.error;e(a)}}catch(a){e(a)}})}).catch(e)});return j(e,c),e}function F(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new ma(function(b,d){c.ready().then(function(){A(c._dbInfo,qa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=g.delete(a);f.oncomplete=function(){b()},f.onerror=function(){d(h.error)},f.onabort=function(){var a=h.error?h.error:h.transaction.error;d(a)}}catch(a){d(a)}})}).catch(d)});return j(d,b),d}function G(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){A(b._dbInfo,qa,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.clear();e.oncomplete=function(){a()},e.onabort=e.onerror=function(){var a=g.error?g.error:g.transaction.error;c(a)}}catch(a){c(a)}})}).catch(c)});return j(c,a),c}function H(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){A(b._dbInfo,pa,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.count();g.onsuccess=function(){a(g.result)},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return j(c,a),c}function I(a,b){var c=this,d=new ma(function(b,d){if(a&lt;0)return void b(null);c.ready().then(function(){A(c._dbInfo,pa,function(e,f){if(e)return d(e);try{var g=f.objectStore(c._dbInfo.storeName),h=!1,i=g.openCursor();i.onsuccess=function(){var c=i.result;if(!c)return void b(null);0===a?b(c.key):h?b(c.key):(h=!0,c.advance(a))},i.onerror=function(){d(i.error)}}catch(a){d(a)}})}).catch(d)});return j(d,b),d}function J(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){A(b._dbInfo,pa,function(d,e){if(d)return c(d);try{var f=e.objectStore(b._dbInfo.storeName),g=f.openCursor(),h=[];g.onsuccess=function(){var b=g.result;if(!b)return void a(h);h.push(b.key),b.continue()},g.onerror=function(){c(g.error)}}catch(a){c(a)}})}).catch(c)});return j(c,a),c}function K(a){var b,c,d,e,f,g=.75*a.length,h=a.length,i=0;"="===a[a.length-1]&amp;&amp;(g--,"="===a[a.length-2]&amp;&amp;g--);var j=new ArrayBuffer(g),k=new Uint8Array(j);for(b=0;b&lt;h;b+=4)c=sa.indexOf(a[b]),d=sa.indexOf(a[b+1]),e=sa.indexOf(a[b+2]),f=sa.indexOf(a[b+3]),k[i++]=c&lt;&lt;2|d&gt;&gt;4,k[i++]=(15&amp;d)&lt;&lt;4|e&gt;&gt;2,k[i++]=(3&amp;e)&lt;&lt;6|63&amp;f;return j}function L(a){var b,c=new Uint8Array(a),d="";for(b=0;b&lt;c.length;b+=3)d+=sa[c[b]&gt;&gt;2],d+=sa[(3&amp;c[b])&lt;&lt;4|c[b+1]&gt;&gt;4],d+=sa[(15&amp;c[b+1])&lt;&lt;2|c[b+2]&gt;&gt;6],d+=sa[63&amp;c[b+2]];return c.length%3==2?d=d.substring(0,d.length-1)+"=":c.length%3==1&amp;&amp;(d=d.substring(0,d.length-2)+"=="),d}function M(a,b){var c="";if(a&amp;&amp;(c=Ja.call(a)),a&amp;&amp;("[object ArrayBuffer]"===c||a.buffer&amp;&amp;"[object ArrayBuffer]"===Ja.call(a.buffer))){var d,e=va;a instanceof ArrayBuffer?(d=a,e+=xa):(d=a.buffer,"[object Int8Array]"===c?e+=za:"[object Uint8Array]"===c?e+=Aa:"[object Uint8ClampedArray]"===c?e+=Ba:"[object Int16Array]"===c?e+=Ca:"[object Uint16Array]"===c?e+=Ea:"[object Int32Array]"===c?e+=Da:"[object Uint32Array]"===c?e+=Fa:"[object Float32Array]"===c?e+=Ga:"[object Float64Array]"===c?e+=Ha:b(new Error("Failed to get type for BinaryArray"))),b(e+L(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c=ta+a.type+"~"+L(this.result);b(va+ya+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(c){console.error("Couldn't convert value into a JSON string: ",a),b(null,c)}}function N(a){if(a.substring(0,wa)!==va)return JSON.parse(a);var b,c=a.substring(Ia),d=a.substring(wa,Ia);if(d===ya&amp;&amp;ua.test(c)){var e=c.match(ua);b=e[1],c=c.substring(e[0].length)}var f=K(c);switch(d){case xa:return f;case ya:return i([f],{type:b});case za:return new Int8Array(f);case Aa:return new Uint8Array(f);case Ba:return new Uint8ClampedArray(f);case Ca:return new Int16Array(f);case Ea:return new Uint16Array(f);case Da:return new Int32Array(f);case Fa:return new Uint32Array(f);case Ga:return new Float32Array(f);case Ha:return new Float64Array(f);default:throw new Error("Unkown type: "+d)}}function O(a){var b=this,c={db:null};if(a)for(var d in a)c[d]="string"!=typeof a[d]?a[d].toString():a[d];var e=new ma(function(a,d){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(a){return d(a)}c.db.transaction(function(e){e.executeSql("CREATE TABLE IF NOT EXISTS "+c.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){b._dbInfo=c,a()},function(a,b){d(b)})})});return c.serializer=Ka,e}function P(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new ma(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var d=c.rows.length?c.rows.item(0).value:null;d&amp;&amp;(d=e.serializer.deserialize(d)),b(d)},function(a,b){d(b)})})}).catch(d)});return j(d,b),d}function Q(a,b){var c=this,d=new ma(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName,[],function(c,d){for(var f=d.rows,g=f.length,h=0;h&lt;g;h++){var i=f.item(h),j=i.value;if(j&amp;&amp;(j=e.serializer.deserialize(j)),void 0!==(j=a(j,i.key,h+1)))return void b(j)}b()},function(a,b){d(b)})})}).catch(d)});return j(d,b),d}function R(a,b,c,d){var e=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var f=new ma(function(f,g){e.ready().then(function(){void 0===b&amp;&amp;(b=null);var h=b,i=e._dbInfo;i.serializer.serialize(b,function(b,j){j?g(j):i.db.transaction(function(c){c.executeSql("INSERT OR REPLACE INTO "+i.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){f(h)},function(a,b){g(b)})},function(b){if(b.code===b.QUOTA_ERR){if(d&gt;0)return void f(R.apply(e,[a,h,c,d-1]));g(b)}})})}).catch(g)});return j(f,c),f}function S(a,b,c){return R.apply(this,[a,b,c,1])}function T(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new ma(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("DELETE FROM "+e.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){d(b)})})}).catch(d)});return j(d,b),d}function U(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("DELETE FROM "+d.storeName,[],function(){a()},function(a,b){c(b)})})}).catch(c)});return j(c,a),c}function V(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+d.storeName,[],function(b,c){var d=c.rows.item(0).c;a(d)},function(a,b){c(b)})})}).catch(c)});return j(c,a),c}function W(a,b){var c=this,d=new ma(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT key FROM "+e.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var d=c.rows.length?c.rows.item(0).key:null;b(d)},function(a,b){d(b)})})}).catch(d)});return j(d,b),d}function X(a){var b=this,c=new ma(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT key FROM "+d.storeName,[],function(b,c){for(var d=[],e=0;e&lt;c.rows.length;e++)d.push(c.rows.item(e).key);a(d)},function(a,b){c(b)})})}).catch(c)});return j(c,a),c}function Y(a){var b=this,c={};if(a)for(var d in a)c[d]=a[d];return c.keyPrefix=c.name+"/",c.storeName!==b._defaultConfig.storeName&amp;&amp;(c.keyPrefix+=c.storeName+"/"),b._dbInfo=c,c.serializer=Ka,ma.resolve()}function Z(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=localStorage.length-1;c&gt;=0;c--){var d=localStorage.key(c);0===d.indexOf(a)&amp;&amp;localStorage.removeItem(d)}});return j(c,a),c}function $(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo,d=localStorage.getItem(b.keyPrefix+a);return d&amp;&amp;(d=b.serializer.deserialize(d)),d});return j(d,b),d}function _(a,b){var c=this,d=c.ready().then(function(){for(var b=c._dbInfo,d=b.keyPrefix,e=d.length,f=localStorage.length,g=1,h=0;h&lt;f;h++){var i=localStorage.key(h);if(0===i.indexOf(d)){var j=localStorage.getItem(i);if(j&amp;&amp;(j=b.serializer.deserialize(j)),void 0!==(j=a(j,i.substring(e),g++)))return j}}});return j(d,b),d}function aa(a,b){var c=this,d=c.ready().then(function(){var b,d=c._dbInfo;try{b=localStorage.key(a)}catch(a){b=null}return b&amp;&amp;(b=b.substring(d.keyPrefix.length)),b});return j(d,b),d}function ba(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo,c=localStorage.length,d=[],e=0;e&lt;c;e++)0===localStorage.key(e).indexOf(a.keyPrefix)&amp;&amp;d.push(localStorage.key(e).substring(a.keyPrefix.length));return d});return j(c,a),c}function ca(a){var b=this,c=b.keys().then(function(a){return a.length});return j(c,a),c}function da(a,b){var c=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo;localStorage.removeItem(b.keyPrefix+a)});return j(d,b),d}function ea(a,b,c){var d=this;"string"!=typeof a&amp;&amp;(console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=d.ready().then(function(){void 0===b&amp;&amp;(b=null);var c=b;return new ma(function(e,f){var g=d._dbInfo;g.serializer.serialize(b,function(b,d){if(d)f(d);else try{localStorage.setItem(g.keyPrefix+a,b),e(c)}catch(a){"QuotaExceededError"!==a.name&amp;&amp;"NS_ERROR_DOM_QUOTA_REACHED"!==a.name||f(a),f(a)}})})});return j(e,c),e}function fa(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}function ga(){for(var a=1;a&lt;arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&amp;&amp;(Ta(b[c])?arguments[0][c]=b[c].slice():arguments[0][c]=b[c])}return arguments[0]}function ha(a){for(var b in Oa)if(Oa.hasOwnProperty(b)&amp;&amp;Oa[b]===a)return!0;return!1}var ia="function"==typeof Symbol&amp;&amp;"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&amp;&amp;"function"==typeof Symbol&amp;&amp;a.constructor===Symbol&amp;&amp;a!==Symbol.prototype?"symbol":typeof a},ja=e();"undefined"==typeof Promise&amp;&amp;a(3);var ka,la,ma=Promise,na="local-forage-detect-blob-support",oa=Object.prototype.toString,pa="readonly",qa="readwrite",ra={_driver:"asyncStorage",_initStorage:B,iterate:D,getItem:C,setItem:E,removeItem:F,clear:G,length:H,key:I,keys:J},sa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ta="~~local_forage_type~",ua=/^~~local_forage_type~([^~]+)~/,va="__lfsc__:",wa=va.length,xa="arbf",ya="blob",za="si08",Aa="ui08",Ba="uic8",Ca="si16",Da="si32",Ea="ur16",Fa="ui32",Ga="fl32",Ha="fl64",Ia=wa+xa.length,Ja=Object.prototype.toString,Ka={serialize:M,deserialize:N,stringToBuffer:K,bufferToString:L},La={_driver:"webSQLStorage",_initStorage:O,iterate:Q,getItem:P,setItem:S,removeItem:T,clear:U,length:V,key:W,keys:X},Ma={_driver:"localStorageWrapper",_initStorage:Y,iterate:_,getItem:$,setItem:ea,removeItem:da,clear:Z,length:ca,key:aa,keys:ba},Na={},Oa={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage"},Pa=[Oa.INDEXEDDB,Oa.WEBSQL,Oa.LOCALSTORAGE],Qa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"],Ra={description:"",driver:Pa.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},Sa={};Sa[Oa.INDEXEDDB]=f(),Sa[Oa.WEBSQL]=g(),Sa[Oa.LOCALSTORAGE]=h();var Ta=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},Ua=function(){function a(b){d(this,a),this.INDEXEDDB=Oa.INDEXEDDB,this.LOCALSTORAGE=Oa.LOCALSTORAGE,this.WEBSQL=Oa.WEBSQL,this._defaultConfig=ga({},Ra),this._config=ga({},this._defaultConfig,b),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(a){if("object"===(void 0===a?"undefined":ia(a))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a){if("storeName"===b&amp;&amp;(a[b]=a[b].replace(/\W/g,"_")),"version"===b&amp;&amp;"number"!=typeof a[b])return new Error("Database version must be a number.");this._config[b]=a[b]}return!("driver"in a&amp;&amp;a.driver)||this.setDriver(this._config.driver)}return"string"==typeof a?this._config[a]:this._config},a.prototype.defineDriver=function(a,b,c){var d=new ma(function(b,c){try{var d=a._driver,e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),f=new Error("Custom driver name already in use: "+a._driver);if(!a._driver)return void c(e);if(ha(a._driver))return void c(f);for(var g=Qa.concat("_initStorage"),h=0;h&lt;g.length;h++){var i=g[h];if(!i||!a[i]||"function"!=typeof a[i])return void c(e)}var j=function(c){Sa[d]=c,Na[d]=a,b()};"_support"in a?a._support&amp;&amp;"function"==typeof a._support?a._support().then(j,c):j(!!a._support):j(!0)}catch(a){c(a)}});return k(d,b,c),d},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(a,b,c){var d=this,e=ma.resolve().then(function(){if(!ha(a)){if(Na[a])return Na[a];throw new Error("Driver not found.")}switch(a){case d.INDEXEDDB:return ra;case d.LOCALSTORAGE:return Ma;case d.WEBSQL:return La}});return k(e,b,c),e},a.prototype.getSerializer=function(a){var b=ma.resolve(Ka);return k(b,a),b},a.prototype.ready=function(a){var b=this,c=b._driverSet.then(function(){return null===b._ready&amp;&amp;(b._ready=b._initDriver()),b._ready});return k(c,a,a),c},a.prototype.setDriver=function(a,b,c){function d(){g._config.driver=g.driver()}function e(a){return g._extend(a),d(),g._ready=g._initStorage(g._config),g._ready}function f(a){return function(){function b(){for(;c&lt;a.length;){var f=a[c];return c++,g._dbInfo=null,g._ready=null,g.getDriver(f).then(e).catch(b)}d();var h=new Error("No available storage method found.");return g._driverSet=ma.reject(h),g._driverSet}var c=0;return b()}}var g=this;Ta(a)||(a=[a]);var h=this._getSupportedDrivers(a),i=null!==this._driverSet?this._driverSet.catch(function(){return ma.resolve()}):ma.resolve();return this._driverSet=i.then(function(){var a=h[0];return g._dbInfo=null,g._ready=null,g.getDriver(a).then(function(a){g._driver=a._driver,d(),g._wrapLibraryMethodsWithReady(),g._initDriver=f(h)})}).catch(function(){d();var a=new Error("No available storage method found.");return g._driverSet=ma.reject(a),g._driverSet}),k(this._driverSet,b,c),this._driverSet},a.prototype.supports=function(a){return!!Sa[a]},a.prototype._extend=function(a){ga(this,a)},a.prototype._getSupportedDrivers=function(a){for(var b=[],c=0,d=a.length;c&lt;d;c++){var e=a[c];this.supports(e)&amp;&amp;b.push(e)}return b},a.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0;a&lt;Qa.length;a++)fa(this,Qa[a])},a.prototype.createInstance=function(b){return new a(b)},a}(),Va=new Ua;b.exports=Va},{3:3}]},{},[4])(4)});


// Yay, nothing has exploded yet, get some data
console.log('Search worker has loaded');
getData();

</pre></body></html>