@eox/itemfilter 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-itemfilter.js +607 -486
- package/dist/eox-itemfilter.umd.cjs +137 -113
- package/package.json +5 -2
- package/test/config.cy.ts +161 -0
- package/test/general.cy.ts +5 -4
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(m,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(m=typeof globalThis<"u"?globalThis:m||self,y(m["eox-itemfilter"]={}))})(this,function(m){"use strict";var $s=Object.defineProperty;var vs=(m,y,w)=>y in m?$s(m,y,{enumerable:!0,configurable:!0,writable:!0,value:w}):m[y]=w;var $=(m,y,w)=>(vs(m,typeof y!="symbol"?y+"":y,w),w);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const y=window,w=y.ShadowRoot&&(y.ShadyCSS===void 0||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,It=Symbol(),Ot=new WeakMap;let ue=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==It)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(w&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Ot.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Ot.set(e,t))}return t}toString(){return this.cssText}};const de=r=>new ue(typeof r=="string"?r:r+"",void 0,It),fe=(r,t)=>{w?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const s=document.createElement("style"),i=y.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)})},Lt=w?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return de(e)})(r):r;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/var
|
|
9
|
+
*/var ht;const tt=window,kt=tt.trustedTypes,pe=kt?kt.emptyScript:"",Nt=tt.reactiveElementPolyfillSupport,at={toAttribute(r,t){switch(t){case Boolean:r=r?pe:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Pt=(r,t)=>t!==r&&(t==t||r==r),ut={attribute:!0,type:String,converter:at,reflect:!1,hasChanged:Pt};let z=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,s)=>{const i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i))}),t}static createProperty(t,e=ut){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||ut}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of s)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Lt(i))}else t!==void 0&&e.push(Lt(t));return e}static _$Ep(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return fe(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=ut){var i;const n=this.constructor._$Ep(t,s);if(n!==void 0&&s.reflect===!0){const o=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:at).toAttribute(e,s.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,e){var s;const i=this.constructor,n=i._$Ev.get(t);if(n!==void 0&&this._$El!==n){const o=i.getPropertyOptions(n),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?o.converter:at;this._$El=n,this[n]=c.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||Pt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,n)=>this[n]=i),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var n;return(n=i.hostUpdate)===null||n===void 0?void 0:n.call(i)}),this.update(s)):this._$Ek()}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return(i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};z.finalized=!0,z.elementProperties=new Map,z.elementStyles=[],z.shadowRootOptions={mode:"open"},Nt==null||Nt({ReactiveElement:z}),((ht=tt.reactiveElementVersions)!==null&&ht!==void 0?ht:tt.reactiveElementVersions=[]).push("1.6.1");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/var
|
|
14
|
-
\f\r]`,J=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/var dt;const et=window,B=et.trustedTypes,Tt=B?B.createPolicy("lit-html",{createHTML:r=>r}):void 0,ft="$lit$",C=`lit$${(Math.random()+"").slice(9)}$`,Ut="?"+C,ge=`<${Ut}>`,k=document,Y=()=>k.createComment(""),G=r=>r===null||typeof r!="object"&&typeof r!="function",Ht=Array.isArray,_e=r=>Ht(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",pt=`[
|
|
14
|
+
\f\r]`,J=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ft=/-->/g,jt=/>/g,N=RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),zt=/'/g,Bt=/"/g,Dt=/^(?:script|style|textarea|title)$/i,me=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),x=me(1),P=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),Wt=new WeakMap,T=k.createTreeWalker(k,129,null,!1),$e=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":"",o=J;for(let l=0;l<e;l++){const h=r[l];let u,a,d=-1,p=0;for(;p<h.length&&(o.lastIndex=p,a=o.exec(h),a!==null);)p=o.lastIndex,o===J?a[1]==="!--"?o=Ft:a[1]!==void 0?o=jt:a[2]!==void 0?(Dt.test(a[2])&&(i=RegExp("</"+a[2],"g")),o=N):a[3]!==void 0&&(o=N):o===N?a[0]===">"?(o=i??J,d=-1):a[1]===void 0?d=-2:(d=o.lastIndex-a[2].length,u=a[1],o=a[3]===void 0?N:a[3]==='"'?Bt:zt):o===Bt||o===zt?o=N:o===Ft||o===jt?o=J:(o=N,i=void 0);const g=o===N&&r[l+1].startsWith("/>")?" ":"";n+=o===J?h+ge:d>=0?(s.push(u),h.slice(0,d)+ft+h.slice(d)+C+g):h+C+(d===-2?(s.push(void 0),l):g)}const c=n+(r[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Tt!==void 0?Tt.createHTML(c):c,s]};class q{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const c=t.length-1,l=this.parts,[h,u]=$e(t,e);if(this.el=q.createElement(h,s),T.currentNode=this.el.content,e===2){const a=this.el.content,d=a.firstChild;d.remove(),a.append(...d.childNodes)}for(;(i=T.nextNode())!==null&&l.length<c;){if(i.nodeType===1){if(i.hasAttributes()){const a=[];for(const d of i.getAttributeNames())if(d.endsWith(ft)||d.startsWith(C)){const p=u[o++];if(a.push(d),p!==void 0){const g=i.getAttribute(p.toLowerCase()+ft).split(C),v=/([.?@])?(.*)/.exec(p);l.push({type:1,index:n,name:v[2],strings:g,ctor:v[1]==="."?ye:v[1]==="?"?Ee:v[1]==="@"?xe:st})}else l.push({type:6,index:n})}for(const d of a)i.removeAttribute(d)}if(Dt.test(i.tagName)){const a=i.textContent.split(C),d=a.length-1;if(d>0){i.textContent=B?B.emptyScript:"";for(let p=0;p<d;p++)i.append(a[p],Y()),T.nextNode(),l.push({type:2,index:++n});i.append(a[d],Y())}}}else if(i.nodeType===8)if(i.data===Ut)l.push({type:2,index:n});else{let a=-1;for(;(a=i.data.indexOf(C,a+1))!==-1;)l.push({type:7,index:n}),a+=C.length-1}n++}}static createElement(t,e){const s=k.createElement("template");return s.innerHTML=t,s}}function D(r,t,e=r,s){var i,n,o,c;if(t===P)return t;let l=s!==void 0?(i=e._$Co)===null||i===void 0?void 0:i[s]:e._$Cl;const h=G(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==h&&((n=l==null?void 0:l._$AO)===null||n===void 0||n.call(l,!1),h===void 0?l=void 0:(l=new h(r),l._$AT(r,e,s)),s!==void 0?((o=(c=e)._$Co)!==null&&o!==void 0?o:c._$Co=[])[s]=l:e._$Cl=l),l!==void 0&&(t=D(r,l._$AS(r,t.values),l,s)),t}class ve{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:s},parts:i}=this._$AD,n=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:k).importNode(s,!0);T.currentNode=n;let o=T.nextNode(),c=0,l=0,h=i[0];for(;h!==void 0;){if(c===h.index){let u;h.type===2?u=new Q(o,o.nextSibling,this,t):h.type===1?u=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(u=new Se(o,this,t)),this._$AV.push(u),h=i[++l]}c!==(h==null?void 0:h.index)&&(o=T.nextNode(),c++)}return T.currentNode=k,n}v(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class Q{constructor(t,e,s,i){var n;this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cp=(n=i==null?void 0:i.isConnected)===null||n===void 0||n}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=D(this,t,e),G(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):_e(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==_&&G(this._$AH)?this._$AA.nextSibling.data=t:this.$(k.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=q.createElement(i.h,this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===n)this._$AH.v(s);else{const o=new ve(n,this),c=o.u(this.options);o.v(s),this.$(c),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new q(t)),e}T(t){Ht(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new Q(this.k(Y()),this.k(Y()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class st{constructor(t,e,s,i,n){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=_}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=D(this,t,e,0),o=!G(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const c=t;let l,h;for(t=n[0],l=0;l<n.length-1;l++)h=D(this,c[s+l],e,l),h===P&&(h=this._$AH[l]),o||(o=!G(h)||h!==this._$AH[l]),h===_?t=_:t!==_&&(t+=(h??"")+n[l+1]),this._$AH[l]=h}o&&!i&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ye extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}}const Ae=B?B.emptyScript:"";class Ee extends st{constructor(){super(...arguments),this.type=4}j(t){t&&t!==_?this.element.setAttribute(this.name,Ae):this.element.removeAttribute(this.name)}}class xe extends st{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){var s;if((t=(s=D(this,t,e,0))!==null&&s!==void 0?s:_)===P)return;const i=this._$AH,n=t===_&&i!==_||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==_&&(i===_||n);n&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}}class Se{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}}const Vt=et.litHtmlPolyfillSupport;Vt==null||Vt(q,Q),((dt=et.litHtmlVersions)!==null&&dt!==void 0?dt:et.litHtmlVersions=[]).push("2.7.4");const be=(r,t,e)=>{var s,i;const n=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:t;let o=n._$litPart$;if(o===void 0){const c=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:null;n._$litPart$=o=new Q(t.insertBefore(Y(),c),c,void 0,e??{})}return o._$AI(r),o};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/var
|
|
19
|
+
*/var gt,_t;class X extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=be(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return P}}X.finalized=!0,X._$litElement$=!0,(gt=globalThis.litElementHydrateSupport)===null||gt===void 0||gt.call(globalThis,{LitElement:X});const Kt=globalThis.litElementPolyfillSupport;Kt==null||Kt({LitElement:X}),((_t=globalThis.litElementVersions)!==null&&_t!==void 0?_t:globalThis.litElementVersions=[]).push("3.3.2");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const we=r=>t=>typeof t=="function"?((e,s)=>(customElements.define(e,s),s))(r,t):((e,s)=>{const{kind:i,elements:n}=s;return{kind:i,elements:n,finisher(o){customElements.define(e,o)}}})(r,t);/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const Me=(r,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,r)}};function mt(r){return(t,e)=>e!==void 0?((s,i,n)=>{i.constructor.createProperty(n,s)})(r,t,e):Me(r,t)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -32,19 +32,23 @@
|
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2021 Google LLC
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
-
*/var
|
|
35
|
+
*/var $t;(($t=window.HTMLSlotElement)===null||$t===void 0?void 0:$t.prototype.assignedElements)!=null;/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2021 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/function
|
|
39
|
+
*/function rt(r,t,e){return r?t():e==null?void 0:e()}/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2021 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/function*Z(r,t){if(r!==void 0){let e=0;for(const s of r)yield t(s,e++)}}/**
|
|
40
44
|
* @license
|
|
41
45
|
* Copyright 2017 Google LLC
|
|
42
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/const
|
|
47
|
+
*/const Re={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ce=r=>(...t)=>({_$litDirective$:r,values:t});class Ie{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
44
48
|
* @license
|
|
45
49
|
* Copyright 2017 Google LLC
|
|
46
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/class $t extends Ce{constructor(t){if(super(t),this.et=m,t.type!==we.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===m||t==null)return this.ft=void 0,this.et=t;if(t===k)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}$t.directiveName="unsafeHTML",$t.resultType=1;const Vt=Me($t);function b(r){return Array.isArray?Array.isArray(r):Jt(r)==="[object Array]"}const Ie=1/0;function Re(r){if(typeof r=="string")return r;let t=r+"";return t=="0"&&1/r==-Ie?"-0":t}function Oe(r){return r==null?"":Re(r)}function x(r){return typeof r=="string"}function Yt(r){return typeof r=="number"}function Le(r){return r===!0||r===!1||Ne(r)&&Jt(r)=="[object Boolean]"}function Gt(r){return typeof r=="object"}function Ne(r){return Gt(r)&&r!==null}function y(r){return r!=null}function vt(r){return!r.trim().length}function Jt(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const $s="Extended search is not available",Te="Incorrect 'index' type",ke=r=>`Invalid value for key ${r}`,Pe=r=>`Pattern length exceeds max of ${r}.`,Ue=r=>`Missing ${r} property in key`,He=r=>`Property 'weight' in key '${r}' must be a positive integer`,Qt=Object.prototype.hasOwnProperty;class je{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(s=>{let i=Xt(s);e+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,e+=i.weight}),this._keys.forEach(s=>{s.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Xt(r){let t=null,e=null,s=null,i=1,n=null;if(x(r)||b(r))s=r,t=Zt(r),e=yt(r);else{if(!Qt.call(r,"name"))throw new Error(Ue("name"));const o=r.name;if(s=o,Qt.call(r,"weight")&&(i=r.weight,i<=0))throw new Error(He(o));t=Zt(o),e=yt(o),n=r.getFn}return{path:t,id:e,weight:i,src:s,getFn:n}}function Zt(r){return b(r)?r:r.split(".")}function yt(r){return b(r)?r.join("."):r}function Fe(r,t){let e=[],s=!1;const i=(n,o,c)=>{if(y(n))if(!o[c])e.push(n);else{let l=o[c];const h=n[l];if(!y(h))return;if(c===o.length-1&&(x(h)||Yt(h)||Le(h)))e.push(Oe(h));else if(b(h)){s=!0;for(let u=0,a=h.length;u<a;u+=1)i(h[u],o,c+1)}else o.length&&i(h,o,c+1)}};return i(r,x(t)?t.split("."):t,0),s?e:e[0]}var f={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,t)=>r.score===t.score?r.idx<t.idx?-1:1:r.score<t.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Fe,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const ze=/[^ ]+/g;function Be(r=1,t=3){const e=new Map,s=Math.pow(10,t);return{get(i){const n=i.match(ze).length;if(e.has(n))return e.get(n);const o=1/Math.pow(n,.5*r),c=parseFloat(Math.round(o*s)/s);return e.set(n,c),c},clear(){e.clear()}}}class At{constructor({getFn:t=f.getFn,fieldNormWeight:e=f.fieldNormWeight}={}){this.norm=Be(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,s)=>{this._keysMap[e.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,x(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();x(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!y(t)||vt(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach((i,n)=>{let o=i.getFn?i.getFn(t):this.getFn(t,i.path);if(y(o)){if(b(o)){let c=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:h,value:u}=l.pop();if(y(u))if(x(u)&&!vt(u)){let a={v:u,i:h,n:this.norm.get(u)};c.push(a)}else b(u)&&u.forEach((a,d)=>{l.push({nestedArrIndex:d,value:a})})}s.$[n]=c}else if(x(o)&&!vt(o)){let c={v:o,n:this.norm.get(o)};s.$[n]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function qt(r,t,{getFn:e=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){const i=new At({getFn:e,fieldNormWeight:s});return i.setKeys(r.map(Xt)),i.setSources(t),i.create(),i}function De(r,{getFn:t=f.getFn,fieldNormWeight:e=f.fieldNormWeight}={}){const{keys:s,records:i}=r,n=new At({getFn:t,fieldNormWeight:e});return n.setKeys(s),n.setIndexRecords(i),n}function rt(r,{errors:t=0,currentLocation:e=0,expectedLocation:s=0,distance:i=f.distance,ignoreLocation:n=f.ignoreLocation}={}){const o=t/r.length;if(n)return o;const c=Math.abs(s-e);return i?o+c/i:c?1:o}function We(r=[],t=f.minMatchCharLength){let e=[],s=-1,i=-1,n=0;for(let o=r.length;n<o;n+=1){let c=r[n];c&&s===-1?s=n:!c&&s!==-1&&(i=n-1,i-s+1>=t&&e.push([s,i]),s=-1)}return r[n-1]&&n-s>=t&&e.push([s,n-1]),e}const U=32;function Ke(r,t,e,{location:s=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:h=f.ignoreLocation}={}){if(t.length>U)throw new Error(Pe(U));const u=t.length,a=r.length,d=Math.max(0,Math.min(s,a));let p=n,g=d;const $=c>1||l,j=$?Array(a):[];let w;for(;(w=r.indexOf(t,g))>-1;){let A=rt(t,{currentLocation:w,expectedLocation:d,distance:i,ignoreLocation:h});if(p=Math.min(A,p),g=w+u,$){let R=0;for(;R<u;)j[w+R]=1,R+=1}}g=-1;let K=[],F=1,ot=u+a;const gs=1<<u-1;for(let A=0;A<u;A+=1){let R=0,O=ot;for(;R<O;)rt(t,{errors:A,currentLocation:d+O,expectedLocation:d,distance:i,ignoreLocation:h})<=p?R=O:ot=O,O=Math.floor((ot-R)/2+R);ot=O;let le=Math.max(1,d-O+1),Ct=o?a:Math.min(d+O,a)+u,V=Array(Ct+2);V[Ct+1]=(1<<A)-1;for(let E=Ct;E>=le;E-=1){let lt=E-1,ce=e[r.charAt(lt)];if($&&(j[lt]=+!!ce),V[E]=(V[E+1]<<1|1)&ce,A&&(V[E]|=(K[E+1]|K[E])<<1|1|K[E+1]),V[E]&gs&&(F=rt(t,{errors:A,currentLocation:lt,expectedLocation:d,distance:i,ignoreLocation:h}),F<=p)){if(p=F,g=lt,g<=d)break;le=Math.max(1,2*d-g)}}if(rt(t,{errors:A+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:h})>p)break;K=V}const Mt={isMatch:g>=0,score:Math.max(.001,F)};if($){const A=We(j,c);A.length?l&&(Mt.indices=A):Mt.isMatch=!1}return Mt}function Ve(r){let t={};for(let e=0,s=r.length;e<s;e+=1){const i=r.charAt(e);t[i]=(t[i]||0)|1<<s-e-1}return t}class te{constructor(t,{location:e=f.location,threshold:s=f.threshold,distance:i=f.distance,includeMatches:n=f.includeMatches,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,isCaseSensitive:l=f.isCaseSensitive,ignoreLocation:h=f.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:l,ignoreLocation:h},this.pattern=l?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const u=(d,p)=>{this.chunks.push({pattern:d,alphabet:Ve(d),startIndex:p})},a=this.pattern.length;if(a>U){let d=0;const p=a%U,g=a-p;for(;d<g;)u(this.pattern.substr(d,U),d),d+=U;if(p){const $=a-U;u(this.pattern.substr($),$)}}else u(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let g={isMatch:!0,score:0};return s&&(g.indices=[[0,t.length-1]]),g}const{location:i,distance:n,threshold:o,findAllMatches:c,minMatchCharLength:l,ignoreLocation:h}=this.options;let u=[],a=0,d=!1;this.chunks.forEach(({pattern:g,alphabet:$,startIndex:j})=>{const{isMatch:w,score:K,indices:F}=Ke(t,g,$,{location:i+j,distance:n,threshold:o,findAllMatches:c,minMatchCharLength:l,includeMatches:s,ignoreLocation:h});w&&(d=!0),a+=K,w&&F&&(u=[...u,...F])});let p={isMatch:d,score:d?a/this.chunks.length:1};return d&&s&&(p.indices=u),p}}class I{constructor(t){this.pattern=t}static isMultiMatch(t){return ee(t,this.multiRegex)}static isSingleMatch(t){return ee(t,this.singleRegex)}search(){}}function ee(r,t){const e=r.match(t);return e?e[1]:null}class Ye extends I{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Ge extends I{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Je extends I{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Qe extends I{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Xe extends I{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Ze extends I{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class se extends I{constructor(t,{location:e=f.location,threshold:s=f.threshold,distance:i=f.distance,includeMatches:n=f.includeMatches,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,isCaseSensitive:l=f.isCaseSensitive,ignoreLocation:h=f.ignoreLocation}={}){super(t),this._bitapSearch=new te(t,{location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:l,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ie extends I{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,s;const i=[],n=this.pattern.length;for(;(s=t.indexOf(this.pattern,e))>-1;)e=s+n,i.push([s,e-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const Et=[Ye,ie,Je,Qe,Ze,Xe,Ge,se],re=Et.length,qe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ts="|";function es(r,t={}){return r.split(ts).map(e=>{let s=e.trim().split(qe).filter(n=>n&&!!n.trim()),i=[];for(let n=0,o=s.length;n<o;n+=1){const c=s[n];let l=!1,h=-1;for(;!l&&++h<re;){const u=Et[h];let a=u.isMultiMatch(c);a&&(i.push(new u(a,t)),l=!0)}if(!l)for(h=-1;++h<re;){const u=Et[h];let a=u.isSingleMatch(c);if(a){i.push(new u(a,t));break}}}return i})}const ss=new Set([se.type,ie.type]);class is{constructor(t,{isCaseSensitive:e=f.isCaseSensitive,includeMatches:s=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:o=f.findAllMatches,location:c=f.location,threshold:l=f.threshold,distance:h=f.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:i,findAllMatches:o,ignoreLocation:n,location:c,threshold:l,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=es(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:i}=this.options;t=i?t:t.toLowerCase();let n=0,o=[],c=0;for(let l=0,h=e.length;l<h;l+=1){const u=e[l];o.length=0,n=0;for(let a=0,d=u.length;a<d;a+=1){const p=u[a],{isMatch:g,indices:$,score:j}=p.search(t);if(g){if(n+=1,c+=j,s){const w=p.constructor.type;ss.has(w)?o=[...o,...$]:o.push($)}}else{c=0,n=0,o.length=0;break}}if(n){let a={isMatch:!0,score:c/n};return s&&(a.indices=o),a}}return{isMatch:!1,score:1}}}const xt=[];function rs(...r){xt.push(...r)}function St(r,t){for(let e=0,s=xt.length;e<s;e+=1){let i=xt[e];if(i.condition(r,t))return new i(r,t)}return new te(r,t)}const nt={AND:"$and",OR:"$or"},bt={PATH:"$path",PATTERN:"$val"},wt=r=>!!(r[nt.AND]||r[nt.OR]),ns=r=>!!r[bt.PATH],os=r=>!b(r)&&Gt(r)&&!wt(r),ne=r=>({[nt.AND]:Object.keys(r).map(t=>({[t]:r[t]}))});function oe(r,t,{auto:e=!0}={}){const s=i=>{let n=Object.keys(i);const o=ns(i);if(!o&&n.length>1&&!wt(i))return s(ne(i));if(os(i)){const l=o?i[bt.PATH]:n[0],h=o?i[bt.PATTERN]:i[l];if(!x(h))throw new Error(ke(l));const u={keyId:yt(l),pattern:h};return e&&(u.searcher=St(h,t)),u}let c={children:[],operator:n[0]};return n.forEach(l=>{const h=i[l];b(h)&&h.forEach(u=>{c.children.push(s(u))})}),c};return wt(r)||(r=ne(r)),s(r)}function ls(r,{ignoreFieldNorm:t=f.ignoreFieldNorm}){r.forEach(e=>{let s=1;e.matches.forEach(({key:i,norm:n,score:o})=>{const c=i?i.weight:null;s*=Math.pow(o===0&&c?Number.EPSILON:o,(c||1)*(t?1:n))}),e.score=s})}function cs(r,t){const e=r.matches;t.matches=[],y(e)&&e.forEach(s=>{if(!y(s.indices)||!s.indices.length)return;const{indices:i,value:n}=s;let o={indices:i,value:n};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),t.matches.push(o)})}function hs(r,t){t.score=r.score}function as(r,t,{includeMatches:e=f.includeMatches,includeScore:s=f.includeScore}={}){const i=[];return e&&i.push(cs),s&&i.push(hs),r.map(n=>{const{idx:o}=n,c={item:t[o],refIndex:o};return i.length&&i.forEach(l=>{l(n,c)}),c})}class W{constructor(t,e={},s){this.options={...f,...e},this.options.useExtendedSearch,this._keyStore=new je(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof At))throw new Error(Te);this._myIndex=e||qt(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){y(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let s=0,i=this._docs.length;s<i;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,i-=1,e.push(n))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:i,shouldSort:n,sortFn:o,ignoreFieldNorm:c}=this.options;let l=x(t)?x(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return ls(l,{ignoreFieldNorm:c}),n&&l.sort(o),Yt(e)&&e>-1&&(l=l.slice(0,e)),as(l,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(t){const e=St(t,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:n,i:o,n:c})=>{if(!y(n))return;const{isMatch:l,score:h,indices:u}=e.searchIn(n);l&&i.push({item:n,idx:o,matches:[{score:h,value:n,norm:c,indices:u}]})}),i}_searchLogical(t){const e=oe(t,this.options),s=(c,l,h)=>{if(!c.children){const{keyId:a,searcher:d}=c,p=this._findMatches({key:this._keyStore.get(a),value:this._myIndex.getValueForItemAtKeyId(l,a),searcher:d});return p&&p.length?[{idx:h,item:l,matches:p}]:[]}const u=[];for(let a=0,d=c.children.length;a<d;a+=1){const p=c.children[a],g=s(p,l,h);if(g.length)u.push(...g);else if(c.operator===nt.AND)return[]}return u},i=this._myIndex.records,n={},o=[];return i.forEach(({$:c,i:l})=>{if(y(c)){let h=s(e,c,l);h.length&&(n[l]||(n[l]={idx:l,item:c,matches:[]},o.push(n[l])),h.forEach(({matches:u})=>{n[l].matches.push(...u)}))}}),o}_searchObjectList(t){const e=St(t,this.options),{keys:s,records:i}=this._myIndex,n=[];return i.forEach(({$:o,i:c})=>{if(!y(o))return;let l=[];s.forEach((h,u)=>{l.push(...this._findMatches({key:h,value:o[u],searcher:e}))}),l.length&&n.push({idx:c,item:o,matches:l})}),n}_findMatches({key:t,value:e,searcher:s}){if(!y(e))return[];let i=[];if(b(e))e.forEach(({v:n,i:o,n:c})=>{if(!y(n))return;const{isMatch:l,score:h,indices:u}=s.searchIn(n);l&&i.push({score:h,key:t,value:n,idx:o,norm:c,indices:u})});else{const{v:n,n:o}=e,{isMatch:c,score:l,indices:h}=s.searchIn(n);c&&i.push({score:l,key:t,value:n,norm:o,indices:h})}return i}}W.version="6.6.2",W.createIndex=qt,W.parseIndex=De,W.config=f,W.parseQuery=oe,rs(is);const us=(r,t="highlight",e="title")=>{const s=(n,o,c)=>{const l=o.split(".");let h;for(h=0;h<l.length-1;h++)n=n[l[h]];n[l[h]]=c},i=(n,o=[])=>{let c="",l=0;return o.forEach(h=>{const u=h[1]+1;c+=[n.substring(l,h[0]),`<mark class="${t}">`,n.substring(h[0],u),"</mark>"].join(""),l=u}),c+=n.substring(l),c};return r.filter(({matches:n})=>n&&n.length).map(({item:n,matches:o})=>{const c={...n};return o.forEach(l=>{l.key===e&&s(c,l.key,i(l.value,l.indices))}),c})},ds=`
|
|
51
|
+
*/class vt extends Ie{constructor(t){if(super(t),this.et=_,t.type!==Re.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this.ft=void 0,this.et=t;if(t===P)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}vt.directiveName="unsafeHTML",vt.resultType=1;const Yt=Ce(vt);function M(r){return Array.isArray?Array.isArray(r):qt(r)==="[object Array]"}const Oe=1/0;function Le(r){if(typeof r=="string")return r;let t=r+"";return t=="0"&&1/r==-Oe?"-0":t}function ke(r){return r==null?"":Le(r)}function b(r){return typeof r=="string"}function Gt(r){return typeof r=="number"}function Ne(r){return r===!0||r===!1||Pe(r)&&qt(r)=="[object Boolean]"}function Jt(r){return typeof r=="object"}function Pe(r){return Jt(r)&&r!==null}function A(r){return r!=null}function yt(r){return!r.trim().length}function qt(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const ys="Extended search is not available",Te="Incorrect 'index' type",Ue=r=>`Invalid value for key ${r}`,He=r=>`Pattern length exceeds max of ${r}.`,Fe=r=>`Missing ${r} property in key`,je=r=>`Property 'weight' in key '${r}' must be a positive integer`,Qt=Object.prototype.hasOwnProperty;class ze{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(s=>{let i=Xt(s);e+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,e+=i.weight}),this._keys.forEach(s=>{s.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Xt(r){let t=null,e=null,s=null,i=1,n=null;if(b(r)||M(r))s=r,t=Zt(r),e=At(r);else{if(!Qt.call(r,"name"))throw new Error(Fe("name"));const o=r.name;if(s=o,Qt.call(r,"weight")&&(i=r.weight,i<=0))throw new Error(je(o));t=Zt(o),e=At(o),n=r.getFn}return{path:t,id:e,weight:i,src:s,getFn:n}}function Zt(r){return M(r)?r:r.split(".")}function At(r){return M(r)?r.join("."):r}function Be(r,t){let e=[],s=!1;const i=(n,o,c)=>{if(A(n))if(!o[c])e.push(n);else{let l=o[c];const h=n[l];if(!A(h))return;if(c===o.length-1&&(b(h)||Gt(h)||Ne(h)))e.push(ke(h));else if(M(h)){s=!0;for(let u=0,a=h.length;u<a;u+=1)i(h[u],o,c+1)}else o.length&&i(h,o,c+1)}};return i(r,b(t)?t.split("."):t,0),s?e:e[0]}var f={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,t)=>r.score===t.score?r.idx<t.idx?-1:1:r.score<t.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Be,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const De=/[^ ]+/g;function We(r=1,t=3){const e=new Map,s=Math.pow(10,t);return{get(i){const n=i.match(De).length;if(e.has(n))return e.get(n);const o=1/Math.pow(n,.5*r),c=parseFloat(Math.round(o*s)/s);return e.set(n,c),c},clear(){e.clear()}}}class Et{constructor({getFn:t=f.getFn,fieldNormWeight:e=f.fieldNormWeight}={}){this.norm=We(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,s)=>{this._keysMap[e.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,b(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();b(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!A(t)||yt(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach((i,n)=>{let o=i.getFn?i.getFn(t):this.getFn(t,i.path);if(A(o)){if(M(o)){let c=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:h,value:u}=l.pop();if(A(u))if(b(u)&&!yt(u)){let a={v:u,i:h,n:this.norm.get(u)};c.push(a)}else M(u)&&u.forEach((a,d)=>{l.push({nestedArrIndex:d,value:a})})}s.$[n]=c}else if(b(o)&&!yt(o)){let c={v:o,n:this.norm.get(o)};s.$[n]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function te(r,t,{getFn:e=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){const i=new Et({getFn:e,fieldNormWeight:s});return i.setKeys(r.map(Xt)),i.setSources(t),i.create(),i}function Ve(r,{getFn:t=f.getFn,fieldNormWeight:e=f.fieldNormWeight}={}){const{keys:s,records:i}=r,n=new Et({getFn:t,fieldNormWeight:e});return n.setKeys(s),n.setIndexRecords(i),n}function nt(r,{errors:t=0,currentLocation:e=0,expectedLocation:s=0,distance:i=f.distance,ignoreLocation:n=f.ignoreLocation}={}){const o=t/r.length;if(n)return o;const c=Math.abs(s-e);return i?o+c/i:c?1:o}function Ke(r=[],t=f.minMatchCharLength){let e=[],s=-1,i=-1,n=0;for(let o=r.length;n<o;n+=1){let c=r[n];c&&s===-1?s=n:!c&&s!==-1&&(i=n-1,i-s+1>=t&&e.push([s,i]),s=-1)}return r[n-1]&&n-s>=t&&e.push([s,n-1]),e}const U=32;function Ye(r,t,e,{location:s=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:h=f.ignoreLocation}={}){if(t.length>U)throw new Error(He(U));const u=t.length,a=r.length,d=Math.max(0,Math.min(s,a));let p=n,g=d;const v=c>1||l,F=v?Array(a):[];let R;for(;(R=r.indexOf(t,g))>-1;){let E=nt(t,{currentLocation:R,expectedLocation:d,distance:i,ignoreLocation:h});if(p=Math.min(E,p),g=R+u,v){let O=0;for(;O<u;)F[R+O]=1,O+=1}}g=-1;let V=[],j=1,lt=u+a;const ms=1<<u-1;for(let E=0;E<u;E+=1){let O=0,L=lt;for(;O<L;)nt(t,{errors:E,currentLocation:d+L,expectedLocation:d,distance:i,ignoreLocation:h})<=p?O=L:lt=L,L=Math.floor((lt-O)/2+O);lt=L;let he=Math.max(1,d-L+1),Ct=o?a:Math.min(d+L,a)+u,K=Array(Ct+2);K[Ct+1]=(1<<E)-1;for(let S=Ct;S>=he;S-=1){let ct=S-1,ae=e[r.charAt(ct)];if(v&&(F[ct]=+!!ae),K[S]=(K[S+1]<<1|1)&ae,E&&(K[S]|=(V[S+1]|V[S])<<1|1|V[S+1]),K[S]&ms&&(j=nt(t,{errors:E,currentLocation:ct,expectedLocation:d,distance:i,ignoreLocation:h}),j<=p)){if(p=j,g=ct,g<=d)break;he=Math.max(1,2*d-g)}}if(nt(t,{errors:E+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:h})>p)break;V=K}const Rt={isMatch:g>=0,score:Math.max(.001,j)};if(v){const E=Ke(F,c);E.length?l&&(Rt.indices=E):Rt.isMatch=!1}return Rt}function Ge(r){let t={};for(let e=0,s=r.length;e<s;e+=1){const i=r.charAt(e);t[i]=(t[i]||0)|1<<s-e-1}return t}class ee{constructor(t,{location:e=f.location,threshold:s=f.threshold,distance:i=f.distance,includeMatches:n=f.includeMatches,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,isCaseSensitive:l=f.isCaseSensitive,ignoreLocation:h=f.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:l,ignoreLocation:h},this.pattern=l?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const u=(d,p)=>{this.chunks.push({pattern:d,alphabet:Ge(d),startIndex:p})},a=this.pattern.length;if(a>U){let d=0;const p=a%U,g=a-p;for(;d<g;)u(this.pattern.substr(d,U),d),d+=U;if(p){const v=a-U;u(this.pattern.substr(v),v)}}else u(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let g={isMatch:!0,score:0};return s&&(g.indices=[[0,t.length-1]]),g}const{location:i,distance:n,threshold:o,findAllMatches:c,minMatchCharLength:l,ignoreLocation:h}=this.options;let u=[],a=0,d=!1;this.chunks.forEach(({pattern:g,alphabet:v,startIndex:F})=>{const{isMatch:R,score:V,indices:j}=Ye(t,g,v,{location:i+F,distance:n,threshold:o,findAllMatches:c,minMatchCharLength:l,includeMatches:s,ignoreLocation:h});R&&(d=!0),a+=V,R&&j&&(u=[...u,...j])});let p={isMatch:d,score:d?a/this.chunks.length:1};return d&&s&&(p.indices=u),p}}class I{constructor(t){this.pattern=t}static isMultiMatch(t){return se(t,this.multiRegex)}static isSingleMatch(t){return se(t,this.singleRegex)}search(){}}function se(r,t){const e=r.match(t);return e?e[1]:null}class Je extends I{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class qe extends I{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Qe extends I{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Xe extends I{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Ze extends I{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class ts extends I{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class ie extends I{constructor(t,{location:e=f.location,threshold:s=f.threshold,distance:i=f.distance,includeMatches:n=f.includeMatches,findAllMatches:o=f.findAllMatches,minMatchCharLength:c=f.minMatchCharLength,isCaseSensitive:l=f.isCaseSensitive,ignoreLocation:h=f.ignoreLocation}={}){super(t),this._bitapSearch=new ee(t,{location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:l,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class re extends I{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,s;const i=[],n=this.pattern.length;for(;(s=t.indexOf(this.pattern,e))>-1;)e=s+n,i.push([s,e-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const xt=[Je,re,Qe,Xe,ts,Ze,qe,ie],ne=xt.length,es=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ss="|";function is(r,t={}){return r.split(ss).map(e=>{let s=e.trim().split(es).filter(n=>n&&!!n.trim()),i=[];for(let n=0,o=s.length;n<o;n+=1){const c=s[n];let l=!1,h=-1;for(;!l&&++h<ne;){const u=xt[h];let a=u.isMultiMatch(c);a&&(i.push(new u(a,t)),l=!0)}if(!l)for(h=-1;++h<ne;){const u=xt[h];let a=u.isSingleMatch(c);if(a){i.push(new u(a,t));break}}}return i})}const rs=new Set([ie.type,re.type]);class ns{constructor(t,{isCaseSensitive:e=f.isCaseSensitive,includeMatches:s=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:o=f.findAllMatches,location:c=f.location,threshold:l=f.threshold,distance:h=f.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:i,findAllMatches:o,ignoreLocation:n,location:c,threshold:l,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=is(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:i}=this.options;t=i?t:t.toLowerCase();let n=0,o=[],c=0;for(let l=0,h=e.length;l<h;l+=1){const u=e[l];o.length=0,n=0;for(let a=0,d=u.length;a<d;a+=1){const p=u[a],{isMatch:g,indices:v,score:F}=p.search(t);if(g){if(n+=1,c+=F,s){const R=p.constructor.type;rs.has(R)?o=[...o,...v]:o.push(v)}}else{c=0,n=0,o.length=0;break}}if(n){let a={isMatch:!0,score:c/n};return s&&(a.indices=o),a}}return{isMatch:!1,score:1}}}const St=[];function os(...r){St.push(...r)}function bt(r,t){for(let e=0,s=St.length;e<s;e+=1){let i=St[e];if(i.condition(r,t))return new i(r,t)}return new ee(r,t)}const ot={AND:"$and",OR:"$or"},wt={PATH:"$path",PATTERN:"$val"},Mt=r=>!!(r[ot.AND]||r[ot.OR]),ls=r=>!!r[wt.PATH],cs=r=>!M(r)&&Jt(r)&&!Mt(r),oe=r=>({[ot.AND]:Object.keys(r).map(t=>({[t]:r[t]}))});function le(r,t,{auto:e=!0}={}){const s=i=>{let n=Object.keys(i);const o=ls(i);if(!o&&n.length>1&&!Mt(i))return s(oe(i));if(cs(i)){const l=o?i[wt.PATH]:n[0],h=o?i[wt.PATTERN]:i[l];if(!b(h))throw new Error(Ue(l));const u={keyId:At(l),pattern:h};return e&&(u.searcher=bt(h,t)),u}let c={children:[],operator:n[0]};return n.forEach(l=>{const h=i[l];M(h)&&h.forEach(u=>{c.children.push(s(u))})}),c};return Mt(r)||(r=oe(r)),s(r)}function hs(r,{ignoreFieldNorm:t=f.ignoreFieldNorm}){r.forEach(e=>{let s=1;e.matches.forEach(({key:i,norm:n,score:o})=>{const c=i?i.weight:null;s*=Math.pow(o===0&&c?Number.EPSILON:o,(c||1)*(t?1:n))}),e.score=s})}function as(r,t){const e=r.matches;t.matches=[],A(e)&&e.forEach(s=>{if(!A(s.indices)||!s.indices.length)return;const{indices:i,value:n}=s;let o={indices:i,value:n};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),t.matches.push(o)})}function us(r,t){t.score=r.score}function ds(r,t,{includeMatches:e=f.includeMatches,includeScore:s=f.includeScore}={}){const i=[];return e&&i.push(as),s&&i.push(us),r.map(n=>{const{idx:o}=n,c={item:t[o],refIndex:o};return i.length&&i.forEach(l=>{l(n,c)}),c})}class W{constructor(t,e={},s){this.options={...f,...e},this.options.useExtendedSearch,this._keyStore=new ze(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof Et))throw new Error(Te);this._myIndex=e||te(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){A(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let s=0,i=this._docs.length;s<i;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,i-=1,e.push(n))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:i,shouldSort:n,sortFn:o,ignoreFieldNorm:c}=this.options;let l=b(t)?b(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return hs(l,{ignoreFieldNorm:c}),n&&l.sort(o),Gt(e)&&e>-1&&(l=l.slice(0,e)),ds(l,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(t){const e=bt(t,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:n,i:o,n:c})=>{if(!A(n))return;const{isMatch:l,score:h,indices:u}=e.searchIn(n);l&&i.push({item:n,idx:o,matches:[{score:h,value:n,norm:c,indices:u}]})}),i}_searchLogical(t){const e=le(t,this.options),s=(c,l,h)=>{if(!c.children){const{keyId:a,searcher:d}=c,p=this._findMatches({key:this._keyStore.get(a),value:this._myIndex.getValueForItemAtKeyId(l,a),searcher:d});return p&&p.length?[{idx:h,item:l,matches:p}]:[]}const u=[];for(let a=0,d=c.children.length;a<d;a+=1){const p=c.children[a],g=s(p,l,h);if(g.length)u.push(...g);else if(c.operator===ot.AND)return[]}return u},i=this._myIndex.records,n={},o=[];return i.forEach(({$:c,i:l})=>{if(A(c)){let h=s(e,c,l);h.length&&(n[l]||(n[l]={idx:l,item:c,matches:[]},o.push(n[l])),h.forEach(({matches:u})=>{n[l].matches.push(...u)}))}}),o}_searchObjectList(t){const e=bt(t,this.options),{keys:s,records:i}=this._myIndex,n=[];return i.forEach(({$:o,i:c})=>{if(!A(o))return;let l=[];s.forEach((h,u)=>{l.push(...this._findMatches({key:h,value:o[u],searcher:e}))}),l.length&&n.push({idx:c,item:o,matches:l})}),n}_findMatches({key:t,value:e,searcher:s}){if(!A(e))return[];let i=[];if(M(e))e.forEach(({v:n,i:o,n:c})=>{if(!A(n))return;const{isMatch:l,score:h,indices:u}=s.searchIn(n);l&&i.push({score:h,key:t,value:n,idx:o,norm:c,indices:u})});else{const{v:n,n:o}=e,{isMatch:c,score:l,indices:h}=s.searchIn(n);c&&i.push({score:l,key:t,value:n,norm:o,indices:h})}return i}}W.version="6.6.2",W.createIndex=te,W.parseIndex=Ve,W.config=f,W.parseQuery=le,os(ns);const fs=(r,t="highlight",e="title")=>{const s=(n,o,c)=>{const l=o.split(".");let h;for(h=0;h<l.length-1;h++)n=n[l[h]];n[l[h]]=c},i=(n,o=[])=>{let c="",l=0;return o.forEach(h=>{const u=h[1]+1;c+=[n.substring(l,h[0]),`<mark class="${t}">`,n.substring(h[0],u),"</mark>"].join(""),l=u}),c+=n.substring(l),c};return r.filter(({matches:n})=>n&&n.length).map(({item:n,matches:o})=>{const c={...n};return o.forEach(l=>{l.key===e&&s(c,l.key,i(l.value,l.indices))}),c})},ps=`
|
|
48
52
|
:host {
|
|
49
53
|
display: flex;
|
|
50
54
|
box-sizing: border-box;
|
|
@@ -154,118 +158,138 @@ ul#results {
|
|
|
154
158
|
ul#results li {
|
|
155
159
|
padding-left: 0.5rem;
|
|
156
160
|
}
|
|
161
|
+
#filter-reset {
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
}
|
|
157
164
|
.scroll {
|
|
158
165
|
height: 100%;
|
|
159
166
|
overflow-x: hidden;
|
|
160
167
|
overflow-y: auto;
|
|
161
168
|
}
|
|
162
|
-
`;var
|
|
169
|
+
`;var gs=Object.defineProperty,_s=Object.getOwnPropertyDescriptor,H=(r,t,e,s)=>{for(var i=s>1?void 0:s?_s(t,e):t,n=r.length-1,o;n>=0;n--)(o=r[n])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&gs(t,e,i),i};class ce{constructor(){$(this,"aggregateResults");$(this,"enableHighlighting",!1);$(this,"enableSearch",!1);$(this,"showResults",!0);$(this,"exclusiveFilters",!1);$(this,"filterProperties",[]);$(this,"fuseConfig",{keys:["title"]});$(this,"matchAllWhenEmpty",!0);$(this,"onSearch",()=>{});$(this,"onSelect",()=>{});$(this,"titleProperty","title")}}m.EOxItemFilter=class extends X{constructor(){super(...arguments);$(this,"_fuse");$(this,"_resultAggregation",[]);$(this,"_items",[]);$(this,"_results",[]);$(this,"_filters",{});$(this,"_selectedResult");$(this,"_config",new ce);$(this,"apply",e=>{this._items=e.map((s,i)=>({...s,id:`item-${i}`})),this._fuse=new W(this._items,{minMatchCharLength:3,threshold:.4,distance:50,includeMatches:!0,useExtendedSearch:!0,...this._config.fuseConfig}),this._config.filterProperties.length&&this._config.filterProperties.forEach(s=>{const i={};this._items.forEach(n=>{Array.isArray(n[s])?n[s].forEach(o=>{i[o]=void 0}):i[n[s]]=void 0}),this._filters[s]=i}),this._config.matchAllWhenEmpty!==!1&&(this._results=this.sortResults(this._items),this.requestUpdate()),this._config.aggregateResults&&(this._resultAggregation=[...new Set(this._items.reduce((s,i)=>s.concat(i[this._config.aggregateResults]),[]))].sort())})}set config(e){const s=this._config;this._config={...new ce,...e},this.requestUpdate("config",s)}get config(){return this._config}search(e="",s=this._filters){const i=Object.entries(s).reduce((o,[c,l])=>{const h=u=>{const a={};a[c]=`="${u}"`,o.push(a)};return Object.entries(l).filter(([u,a])=>a).forEach(([u,a])=>h(u)),o},[]);let n;if(!(e.length>2)&&!i.length&&this._config.matchAllWhenEmpty!==!1)n=this._items;else{const o={...e.length>2&&i.length?{$and:[{$or:[...this._config.fuseConfig.keys.map(l=>({[l]:e}))]},{$or:i}]}:{$or:[...this._config.fuseConfig.keys.map(l=>({[l]:e})),{$or:i}]}},c=this._fuse.search(o);n=this._config.enableHighlighting?fs(c,"highlight",this._config.titleProperty):c.map(l=>l.item)}this._results=this.sortResults(n),this._config.onSearch(n),this.requestUpdate()}aggregateResults(e,s){return e.filter(i=>{const n=i[this._config.aggregateResults],o=Object.keys(this._filters[this._config.aggregateResults]).filter(l=>this._filters[this._config.aggregateResults][l]);return(o.length?o.includes(s):!0)&&Array.isArray(n)?n.includes(s):n===s})}sortResults(e){return[...e].sort((s,i)=>s[this._config.titleProperty]<i[this._config.titleProperty]?-1:1)}toggleFilter(e,s){this._config.exclusiveFilters===!0&&Object.keys(this._filters).forEach(o=>{Object.keys(this._filters[o]).forEach(c=>{this._filters[o][c]=!1})}),this._filters[e][s]=!this._filters[e][s];const i=this.renderRoot.querySelector('input[type="text"]');i?this.search(i.value):this.search();const n=this.renderRoot.querySelectorAll("ul#results input[type='radio']");for(let o=0;o<n.length;o++)n[o].checked=!1;this._selectedResult&&setTimeout(()=>{const o=this.renderRoot.querySelector(`#${this._selectedResult.id}`);o&&(o.checked=!0,this.requestUpdate())})}resetFilters(){this.renderRoot.querySelectorAll("#details-filter input").forEach(s=>{s.checked=!1});const e=this.renderRoot.querySelector('input[type="text"]');e&&(e.value=""),Object.keys(this._filters).forEach(s=>{Object.keys(this._filters[s]).forEach(i=>{this._filters[s][i]=!1})}),this.search(),this.requestUpdate()}render(){return x`
|
|
163
170
|
<style>
|
|
164
|
-
${
|
|
171
|
+
${ps}
|
|
165
172
|
</style>
|
|
166
173
|
<form>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
174
|
+
${rt(this._config.enableSearch,()=>x`
|
|
175
|
+
<section>
|
|
176
|
+
<input
|
|
177
|
+
type="text"
|
|
178
|
+
placeholder="Search"
|
|
179
|
+
data-cy="search"
|
|
180
|
+
@input="${e=>this.search(e.target.value)}"
|
|
181
|
+
/>
|
|
182
|
+
</section>
|
|
183
|
+
`)}
|
|
184
|
+
${rt(this._config.filterProperties.length,()=>x`
|
|
185
|
+
<section>
|
|
186
|
+
<slot name="filterstitle"></slot>
|
|
187
|
+
<ul id="filters">
|
|
188
|
+
${Z(this._config.filterProperties,e=>x`
|
|
189
|
+
<details
|
|
190
|
+
id="details-filter"
|
|
191
|
+
data-filter="${e}"
|
|
192
|
+
@click=${()=>this.renderRoot.querySelectorAll("details#details-filter").forEach(s=>{s.getAttribute("data-filter")!==e&&(s.removeAttribute("open"),this.requestUpdate())})}
|
|
193
|
+
>
|
|
194
|
+
<summary>
|
|
195
|
+
<small>
|
|
196
|
+
<strong class="title"> ${e} </strong>
|
|
197
|
+
</small>
|
|
198
|
+
<div>
|
|
199
|
+
<svg
|
|
200
|
+
data-cy="expand-button"
|
|
201
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
202
|
+
viewBox="0 0 24 24"
|
|
203
|
+
>
|
|
204
|
+
<title>chevron-down</title>
|
|
205
|
+
<path
|
|
206
|
+
d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
207
|
+
/>
|
|
208
|
+
</svg>
|
|
209
|
+
</div>
|
|
210
|
+
</summary>
|
|
211
|
+
<div class="scroll" style="max-height: 150px">
|
|
212
|
+
<ul>
|
|
213
|
+
${this._filters[e]?Z(Object.keys(this._filters[e]).sort(),s=>x`
|
|
214
|
+
<li>
|
|
215
|
+
<label>
|
|
216
|
+
<input
|
|
217
|
+
name="selection"
|
|
218
|
+
type="${this._config.exclusiveFilters===!0?"radio":"checkbox"}"
|
|
219
|
+
checked="${this._filters[e][s]||_}"
|
|
220
|
+
@click=${()=>this.toggleFilter(e,s)}
|
|
221
|
+
/>
|
|
222
|
+
<span class="title">${s}</span>
|
|
223
|
+
</label>
|
|
224
|
+
</li>
|
|
225
|
+
`):null}
|
|
226
|
+
</ul>
|
|
227
|
+
</div>
|
|
228
|
+
</details>
|
|
229
|
+
`)}
|
|
230
|
+
</ul>
|
|
231
|
+
${rt(this._config.filterProperties,()=>x`
|
|
232
|
+
<a
|
|
233
|
+
id="filter-reset"
|
|
234
|
+
data-cy="filter-reset"
|
|
235
|
+
@click=${()=>this.resetFilters()}
|
|
236
|
+
><small>Reset filters</small></a
|
|
237
|
+
>
|
|
238
|
+
`)}
|
|
239
|
+
</section>
|
|
240
|
+
`)}
|
|
241
|
+
${rt(this.config.showResults,()=>x`
|
|
242
|
+
<section id="section-results">
|
|
243
|
+
<div>
|
|
244
|
+
<slot name="resultstitle"></slot>
|
|
245
|
+
</div>
|
|
246
|
+
<div id="container-results" class="scroll">
|
|
247
|
+
${this._results.length<1?x` <small class="no-results">No matching items</small> `:_}
|
|
248
|
+
<ul id="results">
|
|
249
|
+
${this._config.aggregateResults?Z(this._resultAggregation.filter(e=>this.aggregateResults(this._results,e).length),e=>x`<details
|
|
250
|
+
id="details-results"
|
|
251
|
+
open
|
|
252
|
+
>
|
|
253
|
+
<summary>
|
|
254
|
+
<svg
|
|
255
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
256
|
+
viewBox="0 0 24 24"
|
|
257
|
+
>
|
|
258
|
+
<title>chevron-down</title>
|
|
259
|
+
<path
|
|
260
|
+
d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
261
|
+
/>
|
|
262
|
+
</svg>
|
|
263
|
+
<strong class="title">
|
|
264
|
+
${e}
|
|
265
|
+
</strong>
|
|
266
|
+
<span style="margin-left: 0.25rem"
|
|
267
|
+
>(${this.aggregateResults(this._results,e).length})</span
|
|
268
|
+
>
|
|
269
|
+
</summary>
|
|
270
|
+
<ul>
|
|
271
|
+
${Z(this.aggregateResults(this._results,e),s=>x`
|
|
203
272
|
<li>
|
|
204
273
|
<label>
|
|
205
274
|
<input
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
@click=${()=>this.
|
|
275
|
+
type="radio"
|
|
276
|
+
name="result"
|
|
277
|
+
id="${s.id}"
|
|
278
|
+
@click=${()=>{this._selectedResult=s,this._config.onSelect(s)}}
|
|
210
279
|
/>
|
|
211
|
-
<span class="title"
|
|
280
|
+
<span class="title"
|
|
281
|
+
>${Yt(s[this._config.titleProperty])}</span
|
|
282
|
+
>
|
|
212
283
|
</label>
|
|
213
284
|
</li>
|
|
214
|
-
`)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<slot name="resultstitle"></slot>
|
|
224
|
-
</div>
|
|
225
|
-
<div id="container-results" class="scroll">
|
|
226
|
-
${this._results.length<1?T` <small class="no-results">No matching items</small> `:m}
|
|
227
|
-
<ul id="results">
|
|
228
|
-
${this.config.aggregateResults?q(this._resultAggregation.filter(e=>this.aggregateResults(this._results,e).length),e=>T`<details
|
|
229
|
-
id="details-results"
|
|
230
|
-
open
|
|
231
|
-
>
|
|
232
|
-
<summary>
|
|
233
|
-
<svg
|
|
234
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
235
|
-
viewBox="0 0 24 24"
|
|
236
|
-
>
|
|
237
|
-
<title>chevron-down</title>
|
|
238
|
-
<path
|
|
239
|
-
d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
240
|
-
/>
|
|
241
|
-
</svg>
|
|
242
|
-
<strong class="title"> ${e} </strong>
|
|
243
|
-
<span style="margin-left: 0.25rem"
|
|
244
|
-
>(${this.aggregateResults(this._results,e).length})</span
|
|
245
|
-
>
|
|
246
|
-
</summary>
|
|
247
|
-
<ul>
|
|
248
|
-
${q(this.aggregateResults(this._results,e),s=>T`
|
|
249
|
-
<li>
|
|
250
|
-
<label>
|
|
251
|
-
<input
|
|
252
|
-
type="radio"
|
|
253
|
-
name="result"
|
|
254
|
-
id="${s.id}"
|
|
255
|
-
@click=${()=>{this._selectedResult=s,this.config.onSelect(s)}}
|
|
256
|
-
/>
|
|
257
|
-
<span class="title"
|
|
258
|
-
>${Vt(s[this.config.titleProperty])}</span
|
|
259
|
-
>
|
|
260
|
-
</label>
|
|
261
|
-
</li>
|
|
262
|
-
`)}
|
|
263
|
-
</ul>
|
|
264
|
-
</details>`):q(this._results,e=>T`<li>
|
|
265
|
-
${Vt(e[this.config.titleProperty])}
|
|
266
|
-
</li>`)}
|
|
267
|
-
</ul>
|
|
268
|
-
</div>
|
|
269
|
-
</section>
|
|
285
|
+
`)}
|
|
286
|
+
</ul>
|
|
287
|
+
</details>`):Z(this._results,e=>x`<li>
|
|
288
|
+
${Yt(e[this._config.titleProperty])}
|
|
289
|
+
</li>`)}
|
|
290
|
+
</ul>
|
|
291
|
+
</div>
|
|
292
|
+
</section>
|
|
293
|
+
`)}
|
|
270
294
|
</form>
|
|
271
|
-
`}},H([it()],
|
|
295
|
+
`}},H([it()],m.EOxItemFilter.prototype,"_items",2),H([it()],m.EOxItemFilter.prototype,"_results",2),H([it()],m.EOxItemFilter.prototype,"_filters",2),H([it()],m.EOxItemFilter.prototype,"_selectedResult",2),H([mt({attribute:!1})],m.EOxItemFilter.prototype,"config",1),H([mt()],m.EOxItemFilter.prototype,"apply",2),m.EOxItemFilter=H([we("eox-itemfilter")],m.EOxItemFilter),Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eox/itemfilter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@eox/eslint-config": "^1.0.0",
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"start": "vite",
|
|
24
24
|
"build": "tsc && vite build",
|
|
25
|
-
"watch": "tsc && vite build --watch"
|
|
25
|
+
"watch": "tsc && vite build --watch",
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"lint": "eslint --ext .js,.ts .",
|
|
28
|
+
"lint:fix": "eslint --ext .js,.ts . --fix"
|
|
26
29
|
},
|
|
27
30
|
"dependencies": {
|
|
28
31
|
"fuse.js": "^6.6.2",
|