forked from dauxio/daux.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.min.js
9 lines (9 loc) · 34.3 KB
/
search.min.js
1
2
3
4
5
6
7
8
9
(function(){"use strict";function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}var n,l,u,t,r,o,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,r){var i,s,o,l={};for(o in t)"key"==o?i=t[o]:"ref"==o?s=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===l[o]&&(l[o]=e.defaultProps[o]);return y(e,l,i,s,null)}function y(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++u:i};return null==i&&null!=l.vnode&&l.vnode(s),s}function d(e){return e.children}function _(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?k(e):null}function b(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return b(e)}}function m(e){(!e.__d&&(e.__d=!0)&&t.push(e)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g)}function g(){for(var e;g.__r=t.length;)e=t.sort((function(e,t){return e.__v.__b-t.__v.__b})),t=[],e.some((function(e){var t,n,r,i,s,o;e.__d&&(s=(i=(t=e).__v).__e,(o=t.__P)&&(n=[],(r=a({},i)).__v=i.__v+1,j(o,i,r,t.__n,void 0!==o.ownerSVGElement,null!=i.__h?[s]:null,n,null==s?k(i):s,i.__h),z(n,i),i.__e!=s&&b(i)))}))}function w(t,n,r,i,s,o,l,a,h,u){var f,_,p,g,v,m,b,w=i&&i.__k||c,S=w.length;for(r.__k=[],f=0;f<n.length;f++)if(null!=(g=r.__k[f]=null==(g=n[f])||"boolean"==typeof g?null:"string"==typeof g||"number"==typeof g||"bigint"==typeof g?y(null,g,null,null,g):Array.isArray(g)?y(d,{children:g},null,null,null):g.__b>0?y(g.type,g.props,g.key,null,g.__v):g)){if(g.__=r,g.__b=r.__b+1,null===(p=w[f])||p&&g.key==p.key&&g.type===p.type)w[f]=void 0;else for(_=0;_<S;_++){if((p=w[_])&&g.key==p.key&&g.type===p.type){w[_]=void 0;break}p=null}j(t,g,p=p||e,s,o,l,a,h,u),v=g.__e,(_=g.ref)&&p.ref!=_&&(b||(b=[]),p.ref&&b.push(p.ref,null,g),b.push(_,g.__c||v,g)),null!=v?(null==m&&(m=v),"function"==typeof g.type&&g.__k===p.__k?g.__d=h=x(g,h,t):h=P(t,g,p,w,v,h),"function"==typeof r.type&&(r.__d=h)):h&&p.__e==h&&h.parentNode!=t&&(h=k(p))}for(r.__e=m,f=S;f--;)null!=w[f]&&("function"==typeof r.type&&null!=w[f].__e&&w[f].__e==r.__d&&(r.__d=k(i,f+1)),N(w[f],w[f]));if(b)for(f=0;f<b.length;f++)M(b[f],b[++f],b[++f])}function x(e,t,n){for(var r,i=e.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=e,t="function"==typeof r.type?x(r,t,n):P(n,r,r,i,r.__e,t));return t}function P(e,t,n,r,i,s){var o,l,a;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==n||i!=s||null==i.parentNode)e:if(null==s||s.parentNode!==e)e.appendChild(i),o=null;else{for(l=s,a=0;(l=l.nextSibling)&&a<r.length;a+=2)if(l==i)break e;e.insertBefore(i,s),o=s}return void 0!==o?o:i.nextSibling}function C(e,t,n,r,i){var s;for(s in n)"children"===s||"key"===s||s in t||H(e,s,null,n[s],r);for(s in t)i&&"function"!=typeof t[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===t[s]||H(e,s,t[s],n[s],r)}function $(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||s.test(t)?n:n+"px"}function H(e,t,n,r,i){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||$(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||$(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r||e.addEventListener(t,s?T:I,s):e.removeEventListener(t,s?T:I,s);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function I(e){this.l[e.type+!1](l.event?l.event(e):e)}function T(e){this.l[e.type+!0](l.event?l.event(e):e)}function j(e,t,n,r,i,s,o,c,h){var u,f,p,g,v,y,m,b,x,k,S,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(h=n.__h,c=t.__e=n.__e,t.__h=null,s=[c]),(u=l.__b)&&u(t);try{e:if("function"==typeof C){if(b=t.props,x=(u=C.contextType)&&r[u.__c],k=u?x?x.props.value:u.__:r,n.__c?m=(f=t.__c=n.__c).__=f.__E:("prototype"in C&&C.prototype.render?t.__c=f=new C(b,k):(t.__c=f=new _(b,k),f.constructor=C,f.render=O),x&&x.sub(f),f.props=b,f.state||(f.state={}),f.context=k,f.__n=r,p=f.__d=!0,f.__h=[]),null==f.__s&&(f.__s=f.state),null!=C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=a({},f.__s)),a(f.__s,C.getDerivedStateFromProps(b,f.__s))),g=f.props,v=f.state,p)null==C.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==C.getDerivedStateFromProps&&b!==g&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(b,k),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(b,f.__s,k)||t.__v===n.__v){f.props=b,f.state=f.__s,t.__v!==n.__v&&(f.__d=!1),f.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),f.__h.length&&o.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,k),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(g,v,y)}))}f.context=k,f.props=b,f.state=f.__s,(u=l.__r)&&u(t),f.__d=!1,f.__v=t,f.__P=e,u=f.render(f.props,f.state,f.context),f.state=f.__s,null!=f.getChildContext&&(r=a(a({},r),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(y=f.getSnapshotBeforeUpdate(g,v)),S=null!=u&&u.type===d&&null==u.key?u.props.children:u,w(e,Array.isArray(S)?S:[S],t,n,r,i,s,o,c,h),f.base=t.__e,t.__h=null,f.__h.length&&o.push(f),m&&(f.__E=f.__=null),f.__e=!1}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=L(n.__e,t,n,r,i,s,o,h);(u=l.diffed)&&u(t)}catch(e){t.__v=null,(h||null!=s)&&(t.__e=c,t.__h=!!h,s[s.indexOf(c)]=null),l.__e(e,t,n)}}function z(e,t){l.__c&&l.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){l.__e(e,t.__v)}}))}function L(t,r,i,s,o,l,a,c){var u,f,_,d=i.props,p=r.props,g=r.type,v=0;if("svg"===g&&(o=!0),null!=l)for(;v<l.length;v++)if((u=l[v])&&"setAttribute"in u==!!g&&(g?u.localName===g:3===u.nodeType)){t=u,l[v]=null;break}if(null==t){if(null===g)return document.createTextNode(p);t=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,p.is&&p),l=null,c=!1}if(null===g)d===p||c&&t.data===p||(t.data=p);else{if(l=l&&n.call(t.childNodes),f=(d=i.props||e).dangerouslySetInnerHTML,_=p.dangerouslySetInnerHTML,!c){if(null!=l)for(d={},v=0;v<t.attributes.length;v++)d[t.attributes[v].name]=t.attributes[v].value;(_||f)&&(_&&(f&&_.__html==f.__html||_.__html===t.innerHTML)||(t.innerHTML=_&&_.__html||""))}if(C(t,p,d,o,c),_)r.__k=[];else if(v=r.props.children,w(t,Array.isArray(v)?v:[v],r,i,s,o&&"foreignObject"!==g,l,a,l?l[0]:i.__k&&k(i,0),c),null!=l)for(v=l.length;v--;)null!=l[v]&&h(l[v]);c||("value"in p&&void 0!==(v=p.value)&&(v!==d.value||v!==t.value||"progress"===g&&!v)&&H(t,"value",v,d.value,!1),"checked"in p&&void 0!==(v=p.checked)&&v!==t.checked&&H(t,"checked",v,d.checked,!1))}return t}function M(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){l.__e(e,n)}}function N(e,t,n){var r,i;if(l.unmount&&l.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||M(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){l.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&N(r[i],t,"function"!=typeof e.type);n||null==e.__e||h(e.__e),e.__e=e.__d=void 0}function O(e,t,n){return this.constructor(e,n)}function S(t,r,i){var s,o,a;l.__&&l.__(t,r),o=(s="function"==typeof i)?null:i&&i.__k||r.__k,a=[],j(r,t=(!s&&i||r).__k=v(d,null,[t]),o||e,e,void 0!==r.ownerSVGElement,!s&&i?[i]:o?null:r.firstChild?n.call(r.childNodes):null,a,!s&&i?i:o?o.__e:r.firstChild,s),z(a,t)}n=c.slice,l={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},u=0,_.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof e&&(e=e(a({},n),this.props)),e&&a(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),m(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),m(this))},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0;var commonjsGlobal="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};var flexsearch_bundle={exports:{}};
/**!
* FlexSearch.js v0.7.21 (Bundle)
* Copyright 2018-2021 Nextapps GmbH
* Author: Thomas Wilkerling
* Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch
*/(function(module){(function _f(self){try{module&&(self=module)}catch(e){}var t;function u(e){return"undefined"===typeof e||e}function aa(e){const t=Array(e);for(let n=0;n<e;n++)t[n]=v();return t}function v(){return Object.create(null)}function ba(e,t){return t.length-e.length}function x(e){return"string"===typeof e}function C(e){return"object"===typeof e}function D(e){return"function"===typeof e}function ca(e,t){var n=da;if(e&&(t&&(e=E(e,t)),this.H&&(e=E(e,this.H)),this.J&&1<e.length&&(e=E(e,this.J)),n||""===n)){if(e=e.split(n),this.filter){t=this.filter,n=e.length;const r=[];for(let i=0,s=0;i<n;i++){const n=e[i];n&&!t[n]&&(r[s++]=n)}e=r}return e}return e}self._factory=_f;const da=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ea=/[\u0300-\u036f]/g;function fa(e,t){const n=Object.keys(e),r=n.length,i=[];let s="",o=0;for(let l,a,c=0;c<r;c++)l=n[c],(a=e[l])?(i[o++]=F(t?"(?!\\b)"+l+"(\\b|_)":l),i[o++]=a):s+=(s?"|":"")+l;return s&&(i[o++]=F(t?"(?!\\b)("+s+")(\\b|_)":"("+s+")"),i[o]=""),i}function E(e,t){for(let n=0,r=t.length;n<r&&(e=e.replace(t[n],t[n+1]),e);n+=2);return e}function F(e){return new RegExp(e,"g")}function ha(e){let t="",n="";for(let r,i=0,s=e.length;i<s;i++)(r=e[i])!==n&&(t+=n=r);return t}var ja={encode:ia,F:!1,G:""};function ia(e){return ca.call(this,(""+e).toLowerCase(),!1)}const ka={},G={};function la(e){I(e,"add"),I(e,"append"),I(e,"search"),I(e,"update"),I(e,"remove")}function I(e,t){e[t+"Async"]=function(){const e=this,n=arguments;var r=n[n.length-1];let i;return D(r)&&(i=r,delete n[n.length-1]),r=new Promise((function(r){setTimeout((function(){e.async=!0;const i=e[t].apply(e,n);e.async=!1,r(i)}))})),i?(r.then(i),this):r}}function ma(e,t,n,r){const i=e.length;let s,o,l=[],a=0;r&&(r=[]);for(let c=i-1;0<=c;c--){const h=e[c],u=h.length,f=v();let _=!s;for(let e=0;e<u;e++){const u=h[e],d=u.length;if(d)for(let e,h,p=0;p<d;p++)if(h=u[p],s){if(s[h]){if(!c)if(n)n--;else if(l[a++]=h,a===t)return l;(c||r)&&(f[h]=1),_=!0}if(r&&(o[h]=(e=o[h])?++e:e=1,e<i)){const t=r[e-2]||(r[e-2]=[]);t[t.length]=h}}else f[h]=1}if(r)s||(o=f);else if(!_)return[];s=f}if(r)for(let e,i,o=r.length-1;0<=o;o--){e=r[o],i=e.length;for(let r,o=0;o<i;o++)if(r=e[o],!s[r]){if(n)n--;else if(l[a++]=r,a===t)return l;s[r]=1}}return l}function na(e,t){const n=v(),r=v(),i=[];for(let t=0;t<e.length;t++)n[e[t]]=1;for(let e,s=0;s<t.length;s++){e=t[s];for(let t,s=0;s<e.length;s++)t=e[s],n[t]&&!r[t]&&(r[t]=1,i[i.length]=t)}return i}function J(e){this.l=!0!==e&&e,this.cache=v(),this.h=[]}function oa(e,t,n){C(e)&&(e=e.query);let r=this.cache.get(e);return r||(r=this.search(e,t,n),this.cache.set(e,r)),r}J.prototype.set=function(e,t){if(!this.cache[e]){var n=this.h.length;for(n===this.l?delete this.cache[this.h[n-1]]:n++,--n;0<n;n--)this.h[n]=this.h[n-1];this.h[0]=e}this.cache[e]=t},J.prototype.get=function(e){const t=this.cache[e];if(this.l&&t&&(e=this.h.indexOf(e))){const t=this.h[e-1];this.h[e-1]=this.h[e],this.h[e]=t}return t};const qa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},default:{}};function ra(e,t,n,r,i,s){setTimeout((function(){const o=e(n,JSON.stringify(s));o&&o.then?o.then((function(){t.export(e,t,n,r,i+1)})):t.export(e,t,n,r,i+1)}))}function K(e,t){if(!(this instanceof K))return new K(e);var n;if(e){x(e)?e=qa[e]:(n=e.preset)&&(e=Object.assign({},n[n],e)),n=e.charset;var r=e.lang;x(n)&&(-1===n.indexOf(":")&&(n+=":default"),n=G[n]),x(r)&&(r=ka[r])}else e={};let i,s,o=e.context||{};if(this.encode=e.encode||n&&n.encode||ia,this.register=t||v(),this.D=i=e.resolution||9,this.G=t=n&&n.G||e.tokenize||"strict",this.depth="strict"===t&&o.depth,this.l=u(o.bidirectional),this.s=s=u(e.optimize),this.m=u(e.fastupdate),this.B=e.minlength||1,this.C=e.boost,this.map=s?aa(i):v(),this.A=i=o.resolution||1,this.h=s?aa(i):v(),this.F=n&&n.F||e.rtl,this.H=(t=e.matcher||r&&r.H)&&fa(t,!1),this.J=(t=e.stemmer||r&&r.J)&&fa(t,!0),n=t=e.filter||r&&r.filter){n=t,r=v();for(let e=0,t=n.length;e<t;e++)r[n[e]]=1;n=r}this.filter=n,this.cache=(t=e.cache)&&new J(t)}function L(e,t,n,r,i){return n&&1<e?t+(r||0)<=e?n+(i||0):(e-1)/(t+(r||0))*(n+(i||0))+1|0:0}function M(e,t,n,r,i,s,o){let l=o?e.h:e.map;(!t[n]||o&&!t[n][o])&&(e.s&&(l=l[r]),o?(t=t[n]||(t[n]=v()),t[o]=1,l=l[o]||(l[o]=v())):t[n]=1,l=l[n]||(l[n]=[]),e.s||(l=l[r]||(l[r]=[])),s&&-1!==l.indexOf(i)||(l[l.length]=i,e.m&&(e=e.register[i]||(e.register[i]=[]),e[e.length]=l)))}function sa(e,t,n,r,i,s,o,l){let a=[],c=l?e.h:e.map;if(e.s||(c=ua(c,o,l,e.l)),c){let n=0;const h=Math.min(c.length,l?e.A:e.D);for(let t,u,f=0,_=0;f<h;f++)if((t=c[f])&&(e.s&&(t=ua(t,o,l,e.l)),i&&t&&s&&(u=t.length,u<=i?(i-=u,t=null):(t=t.slice(i),i=0)),t&&(a[n++]=t,s&&(_+=t.length,_>=r))))break;if(n){if(s)return ta(a,r,0);return void(t[t.length]=a)}}return!n&&a}function ta(e,t,n){return e=1===e.length?e[0]:[].concat.apply([],e),n||e.length>t?e.slice(n,n+t):e}function ua(e,t,n,r){return n?(r=r&&t>n,e=(e=e[r?t:n])&&e[r?n:t]):e=e[t],e}function N(e,t,n,r,i){let s=0;if(e.constructor===Array)if(i)t=e.indexOf(t),-1!==t?1<e.length&&(e.splice(t,1),s++):s++;else{i=Math.min(e.length,n);for(let o,l=0;l<i;l++)(o=e[l])&&(s=N(o,t,n,r,i),r||s||delete e[l])}else for(let o in e)(s=N(e[o],t,n,r,i))||delete e[o];return s}function va(e){e=e.data;var t=self._index;const n=e.args;var r=e.task;switch(r){case"init":r=e.options||{},e=e.factory,t=r.encode,r.cache=!1,t&&0===t.indexOf("function")&&(r.encode=Function("return "+t)()),e?(Function("return "+e)()(self),self._index=new self.FlexSearch.Index(r),delete self.FlexSearch):self._index=new K(r);break;default:e=e.id,t=t[r].apply(t,n),postMessage("search"===r?{id:e,msg:t}:{id:e})}}t=K.prototype,t.append=function(e,t){return this.add(e,t,!0)},t.add=function(e,t,n,r){if(t&&(e||0===e)){if(!r&&!n&&this.register[e])return this.update(e,t);if(t=this.encode(t),r=t.length){const c=v(),h=v(),u=this.depth,f=this.D;for(let _=0;_<r;_++){let d=t[this.F?r-1-_:_];var i=d.length;if(d&&i>=this.B&&(u||!h[d])){var s=L(f,r,_),o="";switch(this.G){case"full":if(3<i){for(s=0;s<i;s++)for(var l=i;l>s;l--)if(l-s>=this.B){var a=L(f,r,_,i,s);o=d.substring(s,l),M(this,h,o,a,e,n)}break}case"reverse":if(2<i){for(l=i-1;0<l;l--)o=d[l]+o,o.length>=this.B&&M(this,h,o,L(f,r,_,i,l),e,n);o=""}case"forward":if(1<i){for(l=0;l<i;l++)o+=d[l],o.length>=this.B&&M(this,h,o,s,e,n);break}default:if(this.C&&(s=Math.min(s/this.C(t,d,_)|0,f-1)),M(this,h,d,s,e,n),u&&1<r&&_<r-1)for(i=v(),o=this.A,s=d,l=Math.min(u+1,r-_),i[s]=1,a=1;a<l;a++)if((d=t[this.F?r-1-_-a:_+a])&&d.length>=this.B&&!i[d]){i[d]=1;const t=this.l&&d>s;M(this,c,t?s:d,L(o+(r/2>o?0:1),r,_,l-1,a-1),e,n,t?d:s)}}}}this.m||(this.register[e]=1)}}return this},t.search=function(e,t,n){n||(!t&&C(e)?(n=e,e=n.query):C(t)&&(n=t));let r,i=[];let s,o=0;if(n){t=n.limit,o=n.offset||0;var l=n.context;s=n.suggest}if(e&&(e=this.encode(e),r=e.length,1<r)){n=v();var a=[];for(let t,o=0,l=0;o<r;o++)if((t=e[o])&&t.length>=this.B&&!n[t]){if(!(this.s||s||this.map[t]))return i;a[l++]=t,n[t]=1}e=a,r=e.length}if(!r)return i;let c;t||(t=100),l=this.depth&&1<r&&!1!==l,n=0,l?(c=e[0],n=1):1<r&&e.sort(ba);for(let h,u;n<r;n++){if(u=e[n],l?(h=sa(this,i,s,t,o,2===r,u,c),s&&!1===h&&i.length||(c=u)):h=sa(this,i,s,t,o,1===r,u),h)return h;if(s&&n===r-1){if(a=i.length,!a){if(l){l=0,n=-1;continue}return i}if(1===a)return ta(i[0],t,o)}}return ma(i,t,o,s)},t.contain=function(e){return!!this.register[e]},t.update=function(e,t){return this.remove(e).add(e,t)},t.remove=function(e,t){const n=this.register[e];if(n){if(this.m)for(let t,r=0;r<n.length;r++)t=n[r],t.splice(t.indexOf(e),1);else N(this.map,e,this.D,this.s),this.depth&&N(this.h,e,this.A,this.s);if(t||delete this.register[e],this.cache){t=this.cache;for(let n,r,i=0;i<t.h.length;i++)r=t.h[i],n=t.cache[r],-1!==n.indexOf(e)&&(t.h.splice(i--,1),delete t.cache[r])}}return this},t.searchCache=oa,t.export=function(e,t,n,r,i){let s,o;switch(i||(i=0)){case 0:if(s="reg",this.m){o=v();for(let e in this.register)o[e]=1}else o=this.register;break;case 1:s="cfg",o={doc:0,opt:this.s?1:0};break;case 2:s="map",o=this.map;break;case 3:s="ctx",o=this.h;break;default:return}return ra(e,t||this,n?n+"."+s:s,r,i,o),!0},t.import=function(e,t){if(t)switch(x(t)&&(t=JSON.parse(t)),e){case"cfg":this.s=!!t.opt;break;case"reg":this.m=!1,this.register=t;break;case"map":this.map=t;break;case"ctx":this.h=t}},la(K.prototype);let wa=0;function O(e){if(!(this instanceof O))return new O(e);var t;e?D(t=e.encode)&&(e.encode=t.toString()):e={},(t=(self||window)._factory)&&(t=t.toString());const n=self.exports,r=this;this.o=xa(t,n,e.worker),this.h=v(),this.o&&(n?this.o.on("message",(function(e){r.h[e.id](e.msg),delete r.h[e.id]})):this.o.onmessage=function(e){e=e.data,r.h[e.id](e.msg),delete r.h[e.id]},this.o.postMessage({task:"init",factory:t,options:e}))}function P(e){O.prototype[e]=O.prototype[e+"Async"]=function(){const t=this,n=[].slice.call(arguments);var r=n[n.length-1];let i;return D(r)&&(i=r,n.splice(n.length-1,1)),r=new Promise((function(r){setTimeout((function(){t.h[++wa]=r,t.o.postMessage({task:e,id:wa,args:n})}))})),i?(r.then(i),this):r}}function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d}function Q(e){if(!(this instanceof Q))return new Q(e);var t,n=e.document||e.doc||e;this.K=[],this.h=[],this.A=[],this.register=v(),this.key=(t=n.key||n.id)&&S(t,this.A)||"id",this.m=u(e.fastupdate),this.C=(t=n.store)&&!0!==t&&[],this.store=t&&v(),this.I=(t=n.tag)&&S(t,this.A),this.l=t&&v(),this.cache=(t=e.cache)&&new J(t),e.cache=!1,this.o=e.worker,this.async=!1,t=v();let r=n.index||n.field||n;x(r)&&(r=[r]);for(let n,i,s=0;s<r.length;s++)n=r[s],x(n)||(i=n,n=n.field),i=C(i)?Object.assign({},e,i):e,this.o&&(t[n]=new O(i),t[n].o||(this.o=!1)),this.o||(t[n]=new K(i,this.register)),this.K[s]=S(n,this.A),this.h[s]=n;if(this.C)for(e=n.store,x(e)&&(e=[e]),n=0;n<e.length;n++)this.C[n]=S(e[n],this.A);this.index=t}function S(e,t){const n=e.split(":");let r=0;for(let i=0;i<n.length;i++)e=n[i],0<=e.indexOf("[]")&&(e=e.substring(0,e.length-2))&&(t[r]=!0),e&&(n[r++]=e);return r<n.length&&(n.length=r),1<r?n:n[0]}function T(e,t){if(x(t))e=e[t];else for(let n=0;e&&n<t.length;n++)e=e[t[n]];return e}function U(e,t,n,r,i){if(e=e[i],r===n.length-1)t[i]=e;else if(e)if(e.constructor===Array)for(t=t[i]=Array(e.length),i=0;i<e.length;i++)U(e,t,n,r,i);else t=t[i]||(t[i]=v()),i=n[++r],U(e,t,n,r,i)}function V(e,t,n,r,i,s,o,l){if(e=e[o])if(r===t.length-1){if(e.constructor===Array){if(n[r]){for(t=0;t<e.length;t++)i.add(s,e[t],!0,!0);return}e=e.join(" ")}i.add(s,e,l,!0)}else if(e.constructor===Array)for(o=0;o<e.length;o++)V(e,t,n,r,i,s,o,l);else o=t[++r],V(e,t,n,r,i,s,o,l)}function ya(e,t,n,r){let i=this.l[e],s=i&&i.length-n;if(s&&0<s)return(s>t||n)&&(i=i.slice(n,n+t)),r&&(i=za.call(this,i)),{tag:e,result:i}}function za(e){const t=Array(e.length);for(let n,r=0;r<e.length;r++)n=e[r],t[r]={id:n,doc:this.store[n]};return t}P("add"),P("append"),P("search"),P("update"),P("remove"),t=Q.prototype,t.add=function(e,t,n){if(C(e)&&(t=e,e=T(t,this.key)),t&&(e||0===e)){if(!n&&this.register[e])return this.update(e,t);for(let r,i,s=0;s<this.h.length;s++)i=this.h[s],r=this.K[s],x(r)&&(r=[r]),V(t,r,this.A,0,this.index[i],e,r[0],n);if(this.I){let r=T(t,this.I),i=v();x(r)&&(r=[r]);for(let t,s,o=0;o<r.length;o++)if(t=r[o],!i[t]&&(i[t]=1,s=this.l[t]||(this.l[t]=[]),!n||-1===s.indexOf(e))&&(s[s.length]=e,this.m)){const t=this.register[e]||(this.register[e]=[]);t[t.length]=s}}if(this.store&&(!n||!this.store[e])){let n;if(this.C){n=v();for(let e,r=0;r<this.C.length;r++)e=this.C[r],x(e)?n[e]=t[e]:U(t,n,e,0,e[0])}this.store[e]=n||t}}return this},t.append=function(e,t){return this.add(e,t,!0)},t.update=function(e,t){return this.remove(e).add(e,t)},t.remove=function(e){if(C(e)&&(e=T(e,this.key)),this.register[e]){for(var t=0;t<this.h.length&&(this.index[this.h[t]].remove(e,!this.o),!this.m);t++);if(this.I&&!this.m)for(let n in this.l){t=this.l[n];const r=t.indexOf(e);-1!==r&&(1<t.length?t.splice(r,1):delete this.l[n])}this.store&&delete this.store[e],delete this.register[e]}return this},t.search=function(e,t,n,r){n||(!t&&C(e)?(n=e,e=n.query):C(t)&&(n=t,t=0));let i,s,o,l,a,c,h=[],u=[],f=0;if(n)if(n.constructor===Array)o=n,n=null;else{if(o=(i=n.pluck)||n.index||n.field,l=n.tag,s=this.store&&n.enrich,a="and"===n.bool,t=n.limit||100,c=n.offset||0,l&&(x(l)&&(l=[l]),!e)){for(let e,n=0;n<l.length;n++)(e=ya.call(this,l[n],t,c,s))&&(h[h.length]=e,f++);return f?h:[]}x(o)&&(o=[o])}o||(o=this.h),a=a&&(1<o.length||l&&1<l.length);const _=!r&&(this.o||this.async)&&[];for(let i,s,d,p=0;p<o.length;p++){let g;if(s=o[p],x(s)||(g=s,s=s.field),_)_[p]=this.index[s].searchAsync(e,t,g||n);else{if(i=r?r[p]:this.index[s].search(e,t,g||n),d=i&&i.length,l&&d){const e=[];let n=0;a&&(e[0]=[i]);for(let t,r,i=0;i<l.length;i++)t=l[i],(d=(r=this.l[t])&&r.length)&&(n++,e[e.length]=a?[r]:r);n&&(i=a?ma(e,t||100,c||0):na(i,e),d=i.length)}if(d)u[f]=s,h[f++]=i;else if(a)return[]}}if(_){const r=this;return new Promise((function(i){Promise.all(_).then((function(s){i(r.search(e,t,n,s))}))}))}if(!f)return[];if(i&&(!s||!this.store))return h[0];for(let e,t=0;t<u.length;t++){if(e=h[t],e.length&&s&&(e=za.call(this,e)),i)return e;h[t]={field:u[t],result:e}}return h},t.contain=function(e){return!!this.register[e]},t.get=function(e){return this.store[e]},t.set=function(e,t){return this.store[e]=t,this},t.searchCache=oa,t.export=function(e,t,n,r,i){if(i||(i=0),r||(r=0),r<this.h.length){const n=this.h[r],s=this.index[n];t=this,setTimeout((function(){s.export(e,t,i?n.replace(":","-"):"",r,i++)||(r++,i=1,t.export(e,t,n,r,i))}))}else{let t;switch(i){case 1:n="tag",t=this.l;break;case 2:n="store",t=this.store;break;default:return}ra(e,this,n,r,i,t)}},t.import=function(e,t){if(t)switch(x(t)&&(t=JSON.parse(t)),e){case"tag":this.l=t;break;case"reg":this.m=!1,this.register=t;for(let e,n=0;n<this.h.length;n++)e=this.index[this.h[n]],e.register=t,e.m=!1;break;case"store":this.store=t;break;default:e=e.split(".");const n=e[0];e=e[1],n&&e&&this.index[n].import(e,t)}},la(Q.prototype);var Ba={encode:Aa,F:!1,G:""};const Ca=[F("[àáâãäå]"),"a",F("[èéêë]"),"e",F("[ìíîï]"),"i",F("[òóôõöő]"),"o",F("[ùúûüű]"),"u",F("[ýŷÿ]"),"y",F("ñ"),"n",F("[çc]"),"k",F("ß"),"s",F(" & ")," and "];function Aa(e){var t=e;return t.normalize&&(t=t.normalize("NFD").replace(ea,"")),ca.call(this,t.toLowerCase(),!e.normalize&&Ca)}var Ea={encode:Da,F:!1,G:"strict"};const Fa=/[^a-z0-9]+/,Ga={b:"p",v:"f",w:"f",z:"s",x:"s","ß":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Da(e){e=Aa.call(this,e).join(" ");const t=[];if(e){const n=e.split(Fa),r=n.length;for(let i,s=0,o=0;s<r;s++)if((e=n[s])&&(!this.filter||!this.filter[e])){i=e[0];let n=Ga[i]||i,r=n;for(let t=1;t<e.length;t++){i=e[t];const s=Ga[i]||i;s&&s!==r&&(n+=s,r=s)}t[o++]=n}}return t}var Ia={encode:Ha,F:!1,G:""};const Ja=[F("ae"),"a",F("oe"),"o",F("sh"),"s",F("th"),"t",F("ph"),"f",F("pf"),"f",F("(?![aeo])h(?![aeo])"),"",F("(?!^[aeo])h(?!^[aeo])"),""];function Ha(e,t){return e&&(e=Da.call(this,e).join(" "),2<e.length&&(e=E(e,Ja)),t||(1<e.length&&(e=ha(e)),e&&(e=e.split(" ")))),e}var La={encode:Ka,F:!1,G:""};const Ma=F("(?!\\b)[aeo]");function Ka(e){return e&&(e=Ha.call(this,e,!0),1<e.length&&(e=e.replace(Ma,"")),1<e.length&&(e=ha(e)),e&&(e=e.split(" "))),e}G["latin:default"]=ja,G["latin:simple"]=Ba,G["latin:balance"]=Ea,G["latin:advanced"]=Ia,G["latin:extra"]=La;const W=self;let Y;const Z={Index:K,Document:Q,Worker:O,registerCharset:function(e,t){G[e]=t},registerLanguage:function(e,t){ka[e]=t}};(Y=W.define)&&Y.amd?Y([],(function(){return Z})):W.exports?W.exports=Z:W.FlexSearch=Z})(commonjsGlobal)})(flexsearch_bundle);var _window$searchTransla=window.searchTranslation,Link_previous=_window$searchTransla.Link_previous,Link_next=_window$searchTransla.Link_next,Search_no_results=_window$searchTransla.Search_no_results,Search_one_character_or_more=_window$searchTransla.Search_one_character_or_more,Search_one_result=_window$searchTransla.Search_one_result,Search_results=_window$searchTransla.Search_results,Search_should_be_x_or_more=_window$searchTransla.Search_should_be_x_or_more,Search_too_short=_window$searchTransla.Search_too_short;var textLinkPrevious=Link_previous;var textLinkNext=Link_next;var textSearchNoResults=Search_no_results;var textSearchOneCharacterOrMore=Search_one_character_or_more;var textSearchOneResult=Search_one_result;var textSearchResults=Search_results;var textSearchShouldBeXOrMore=Search_should_be_x_or_more;var textSearchTooShort=Search_too_short;function Pagination(e){var t=e.counter,n=e.start,r=e.settings,i=e.onPageSelect;var s=Math.ceil(t/r.show);var o=n/r.show;var l;l=o<=2?Math.min(s,3):Math.min(s,o+2);var a=[];var c=function(e){e===o?a.push(v("li",{className:"current"},e+1)):a.push(v("li",null,v("a",{className:"SearchResults__footer__link",onClick:function(){return i(e*r.show)}},e+1)))};for(var h=0;h<l;h++)c(h);return v("div",{className:"SearchResults__footer"},v("ul",{className:"SearchResults__footer__links Pager"},n>0&&v("li",{className:"Pager--prev"},v("a",{className:"SearchResults__footer__link",onClick:function(){return i(n-r.show)}},textLinkPrevious)),a,o+1!==s&&v("li",{className:"Pager--next"},v("a",{className:"SearchResults__footer__link",onClick:function(){return i(n+r.show)}},textLinkNext))))}function Result(e){var t=e.settings,n=e.item;var r;return n.text&&(r=n.text.split(" ").slice(0,t.descriptiveWords).join(" "),n.text.length<r.length&&"."!==r.charAt(r.length-1)&&(r+=" ...")),v("div",{className:"SearchResult"},v("div",{className:"SearchResults__title"},v("a",{href:t.base_url+n.url},n.title)),t.showURL&&v("div",{className:"SearchResults__url"},v("a",{href:t.base_url+n.url},n.url.toLowerCase().replace(/https?:\/\//g,""))),r&&v("div",{className:"SearchResults__text"},r))}var Search=/*#__PURE__*/function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var r;return _classCallCheck(this,n),r=t.call(this,e),_defineProperty(_assertThisInitialized(r),"handleClose",(function(){r.props.onClose()})),_defineProperty(_assertThisInitialized(r),"scrollTop",(function(){r.resultRef&&(r.resultRef.scrollTop=0)})),_defineProperty(_assertThisInitialized(r),"handlePaginate",(function(e){r.setState({start:e},r.scrollTop)})),_defineProperty(_assertThisInitialized(r),"handleChange",(function(e){r.setState({search:e.target.value,start:0},r.scrollTop),r.props.settings.field.value=e.target.value})),r.state={search:r.props.settings.field.value||"",start:0},r}return _createClass(n,[{key:"getResults",value:function(){var e=this.props.settings;var t=this.state.start;var n=[];var r=0;var i=[];if(this.state.search.length<e.minimumLength)return n.push(textSearchTooShort),n.push(1===e.minimumLength?textSearchOneCharacterOrMore:textSearchShouldBeXOrMore.replace("!min",e.minimumLength)),{warnings:n,counter:r,results:i,start:t};var s=Object.values(this.props.onSearch(this.state.search).reduce((function(e,t){return t.result.forEach((function(t){e.hasOwnProperty(t.id)||(e[t.id]={url:t.id,title:t.doc.title,text:t.doc.text})})),e}),{}));if(r=s.length,0===r)return n.push(textSearchNoResults),{warnings:n,counter:r,results:i,start:t};return e.showTitleCount&&this.props.onTitleChange("(".concat(r,")")),i=s.filter((function(n,r){return r>=t&&r<e.show+t})),{warnings:n,counter:r,results:i,start:t}}},{key:"render",value:function(){var e=this;var t=this.props.settings;var n=this.getResults(),r=n.warnings,i=n.counter,s=n.results,o=n.start;return v("div",null,v("div",{className:"SearchResultsBackdrop"}),v("div",{className:"SearchResults",ref:function(t){return e.resultRef=t}},v("input",{className:"Search__field",placeholder:"Search...",autoComplete:"on",autoSave:"text_search",type:"search",value:this.state.search,onInput:this.handleChange}),v("button",{className:"SearchResults__close",onClick:this.handleClose},"×"),v("div",{className:"SearchResults__count"},1===i?textSearchOneResult:textSearchResults.replace("!count",i)),r.map((function(e){return v("div",{key:e,className:"SearchResults__warning"},e)})),s.map((function(e){return v(Result,{key:e.title,item:e,settings:t})})),i>t.show&&v(Pagination,{counter:i,start:o,settings:t,onPageSelect:this.handlePaginate})))}}]),n}(_);var originalTitle=document.title;function getURLP(e){var t=new RegExp("[?|&]".concat(e,"=([^&;]+?)(&|#|;|$)")).exec(window.location.search);return decodeURIComponent((t&&t[1]||"").replace(/\+/g,"%20"))||null}var SearchEngine=/*#__PURE__*/function(){function e(t){var n=this;_classCallCheck(this,e),_defineProperty(this,"keyUpHandler",(function(e){27===e.which&&n.handleClose()})),_defineProperty(this,"handleClose",(function(){document.title=originalTitle,document.removeEventListener("keyup",n.keyUpHandler),document.body.classList.remove("with-search"),S(null,n.resultContainer),n.resultContainer=null})),this.settings=_objectSpread2({field:document.getElementById("search_input"),form:document.getElementById("search_form"),show:10,showURL:!0,showTitleCount:!0,minimumLength:3,descriptiveWords:25,highlightTerms:!0,highlightEveryTerm:!1,contentLocation:"daux_search_index.js"},t),this.searchIndex={pages:[]}}return _createClass(e,[{key:"loadData",value:function(){var e=this;if(!this.loadingPromise){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=this.settings.base_url+this.settings.contentLocation;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),this.loadingPromise=new Promise((function(e){window.load_search_index=function(t){return e(t)}})).then((function(t){e.searchIndex=new flexsearch_bundle.exports.Document({doc:{id:"url",tag:"tags",field:["title","text"],store:["title","text"]}});var n=t.pages;if(window.searchLanguage){var r="".concat(window.searchLanguage,"/");n=n.filter((function(e){return 0===e.url.indexOf(r)}))}n.forEach((function(t){return e.searchIndex.add(t)}))}))}return this.loadingPromise}},{key:"run",value:function(){var e=this;getURLP("q")&&(this.settings.field.value=getURLP("q"),this.loadData().then((function(){e.displaySearch()}))),this.settings.field.addEventListener("keyup",(function(t){e.loadData(),13===parseInt(t.keyCode,10)&&e.loadData().then((function(){e.displaySearch()}))})),this.settings.form.addEventListener("submit",(function(t){t.preventDefault(),e.loadData().then((function(){e.displaySearch()}))}))}},{key:"displaySearch",value:function(){var e=this;this.resultContainer||(this.resultContainer=document.createElement("div"),document.body.appendChild(this.resultContainer)),document.addEventListener("keyup",this.keyUpHandler),S(v(Search,{onSearch:function(t){return e.searchIndex.search(t,{enrich:!0})},onClose:this.handleClose,onTitleChange:function(e){document.title="".concat(e," ").concat(originalTitle)},settings:this.settings}),this.resultContainer),document.body.classList.add("with-search"),document.body.scrollTop=0}}]),e}();function search(e){var t=new SearchEngine(e);t.run()}window.search=search})();
//# sourceMappingURL=search.min.js.map