diff options
| -rw-r--r-- | sass/_variables.scss | 6 | ||||
| -rw-r--r-- | sass/include/_button.scss | 3 | ||||
| -rw-r--r-- | sass/include/_icons.scss | 2 | ||||
| -rw-r--r-- | sass/include/_nav.scss | 36 | ||||
| -rw-r--r-- | sass/include/_zola.scss | 3 | ||||
| -rw-r--r-- | static/abridge-switcher.min.js | 2 | ||||
| -rw-r--r-- | static/abridge.min.js | 2 | ||||
| -rw-r--r-- | static/search.js | 2 | ||||
| -rw-r--r-- | static/search.min.js | 2 | ||||
| -rw-r--r-- | templates/base.html | 4 | ||||
| -rw-r--r-- | templates/macros/macros.html | 72 |
11 files changed, 104 insertions, 30 deletions
diff --git a/sass/_variables.scss b/sass/_variables.scss index bc1e7f8..a5cb5d9 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -87,9 +87,9 @@ $icon-twitch: true !default; $icon-youtube: true !default; $icon-researchgate: true !default; -$icon-search: true !default; -$icon-x: true !default;// x symbol -$icon-contrast: true !default;// dark/light mode +$icon-search: false !default; +$icon-x: false !default;// x symbol +$icon-contrast: false !default;// dark/light mode $icon-ffolder: false !default; $icon-folder: false !default;// categories folder $icon-ftag: false !default; diff --git a/sass/include/_button.scss b/sass/include/_button.scss index 62c7c47..d725120 100644 --- a/sass/include/_button.scss +++ b/sass/include/_button.scss @@ -13,6 +13,9 @@ textarea { line-height: var(--fs); color: var(--f1); } +button.del { + color: var(--cr); +} button, [type="button" i], [type="submit" i], diff --git a/sass/include/_icons.scss b/sass/include/_icons.scss index b9a8e62..75584c1 100644 --- a/sass/include/_icons.scss +++ b/sass/include/_icons.scss @@ -101,6 +101,7 @@ height: 1.8rem; display: inline-block; overflow: hidden; + text-align: center; vertical-align: middle } .svgs { @@ -108,6 +109,7 @@ height: var(--fs); display: inline-block; //overflow: hidden; + text-align: center; vertical-align: middle } .svgh:hover { diff --git a/sass/include/_nav.scss b/sass/include/_nav.scss index d9d67a8..b7c21cb 100644 --- a/sass/include/_nav.scss +++ b/sass/include/_nav.scss @@ -2,16 +2,7 @@ * Horizontal Nav * https://github.com/raj457036/attriCSS */ -.cnav { - color: var(--a3);//pagination color current page -} -.off { - color: var(--c4); - font-weight: var(--fh); - border: .1rem solid var(--c3); - border-radius: var(--br); - padding: .1rem var(--s1); -} + main nav a, main nav a:visited {//pagination link styling font-weight: var(--fh); @@ -59,10 +50,33 @@ nav { } } main nav { + ul { + display: flex; + } margin-top: var(--s2);//pagination margin - li { + li { margin: .1rem; } + li.inp { + padding-top: .1rem; + } +} +.outp { + padding: 0 .34rem .2rem; +} +.off { + color: var(--c4); + font-weight: var(--fh); + border: .1rem solid var(--c3); + border-radius: var(--br); +} +.on { + font-weight: var(--fh); + border: .1rem solid var(--c4); + border-radius: var(--br); +} +.mode:hover, .cnav { + color: var(--a3);//pagination color current page } footer nav { ul { diff --git a/sass/include/_zola.scss b/sass/include/_zola.scss index 7ce0534..cf69f46 100644 --- a/sass/include/_zola.scss +++ b/sass/include/_zola.scss @@ -7,6 +7,9 @@ .s70 {font-size: .70em} .hpad {padding: 0 .2rem} .rpad {padding-right: .2rem} +.si { + font-size: 1.5em +} pre code[data-lang]::before { content: ' ' attr(data-lang) ': ' " "; diff --git a/static/abridge-switcher.min.js b/static/abridge-switcher.min.js index 2319ea3..5c054cb 100644 --- a/static/abridge-switcher.min.js +++ b/static/abridge-switcher.min.js @@ -1 +1 @@ -const items=document.querySelectorAll(".preStyle");function ccb(e){const t=document.createElement("button"),n=(t.className="cc ",t.type="button",t.innerHTML="Copy",t.addEventListener("click",()=>ccc(t,e)),document.createElement("div"));n.className="ccw",n.appendChild(t),e.parentNode.insertBefore(n,e),n.appendChild(e)}async function ccc(e,t){var n=t.querySelectorAll("table")["length"];let o="";if(0<n){const i=t.querySelectorAll(":last-child > tr > td:last-child");i.forEach(e=>{o+=e.innerText})}else o=t.querySelector(":last-child > code").innerText;try{"granted"==(result=await navigator.permissions.query({name:"clipboard-write"})).state||"prompt"==result.state?await navigator.clipboard.writeText(o):cce(o,t)}catch(e){cce(o,t)}finally{e.innerHTML="Copied",setTimeout(function(){e.innerHTML="Copy"},2e3)}}function cce(e,t){const n=document.createElement("textArea"),o=(n.contentEditable="true",n.readOnly="false",n.className="copyable-text-area",n.value=e,t.insertBefore(n,t.firstChild),document.createRange()),i=(o.selectNodeContents(n),window.getSelection());i.removeAllRanges(),i.addRange(o),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}items.forEach(e=>{e.rel="stylesheet"}),document.querySelectorAll("pre").forEach(e=>ccb(e)),document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("light"),localStorage.setItem("theme",document.documentElement.classList.contains("light")?"light":"dark")}),function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,E,I,F,D,C,k,N,L,_,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),E=new RegExp("^"+t+e+"[^aeiouwxy]$"),I=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,N=/^(.+?)e$/,L=/ll$/,_=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=E,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=I).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=k,(r=C).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=N).test(e)&&(s=(l=r.exec(e))[1],u=f,o=_,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=L).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file +const items=document.querySelectorAll(".preStyle");function ccb(e){const t=document.createElement("button"),n=(t.className="cc ",t.type="button",t.innerHTML="Copy",t.addEventListener("click",()=>ccc(t,e)),document.createElement("div"));n.className="ccw",n.appendChild(t),e.parentNode.insertBefore(n,e),n.appendChild(e)}async function ccc(e,t){var n=t.querySelectorAll("table")["length"];let o="";if(0<n){const i=t.querySelectorAll(":last-child > tr > td:last-child");i.forEach(e=>{o+=e.innerText})}else o=t.querySelector(":last-child > code").innerText;try{"granted"==(result=await navigator.permissions.query({name:"clipboard-write"})).state||"prompt"==result.state?await navigator.clipboard.writeText(o):cce(o,t)}catch(e){cce(o,t)}finally{e.innerHTML="Copied",setTimeout(function(){e.innerHTML="Copy"},2e3)}}function cce(e,t){const n=document.createElement("textArea"),o=(n.contentEditable="true",n.readOnly="false",n.className="copyable-text-area",n.value=e,t.insertBefore(n,t.firstChild),document.createRange()),i=(o.selectNodeContents(n),window.getSelection());i.removeAllRanges(),i.addRange(o),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button class="del" type="submit" title="Close Search">✖</button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}items.forEach(e=>{e.rel="stylesheet"}),document.querySelectorAll("pre").forEach(e=>ccb(e)),document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("light"),localStorage.setItem("theme",document.documentElement.classList.contains("light")?"light":"dark")}),function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,E,I,F,D,C,k,N,L,_,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),E=new RegExp("^"+t+e+"[^aeiouwxy]$"),I=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,N=/^(.+?)e$/,L=/ll$/,_=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=E,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=I).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=k,(r=C).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=N).test(e)&&(s=(l=r.exec(e))[1],u=f,o=_,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=L).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file diff --git a/static/abridge.min.js b/static/abridge.min.js index 6679690..b63be28 100644 --- a/static/abridge.min.js +++ b/static/abridge.min.js @@ -1 +1 @@ -const items=document.querySelectorAll(".preStyle");function ccb(e){const t=document.createElement("button"),n=(t.className="cc ",t.type="button",t.innerHTML="Copy",t.addEventListener("click",()=>ccc(t,e)),document.createElement("div"));n.className="ccw",n.appendChild(t),e.parentNode.insertBefore(n,e),n.appendChild(e)}async function ccc(e,t){var n=t.querySelectorAll("table")["length"];let o="";if(0<n){const i=t.querySelectorAll(":last-child > tr > td:last-child");i.forEach(e=>{o+=e.innerText})}else o=t.querySelector(":last-child > code").innerText;try{"granted"==(result=await navigator.permissions.query({name:"clipboard-write"})).state||"prompt"==result.state?await navigator.clipboard.writeText(o):cce(o,t)}catch(e){cce(o,t)}finally{e.innerHTML="Copied",setTimeout(function(){e.innerHTML="Copy"},2e3)}}function cce(e,t){const n=document.createElement("textArea"),o=(n.contentEditable="true",n.readOnly="false",n.className="copyable-text-area",n.value=e,t.insertBefore(n,t.firstChild),document.createRange()),i=(o.selectNodeContents(n),window.getSelection());i.removeAllRanges(),i.addRange(o),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}items.forEach(e=>{e.rel="stylesheet"}),document.querySelectorAll("pre").forEach(e=>ccb(e)),function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,E,I,F,D,C,N,k,_,L,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),E=new RegExp("^"+t+e+"[^aeiouwxy]$"),I=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,N=/^(.+?)(s|t)(ion)$/,k=/^(.+?)e$/,_=/ll$/,L=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=E,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=I).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=N,(r=C).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=k).test(e)&&(s=(l=r.exec(e))[1],u=f,o=L,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file +const items=document.querySelectorAll(".preStyle");function ccb(e){const t=document.createElement("button"),n=(t.className="cc ",t.type="button",t.innerHTML="Copy",t.addEventListener("click",()=>ccc(t,e)),document.createElement("div"));n.className="ccw",n.appendChild(t),e.parentNode.insertBefore(n,e),n.appendChild(e)}async function ccc(e,t){var n=t.querySelectorAll("table")["length"];let o="";if(0<n){const i=t.querySelectorAll(":last-child > tr > td:last-child");i.forEach(e=>{o+=e.innerText})}else o=t.querySelector(":last-child > code").innerText;try{"granted"==(result=await navigator.permissions.query({name:"clipboard-write"})).state||"prompt"==result.state?await navigator.clipboard.writeText(o):cce(o,t)}catch(e){cce(o,t)}finally{e.innerHTML="Copied",setTimeout(function(){e.innerHTML="Copy"},2e3)}}function cce(e,t){const n=document.createElement("textArea"),o=(n.contentEditable="true",n.readOnly="false",n.className="copyable-text-area",n.value=e,t.insertBefore(n,t.firstChild),document.createRange()),i=(o.selectNodeContents(n),window.getSelection());i.removeAllRanges(),i.addRange(o),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button class="del" type="submit" title="Close Search">✖</button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}items.forEach(e=>{e.rel="stylesheet"}),document.querySelectorAll("pre").forEach(e=>ccb(e)),function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,E,I,F,D,C,N,k,_,L,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),E=new RegExp("^"+t+e+"[^aeiouwxy]$"),I=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,N=/^(.+?)(s|t)(ion)$/,k=/^(.+?)e$/,_=/ll$/,L=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=E,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=I).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=N,(r=C).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=k).test(e)&&(s=(l=r.exec(e))[1],u=f,o=L,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=_).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file diff --git a/static/search.js b/static/search.js index 12cfe5c..fe4b9e4 100644 --- a/static/search.js +++ b/static/search.js @@ -15,7 +15,7 @@ function goSearchNow() { var headerDiv = document.createElement("div");// create a div element - var headerContent = '<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> Results For: '.concat(document.getElementById("userinput").value, "</h2></form>");// header to use at top of results page + var headerContent = '<form name="closeSearch"><h2><button class="del" type="submit" title="Close Search">✖</button> Results For: '.concat(document.getElementById("userinput").value, "</h2></form>");// header to use at top of results page headerDiv.innerHTML = headerContent;// document element div (headerDiv), set the inner contents to our header html (headerContent) diff --git a/static/search.min.js b/static/search.min.js index 0823c9d..1cd178b 100644 --- a/static/search.min.js +++ b/static/search.min.js @@ -1 +1 @@ -function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}!function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,I,E,F,D,k,C,_,N,P,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),I=new RegExp("^"+t+e+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,k=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,_=/^(.+?)e$/,N=/ll$/,P=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=I,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=E).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=C,(r=k).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=_).test(e)&&(s=(l=r.exec(e))[1],u=f,o=P,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=N).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file +function closeSearchNow(){const e=document.querySelector("main");e.innerHTML=window.main}function goSearchNow(){const e=document.querySelector("main");window.main||(window.main=e.innerHTML);var t=document.getElementById("suggestions"),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),i='<form name="closeSearch"><h2><button class="del" type="submit" title="Close Search">✖</button> Results For: '.concat(document.getElementById("userinput").value,"</h2></form>");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("userinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}!function(){function m(e){var t=new m.Index;return t.pipeline.add(m.trimmer,m.stopWordFilter,m.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,g,y,v,S,x,w,b,I,E,F,D,k,C,_,N,P,n;m.version="0.9.5",((lunr=m).utils={}).warn=(n=this,function(e){n.console&&console.warn&&console.warn(e)}),m.utils.toString=function(e){return null==e?"":e.toString()},(m.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},m.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},m.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},m.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(m.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return m.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(m.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(m.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,m.tokenizer.seperator=m.tokenizer.defaultSeperator,m.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(m.tokenizer.seperator=e)},m.tokenizer.resetSeperator=function(){m.tokenizer.seperator=m.tokenizer.defaultSeperator},m.tokenizer.getSeperator=function(){return m.tokenizer.seperator},(m.Pipeline=function(){this._queue=[]}).registeredFunctions={},m.Pipeline.registerFunction=function(e,t){t in m.Pipeline.registeredFunctions&&m.utils.warn("Overwriting existing registered function: "+t),e.label=t,m.Pipeline.registeredFunctions[t]=e},m.Pipeline.getRegisteredFunction=function(e){return e in m.Pipeline.registeredFunctions!=1?null:m.Pipeline.registeredFunctions[e]},m.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||m.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},m.Pipeline.load=function(e){var n=new m.Pipeline;return e.forEach(function(e){var t=m.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},m.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){m.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},m.Pipeline.prototype.after=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},m.Pipeline.prototype.before=function(e,t){m.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},m.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},m.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},m.Pipeline.prototype.reset=function(){this._queue=[]},m.Pipeline.prototype.get=function(){return this._queue},m.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return m.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(m.Index=function(){this._fields=[],this._ref="id",this.pipeline=new m.Pipeline,this.documentStore=new m.DocumentStore,this.index={},this.eventEmitter=new m.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},m.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},m.Index.load=function(e){e.version!==m.version&&m.utils.warn("version mismatch: current "+m.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=m.DocumentStore.load(e.documentStore),n.pipeline=m.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=m.InvertedIndex.load(e.index[t]);return n},m.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new m.InvertedIndex,this},m.Index.prototype.setRef=function(e){return this._ref=e,this},m.Index.prototype.saveDocument=function(e){return this.documentStore=new m.DocumentStore(e),this},m.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(m.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},m.Index.prototype.removeDocByRef=function(e){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},m.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(m.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},m.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},m.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},m.Index.prototype.getFields=function(){return this._fields.slice()},m.Index.prototype.search=function(e,t){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var n=null;null!=t&&(n=JSON.stringify(t));for(var o=new m.Configuration(n,this.getFields()).get(),i={},r=Object.keys(e),s=0;s<r.length;s++){var u=r[s];i[u]=this.pipeline.run(m.tokenizer(e[u]))}var l,a={};for(l in o){var c=i[l]||i.any;if(c){var d=this.fieldSearch(c,l,o),h=o[l].boost;for(p in d)d[p]=d[p]*h;for(p in d)p in a?a[p]+=d[p]:a[p]=d[p]}}var f,p,g=[];for(p in a)f={ref:p,score:a[p]},this.documentStore.hasDoc(p)&&(f.doc=this.documentStore.getDoc(p)),g.push(f);return g.sort(function(e,t){return t.score-e.score}),g},m.Index.prototype.fieldSearch=function(e,d,t){var h=t[d].bool,n=t[d].expand,t=t[d].boost,f=null,p={};return 0!==t?(e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[d].expandToken(a)),{});e.forEach(function(e){var t=this.index[d].getDocs(e),n=this.idf(e,d);if(f&&"AND"==h){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[d].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,d),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,h)},this),f=this.coordNorm(f,p,e.length)):void 0},m.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},m.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},m.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},m.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:m.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},m.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(m.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},m.DocumentStore.prototype.isDocStored=function(){return this._save},m.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,this.docs[e]=!0===this._save?function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):null},m.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},m.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},m.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},m.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},m.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},m.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},m.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",t="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),g=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),I=new RegExp("^"+t+e+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,k=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,_=/^(.+?)e$/,N=/ll$/,P=new RegExp("^"+t+e+"[^aeiouwxy]$"),m.Pipeline.registerFunction(m.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3?e:("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=y,(r=g).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=v).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s)&&(e=s,o=b,i=I,(u=w).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e"))),(r=E).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+a[t])),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s)&&(e=s+c[t])),u=C,(r=k).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s)&&(e=s)),(r=_).test(e)&&(s=(l=r.exec(e))[1],u=f,o=P,((r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s)),u=h,(r=N).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n?n.toLowerCase()+e.substr(1):e)},"stemmer"),m.stopWordFilter=function(e){return e&&!0!==m.stopWordFilter.stopWords[e]?e:void 0},m.clearStopWords=function(){m.stopWordFilter.stopWords={}},m.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){m.stopWordFilter.stopWords[e]=!0},this)},m.resetStopWords=function(){m.stopWordFilter.stopWords=m.defaultStopWords},m.stopWordFilter.stopWords=m.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},m.Pipeline.registerFunction(m.stopWordFilter,"stopWordFilter"),m.Pipeline.registerFunction(m.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(m.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},m.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},m.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},m.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},m.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},m.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},m.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},m.InvertedIndex.prototype.removeToken=function(e,t){e&&null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},m.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var o,t=t||[];if(null==n&&null==(n=this.getNode(e)))return t;for(o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},m.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(m.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){m.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},m.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):m.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},m.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},m.Configuration.prototype.get=function(){return this.config},m.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]!==u[o]?s[n]<u[o]?n++:s[n]>u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},t=this,e=function(){return m},"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=m:t.elasticlunr=m}(),window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})};var suggestions=document.getElementById("suggestions"),userinput=document.getElementById("userinput");function inputFocus(e){191===e.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(e.preventDefault(),userinput.focus()),27===e.keyCode&&(userinput.blur(),suggestions.classList.add("d-none"))}function suggestionFocus(t){const n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){const i=[...n];var o=i.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),e=0<o?o-1:0,n[e].focus()):40===t.keyCode&&(t.preventDefault(),e=o+1<i.length?o+1:o,n[e].focus())}}function substringByByte(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u<e.length;u++){var l=e.codePointAt(u).toString(16);if(o=4<l.length&&++u+1<e.length?"200d"==e.codePointAt(u+1).toString(16):o){if(i+=getByteByHex(l),u==e.length-1){if(!((r+=i)<=t))break;n+=e.substr(s,u-s+1)}}else if(0!=i){if(!((r=(r+=i)+getByteByHex(l))<=t))break;n+=e.substr(s,u-s+1),s=u+1,i=0}else{if(!((r+=getByteByHex(l))<=t))break;l.length<=4?n+=e[u]:n+=e[u-1]+e[u],s=u+1}}return n}function getByteByBinary(e){return[0,1,2,3,4][Math.ceil(e.length/8)]}function getByteByHex(e){return getByteByBinary(parseInt(e,16).toString(2))}document.addEventListener("keydown",inputFocus),document.addEventListener("click",function(e){suggestions.contains(e.target)||suggestions.classList.add("d-none")}),document.addEventListener("keydown",suggestionFocus),function(){var u=elasticlunr.Index.load(window.searchIndex);userinput.addEventListener("input",function(){var n,e=this.value.trim(),o=u.search(e,{bool:"OR",fields:{title:{boost:2},body:{boost:1}}}),i=suggestions.childNodes,r=o.length,s=e.split(/\s+/);suggestions.classList.remove("d-none"),o.forEach(function(e){""!==e.doc.body&&((n=document.createElement("div")).innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(x=l[u]).length){for(var c in n)elasticlunr.stemmer(x).startsWith(n[c])&&(a=40,o=!0);r.push([x,a,i]),a=2}i=i+x.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300<e.length?e.substring(0,300)+"...":e;for(var d=[],h=Math.min(r.length,30),f=0,p=0;p<h;p++)f+=r[p][1];d.push(f);for(p=0;p<r.length-h;p++)f=(f-=r[p][1])+r[p+h][1],d.push(f);var g=0;if(o)for(var m=0,p=d.length-1;0<=p;p--)d[p]>m&&(m=d[p],g=p);for(var y=[],v=r[g][2],p=g;p<g+h;p++){var S,x=r[p];v<x[2]&&(y.push(e.substring(v,x[2])),v=x[2]),40===x[1]&&y.push("<b>"),v=x[2]+x[0].length;40!==x[1]&&12<=x[0].length&&!/^[\x00-\xff]+$/.test(x[0])?(S=substringByByte(e.substring(x[2],v),12),y.push(S)):y.push(e.substring(x[2],v)),40===x[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,s),suggestions.appendChild(n))});for(;i.length>r;)suggestions.removeChild(i[0])},!0),suggestions.addEventListener("click",function(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1},!0)}();
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html index bdb2537..8c74dd6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -49,7 +49,7 @@ <li><h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}">{{ i.name | safe }}</a></h2> </li> {%- endfor %} {%- if config.extra.js_theme %} - <li class="js">{%- if config.extra.icon_contrast %}<i type="reset" id="mode" class="{{ config.extra.icon_contrast }}"></i>{%- else %}<i type="reset" id="mode" class="svgh svgs contrast"></i>{%- endif %}</li> + <li class="js">{%- if config.extra.icon_contrast %}<i type="reset" id="mode" class="{{ config.extra.icon_contrast }}"></i>{%- else %}<i type="reset" id="mode" class="mode">☀</i>{%- endif %}</li> {%- endif %} </ul> </div> @@ -58,7 +58,7 @@ <form class="js" name="goSearch"> <div class="searchd"> <input id="userinput" type="text" placeholder="Search" autocomplete="off" /> - <button type="submit" title="Search">{%- if config.extra.icon_search %}<i class="{{ config.extra.icon_search }}"></i>{%- else %}<i class="svgs search"></i>{%- endif %}</button> + <button type="submit" title="Search">{%- if config.extra.icon_search %}<i class="{{ config.extra.icon_search }}"></i>{%- else %}<span class="si">⌕</span>{%- endif %}</button> </div> <div><div id="suggestions"></div></div> </form> diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 68227d8..cb654e8 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -126,21 +126,73 @@ {%- endif %} <nav> <ul> - {% if paginator.previous %}<li><a href="{{ paginator.first | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{%- if config.extra.icon_first %}<i class="{{ config.extra.icon_first }}"></i>{%- else %}«{%- endif %}</a></li>{% else %}<li><span class="off">{%- if config.extra.icon_first %}<i class="{{ config.extra.icon_first }}"></i>{%- else %}«{%- endif %}</span></li>{% endif %} - {% if paginator.previous %}<li><a href="{{ paginator.previous | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{%- if config.extra.icon_prev %}<i class="{{ config.extra.icon_prev }}"></i>{%- else %}‹{%- endif %}</a></li>{% else %}<li><span class="off">{%- if config.extra.icon_prev %}<i class="{{ config.extra.icon_prev }}"></i>{%- else %}‹{%- endif %}</span></li>{% endif %} - {%- for i in range(start=start, end=end+1) %} - <li> + {%- if paginator.previous -%} + <li><a class="on outp" href="{{ paginator.first | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}"> + {%- if config.extra.icon_first -%}<i class="{{ config.extra.icon_first }}" alt="First Page"></i> + {%- else -%}❰ + {%- endif -%} + </a></li> + {%- else -%} + <li><span class="off outp"> + {%- if config.extra.icon_first -%}<i class="{{ config.extra.icon_first }}" alt="First Page"></i> + {%- else -%}❰ + {%- endif -%} + </span></li> + {%- endif -%} + + {%- if paginator.previous -%} + <li><a class="on outp" href="{{ paginator.previous | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}"> + {%- if config.extra.icon_prev -%}<i class="{{ config.extra.icon_prev }}" alt="Previous Page"></i> + {%- else -%}❬ + {%- endif -%} + </a></li> + {%- else -%} + <li><span class="off outp"> + {%- if config.extra.icon_prev -%}<i class="{{ config.extra.icon_prev }}" alt="Previous Page"></i> + {%- else -%}❬ + {%- endif -%} + </span></li> + {%- endif -%} + + {%- for i in range(start=start, end=end+1) -%} + <li class="inp"> {%- if i == paginator.current_index -%} - <a class="cnav" href="#">{{i}}</a> + <a class="on cnav" href="#">{{i}}</a> {%- elif i > 1 -%} - <a href="{{ paginator.base_url | safe }}{{ i ~ '/' }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{i}}</a> + <a class="on" href="{{ paginator.base_url | safe }}{{ i ~ '/' }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{i}}</a> {%- else -%} - <a href="{{ paginator.first | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ i }}</a> + <a class="on" href="{{ paginator.first | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ i }}</a> {%- endif -%} </li> - {%- endfor %} - {% if paginator.next %}<li><a href="{{ paginator.next | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{%- if config.extra.icon_next %}<i class="{{ config.extra.icon_next }}"></i>{%- else %}›{%- endif %}</a></li>{% else %}<li><span class="off">{%- if config.extra.icon_next %}<i class="{{ config.extra.icon_next }}"></i>{%- else %}›{%- endif %}</span></li>{% endif %} - {% if paginator.next %}<li><a href="{{ paginator.last | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{%- if config.extra.icon_last %}<i class="{{ config.extra.icon_last }}"></i>{%- else %}»{%- endif %}</a></li>{% else %}<li><span class="off">{%- if config.extra.icon_last %}<i class="{{ config.extra.icon_last }}"></i>{%- else %}»{%- endif %}</span></li>{% endif %} + {%- endfor -%} + + {%- if paginator.next -%} + <li><a class="on outp" href="{{ paginator.next | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}"> + {%- if config.extra.icon_next -%}<i class="{{ config.extra.icon_next }}" alt="Next Page"></i> + {%- else -%}❭ + {%- endif -%} + </a></li> + {%- else -%} + <li><span class="off outp"> + {%- if config.extra.icon_next -%}<i class="{{ config.extra.icon_next }}" alt="Next Page"></i> + {%- else -%}❭ + {%- endif -%} + </span></li> + {%- endif -%} + + {%- if paginator.next -%} + <li><a class="on outp" href="{{ paginator.last | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}"> + {%- if config.extra.icon_last -%}<i class="{{ config.extra.icon_last }}" alt="Last Page"></i> + {%- else -%}❱ + {%- endif -%} + </a></li> + {%- else -%} + <li><span class="off outp"> + {%- if config.extra.icon_last -%}<i class="{{ config.extra.icon_last }}" alt="Last Page"></i> + {%- else -%}❱ + {%- endif -%} + </span></li> + {%- endif -%} </ul> </nav> {%- endif %} |
