/*! simple/searx.min.js | 14-08-2018 | https://github.com/asciimoo/searx */ (function(e,t,n){"use strict";if(e.Element){(function(e){e.matches=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.msMatchesSelector||function(e){var t=this,n=(t.parentNode||t.document).querySelectorAll(e),i=-1;while(n[++i]&&n[i]!=t);return!!n[i]}})(Element.prototype)}function i(e,t,n){try{e.call(t,n)}catch(e){console.log(e)}}n=n||{};n.on=function(e,n,r,a){a=a||false;if(typeof e!=="string"){e.addEventListener(n,r,a)}else{t.addEventListener(n,function(n){var a=n.target||n.srcElement,o=false;while(a&&a.matches&&a!==t&&!(o=a.matches(e)))a=a.parentElement;if(o)i(r,a,n)},a)}};n.ready=function(t){if(document.readyState!="loading"){t.call(e)}else{e.addEventListener("DOMContentLoaded",t.bind(e))}};n.http=function(e,t,n){var i=new XMLHttpRequest,r=function(){},a=function(){},o={then:function(e){r=e;return o},catch:function(e){a=e;return o}};try{i.open(e,t,true);i.onload=function(){if(i.status==200){r(i.response,i.responseType)}else{a(Error(i.statusText))}};i.onerror=function(){a(Error("Network Error"))};i.onabort=function(){a(Error("Transaction is aborted"))};i.send()}catch(e){a(e)}return o};n.loadStyle=function(e){var i=n.staticPath+e,r="style_"+e.replace(".","_"),a=t.getElementById(r);if(a===null){a=t.createElement("link");a.setAttribute("id",r);a.setAttribute("rel","stylesheet");a.setAttribute("type","text/css");a.setAttribute("href",i);t.body.appendChild(a)}};n.loadScript=function(e,i){var r=n.staticPath+e,a="script_"+e.replace(".","_"),o=t.getElementById(a);if(o===null){o=t.createElement("script");o.setAttribute("id",a);o.setAttribute("src",r);o.onload=i;o.onerror=function(){o.setAttribute("error","1")};t.body.appendChild(o)}else if(!o.hasAttribute("error")){try{i.apply(o,[])}catch(e){console.log(e)}}else{console.log("callback not executed : script '"+r+"' not loaded.")}};n.insertBefore=function(e,t){element.parentNode.insertBefore(e,t)};n.insertAfter=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)};n.on(".close","click",function(e){var t=e.target||e.srcElement;this.parentNode.classList.add("invisible")});return n})(window,document,window.searx);(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.AutoComplete=e()}})(function(){var e,t,n;return function e(t,n,i){function r(o,s){if(!n[o]){if(!t[o]){var l=typeof require=="function"&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return r(n?n:e)},c,c.exports,e,t,n,i)}return n[o].exports}var a=typeof require=="function"&&require;for(var o=0;o=t.From&&r.keyCode<=t.To){l=!t.Not}else{l=t.Not}}}};for(var o in e.prototype.getEventsByType(t,n)){var s=e.merge({Operator:i.AND},t.KeyboardMappings[o]),l=i.AND==s.Operator;s.Conditions.forEach(a);if(l===true){s.Callback.call(t,r)}}};e.prototype.makeRequest=function(e,t){var n=Object.getOwnPropertyNames(e.HttpHeaders),i=new XMLHttpRequest,r=e._HttpMethod(),a=e._Url(),o=e._Pre(),s=encodeURIComponent(e._QueryArg())+"="+encodeURIComponent(o);if(r.match(/^GET$/i)){if(a.indexOf("?")!==-1){a+="&"+s}else{a+="?"+s}}i.open(r,a,true);for(var l=n.length-1;l>=0;l--){i.setRequestHeader(n[l],e.HttpHeaders[n[l]])}i.onreadystatechange=function(){if(i.readyState==4&&i.status==200){e.$Cache[o]=i.response;t(i.response)}};return i};e.prototype.ajax=function(t,n,i){if(i===void 0){i=true}if(t.$AjaxTimer){window.clearTimeout(t.$AjaxTimer)}if(i===true){t.$AjaxTimer=window.setTimeout(e.prototype.ajax.bind(null,t,n,false),t.Delay)}else{if(t.Request){t.Request.abort()}t.Request=n;t.Request.send(t._QueryArg()+"="+t._Pre())}};e.prototype.cache=function(t,n){var i=t._Cache(t._Pre());if(i===undefined){var r=e.prototype.makeRequest(t,n);e.prototype.ajax(t,r)}else{n(i)}};e.prototype.destroy=function(e){for(var t in e.$Listeners){e.Input.removeEventListener(t,e.$Listeners[t])}e.DOMResults.parentNode.removeChild(e.DOMResults)};return e}();a.merge=function(){var e={},t;for(var n=0;n"+e+""}},HttpHeaders:{"Content-type":"application/x-www-form-urlencoded"},Limit:0,MinChars:0,HttpMethod:"GET",QueryArg:"q",Url:null,KeyboardMappings:{Enter:{Conditions:[{Is:13,Not:false}],Callback:function(e){if(this.DOMResults.getAttribute("class").indexOf("open")!=-1){var t=this.DOMResults.querySelector("li.active");if(t!==null){e.preventDefault();this._Select(t);this.DOMResults.setAttribute("class","autocomplete")}}},Operator:i.AND,Event:r.KEYDOWN},KeyUpAndDown_down:{Conditions:[{Is:38,Not:false},{Is:40,Not:false}],Callback:function(e){e.preventDefault()},Operator:i.OR,Event:r.KEYDOWN},KeyUpAndDown_up:{Conditions:[{Is:38,Not:false},{Is:40,Not:false}],Callback:function(e){e.preventDefault();var t=this.DOMResults.querySelector("li:first-child:not(.locked)"),n=this.DOMResults.querySelector("li:last-child:not(.locked)"),i=this.DOMResults.querySelector("li.active");if(i){var r=Array.prototype.indexOf.call(i.parentNode.children,i),a=r+(e.keyCode-39),o=this.DOMResults.getElementsByTagName("li").length;if(a<0){a=o-1}else if(a>=o){a=0}i.classList.remove("active");i.parentElement.children.item(a).classList.add("active")}else if(n&&e.keyCode==38){n.classList.add("active")}else if(t){t.classList.add("active")}},Operator:i.OR,Event:r.KEYUP},AlphaNum:{Conditions:[{Is:13,Not:true},{From:35,To:40,Not:true}],Callback:function(){var e=this.Input.getAttribute("data-autocomplete-old-value"),t=this._Pre();if(t!==""&&t.length>=this._MinChars()){if(!e||t!=e){this.DOMResults.setAttribute("class","autocomplete open")}a.prototype.cache(this,function(e){this._Render(this._Post(e));this._Open()}.bind(this))}},Operator:i.AND,Event:r.KEYUP}},DOMResults:null,Request:null,Input:null,_EmptyMessage:function(){var e="";if(this.Input.hasAttribute("data-autocomplete-empty-message")){e=this.Input.getAttribute("data-autocomplete-empty-message")}else if(this.EmptyMessage!==false){e=this.EmptyMessage}else{e=""}return e},_Limit:function(){var e=this.Input.getAttribute("data-autocomplete-limit");if(isNaN(e)||e===null){return this.Limit}return parseInt(e,10)},_MinChars:function(){var e=this.Input.getAttribute("data-autocomplete-minchars");if(isNaN(e)||e===null){return this.MinChars}return parseInt(e,10)},_Highlight:function(e){return e.replace(this.Highlight.getRegex(this._Pre()),this.Highlight.transform)},_HttpMethod:function(){if(this.Input.hasAttribute("data-autocomplete-method")){return this.Input.getAttribute("data-autocomplete-method")}return this.HttpMethod},_QueryArg:function(){if(this.Input.hasAttribute("data-autocomplete-param-name")){return this.Input.getAttribute("data-autocomplete-param-name")}return this.QueryArg},_Url:function(){if(this.Input.hasAttribute("data-autocomplete")){return this.Input.getAttribute("data-autocomplete")}return this.Url},_Blur:function(e){if(e===true){this.DOMResults.setAttribute("class","autocomplete");this.Input.setAttribute("data-autocomplete-old-value",this.Input.value)}else{var t=this;setTimeout(function(){t._Blur(true)},150)}},_Cache:function(e){return this.$Cache[e]},_Focus:function(){var e=this.Input.getAttribute("data-autocomplete-old-value");if((!e||this.Input.value!=e)&&this._MinChars()<=this.Input.value.length){this.DOMResults.setAttribute("class","autocomplete open")}},_Open:function(){var e=this;Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"),function(t){if(t.getAttribute("class")!="locked"){t.onclick=function(n){e._Select(t)};t.onmouseenter=function(){var n=e.DOMResults.querySelector("li.active");if(n!==t){if(n!==null){n.classList.remove("active")}t.classList.add("active")}}}})},_Position:function(){this.DOMResults.setAttribute("class","autocomplete");this.DOMResults.setAttribute("style","top:"+(this.Input.offsetTop+this.Input.offsetHeight)+"px;left:"+this.Input.offsetLeft+"px;width:"+this.Input.clientWidth+"px;")},_Render:function(e){var t;if(typeof e=="string"){t=this._RenderRaw(e)}else{t=this._RenderResponseItems(e)}if(this.DOMResults.hasChildNodes()){this.DOMResults.removeChild(this.DOMResults.childNodes[0])}this.DOMResults.appendChild(t)},_RenderResponseItems:function(e){var t=document.createElement("ul"),n=document.createElement("li"),i=this._Limit();if(i<0){e=e.reverse()}else if(i===0){i=e.length}for(var r=0;r0){this.DOMResults.innerHTML=e}else{var i=this._EmptyMessage();if(i!==""){n.innerHTML=i;n.setAttribute("class","locked");t.appendChild(n)}}return t},_Post:function(e){try{var t=[];var n=JSON.parse(e);if(Object.keys(n).length===0){return""}if(Array.isArray(n)){for(var i=0;i0&&i.naturalHeight>0){n+=i.naturalWidth/i.naturalHeight}else{n+=1}}return t/n};n.prototype._setSize=function(e,t){var n,i,r=e.length;for(var a=0;a0&&n.naturalHeight>0){i=t*n.naturalWidth/n.naturalHeight}else{i=t}n.style.width=i+"px";n.style.height=t+"px";n.style.marginLeft="3px";n.style.marginTop="3px";n.style.marginRight=this.margin-7+"px";n.style.marginBottom=this.margin-7+"px"}};n.prototype._alignImgs=function(e){var n,i,r=t.querySelector(this.container_selector).clientWidth;e:while(e.length>0){for(var a=1;a<=e.length;a++){n=e.slice(0,a);i=this._getHeigth(n,r);if(i0){this._alignImgs(o);o=[]}o.push(a.querySelector(this.img_selector));r=a}if(o.length>0){this._alignImgs(o)}};n.prototype.watch=function(){var n,i,r,a,o=this,s=t.querySelectorAll(this.results_selector),l=s.length;function u(e){o.align()}function c(e){if(o._alignAllDone){o._alignAllDone=false;setTimeout(function(){o.align();o._alignAllDone=true},100)}}e.addEventListener("resize",c);e.addEventListener("pageshow",u);for(n=0;ns){break}}break;case"down":r=n.nextElementSibling;if(r===null){r=o[0]}break;case"up":r=n.previousElementSibling;if(r===null){r=o[o.length-1]}break;case"bottom":r=o[o.length-1];break;case"top":default:r=o[0]}}if(r){n.removeAttribute("data-vim-selected");r.setAttribute("data-vim-selected","true");var f=r.querySelector("h3 a")||r.querySelector("a");if(f!==null){f.focus()}if(!t){a()}}}}function n(){document.location.reload(true)}function i(){if(document.activeElement){document.activeElement.blur()}}function r(e){return function(){var t=$('div#pagination button[type="submit"]');if(t.length!==2){console.log("page navigation with this theme is not supported");return}if(e>=0&&ei-a){window.scroll(window.scrollX,i-a)}else{var o=t+n;if(o"}o+="";o+="

"+l[0].cat+"

";o+='
    ';for(var d in l){o+="
  • "+l[d].key+" "+l[d].des+"
  • "}o+="
";o+="";if(!c||u){o+=""}}o+="";t.innerHTML=o}function d(){var e=document.querySelector("#vim-hotkeys-help");console.log(e);if(e===undefined||e===null){e=document.createElement("div");e.id="vim-hotkeys-help";e.className="dialog-modal";e.style="width: 40%";c(e);var t=document.getElementsByTagName("body")[0];t.appendChild(e)}else{e.classList.toggle("invisible");return}}});(function(e,t,n){"use strict";n.ready(function(){n.on(".searx_overpass_request","click",function(e){this.classList.remove("searx_overpass_request");var i="https://overpass-api.de/api/interpreter?data=";var r=i+"[out:json][timeout:25];(";var a=");out meta;";var o=this.dataset.osmId;var s=this.dataset.osmType;var l=t.querySelector("#"+this.dataset.resultTable);var u=t.querySelector("#"+this.dataset.resultTableLoadicon);var c=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(o&&s&&l){var d=null;switch(s){case"node":d=r+"node("+o+");"+a;break;case"way":d=r+"way("+o+");"+a;break;case"relation":d=r+"relation("+o+");"+a;break;default:break}if(d){n.http("GET",d).then(function(e,t){e=JSON.parse(e);if(e&&e.elements&&e.elements[0]){var n=e.elements[0];var i="";for(var r in n.tags){if(n.tags.name===null||c.indexOf(r)==-1){i+=""+r+"";switch(r){case"phone":case"fax":i+=''+n.tags[r]+"";break;case"email":i+=''+n.tags[r]+"";break;case"website":case"url":i+=''+n.tags[r]+"";break;case"wikidata":i+=''+n.tags[r]+"";break;case"wikipedia":if(n.tags[r].indexOf(":")!=-1){i+=''+n.tags[r]+"";break}default:i+=n.tags[r];break}i+=""}}u.parentNode.removeChild(u);l.classList.remove("invisible");l.querySelector("tbody").innerHTML=i}}).catch(function(){u.classList.remove("invisible");u.innerHTML="could not load data!"})}}e.preventDefault()});n.on(".searx_init_map","click",function(e){this.classList.remove("searx_init_map");var t=this.dataset.leafletTarget;var i=parseFloat(this.dataset.mapLon);var r=parseFloat(this.dataset.mapLat);var a=parseFloat(this.dataset.mapZoom);var o=JSON.parse(this.dataset.mapBoundingbox);var s=JSON.parse(this.dataset.mapGeojson);n.loadStyle("leaflet/leaflet.css");n.loadScript("leaflet/leaflet.js",function(){var e=null;if(o){var n=L.latLng(o[0],o[2]);var l=L.latLng(o[1],o[3]);e=L.latLngBounds(n,l)}var u=L.map(t);var c="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";var d='Map data © OpenStreetMap contributors';var f=new L.TileLayer(c,{minZoom:1,maxZoom:19,attribution:d});var p="https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png";var h='Wikimedia maps beta | Maps data © OpenStreetMap contributors';var m=new L.TileLayer(p,{minZoom:1,maxZoom:19,attribution:h});if(e){setTimeout(function(){u.fitBounds(e,{maxZoom:17})},0)}else if(i&&r){if(a){u.setView(new L.latLng(r,i),a)}else{u.setView(new L.latLng(r,i),8)}}u.addLayer(f);var g={"OSM Mapnik":f};L.control.layers(g).addTo(u);if(s){L.geoJson(s).addTo(u)}});e.preventDefault()})})})(window,document,window.searx);(function(e,t,n){"use strict";n.ready(function(){n.image_thumbnail_layout=new n.ImageLayout("#urls","#urls .result-images","img.image_thumbnail",200);n.image_thumbnail_layout.watch();n.on(".btn-collapse","click",function(e){var n=this.getAttribute("data-btn-text-collapsed");var i=this.getAttribute("data-btn-text-not-collapsed");var r=this.getAttribute("data-target");var a=t.querySelector(r);var o=this.innerHTML;if(this.classList.contains("collapsed")){o=o.replace(n,i)}else{o=o.replace(i,n)}this.innerHTML=o;this.classList.toggle("collapsed");a.classList.toggle("invisible")});n.on(".media-loader","click",function(e){var n=this.getAttribute("data-target");var i=t.querySelector(n+" > iframe");var r=i.getAttribute("src");if(r===null||r===undefined||r===false){i.setAttribute("src",i.getAttribute("data-src"))}});e.addEventListener("scroll",function(){var e=t.getElementById("backToTop"),n=document.documentElement.scrollTop||document.body.scrollTop;if(e!==null){if(n>=200){e.style.opacity=1}else{e.style.opacity=0}}})})})(window,document,window.searx);(function(e,t,n){"use strict";var i=true,r="q",a;function o(e){if(e.setSelectionRange){var t=e.value.length;e.setSelectionRange(t,t)}}function s(){if(a.value.length>0){var e=document.getElementById("search");setTimeout(e.submit.bind(e),0)}}function l(e){var t=document.getElementById("clear_search");var n=function(){if(e.value.length===0){t.classList.add("empty")}else{t.classList.remove("empty")}};n();t.addEventListener("click",function(){e.value="";e.focus();n()});e.addEventListener("keyup",n,false)}n.ready(function(){a=t.getElementById(r);function u(e){if(i){o(a);i=false}else{}}if(a!==null){l(a);if(n.autocompleter){n.autocomplete=AutoComplete.call(e,{Url:"./autocompleter",EmptyMessage:n.noItemFound,HttpMethod:n.method,MinChars:4,Delay:300},"#"+r);e.addEventListener("resize",function(){var e=new CustomEvent("position");a.dispatchEvent(e)})}a.addEventListener("focus",u,false);a.focus()}if(a!==null&&n.search_on_category_select){t.querySelector(".help").className="invisible";n.on("#categories input","change",function(e){var n,i=t.querySelectorAll('#categories input[type="checkbox"]');for(n=0;n