@eox/itemfilter 0.8.4 → 0.8.6

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.
@@ -60,7 +60,7 @@
60
60
  * @license
61
61
  * Copyright 2020 Google LLC
62
62
  * SPDX-License-Identifier: BSD-3-Clause
63
- */const qi=Symbol.for(""),Ss=r=>{if((r==null?void 0:r.r)===qi)return r==null?void 0:r._$litStatic$},Nt=r=>({_$litStatic$:r,r:qi}),Gi=new Map,Ps=r=>(e,...t)=>{const i=t.length;let n,s;const o=[],l=[];let a,u=0,p=!1;for(;u<i;){for(a=e[u];u<i&&(s=t[u],(n=Ss(s))!==void 0);)a+=n+e[++u],p=!0;u!==i&&l.push(s),o.push(a),u++}if(u===i&&o.push(e[i]),p){const v=o.join("$$lit$$");(e=Gi.get(v))===void 0&&(o.raw=o,Gi.set(v,e=o)),t=l}return r(e,...t)},xr=Ps(he);(()=>{var r=Object.defineProperty,e=Math.pow,t=(c,d,b)=>d in c?r(c,d,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[d]=b,i=(c,d,b)=>(t(c,typeof d!="symbol"?d+"":d,b),b),n=(c,d)=>` ${d&&d.length>0?d.map(b=>`<link rel="stylesheet" href="${b}" />`).join(""):""} <style> ${c} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`,s=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",o="pointers-overlap",l="pointers-min-distance",a="pointers-max-distance",u="range-dragging",p="data",v="min",y="max",x="step",M="round",j="type",q="theme",J="rtl",f="btt",g="disabled",$="keyboard-disabled",S="mousewheel-disabled",E="slider-width",A="slider-height",C="slider-radius",L="slider-bg",I="slider-bg-hover",W="slider-bg-fill",re="pointer-width",k="pointer-height",_="pointer-radius",O="pointer-bg",B="pointer-bg-hover",P="pointer-bg-focus",H="pointer-shadow",V="pointer-shadow-hover",ee="pointer-shadow-focus",le="pointer-border",Z="pointer-border-hover",ve="pointer-border-focus",De="animate-onclick",Ie="css-links",be="vertical",Le="horizontal",He=(c,d,b,m,T)=>{let U=d-c;return U===0?b:(m-b)*(T-c)/U+b},ue=c=>!isNaN(parseFloat(c))&&isFinite(c),oe=(c,d)=>ue(c)?Number(c):d,bt=(c,d)=>d===0?0:Math.round(c/d)*d,xt=(c,d=1/0)=>{if(d===1/0)return c;let b=e(10,d);return Math.round(c*b)/b},xe=c=>c==null?!1:typeof c=="boolean"?c:c.trim().toLowerCase()==="true",rl=(c,d)=>{c.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:d}}))},il=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:d}}))},nl=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:d}}))},sl=(c,d)=>{c.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:d}}))},ol=(c,d)=>{if(!d||d.length<=0)return;let b=d.map(T=>ue(T)?oe(T,T):T),m={values:b||[]};m.value=b[0],m.value0=b[0],m.value1=b[0];for(let T=1;T<b.length;T++)m[`value${T+1}`]=b[T];c.dispatchEvent(new CustomEvent("change",{detail:m}))},Kr=(c,d,b)=>{let m=0,T,U,G,R,D=!1,K=(z,ce,me,ge,de,fe)=>{let _e=m;me!==void 0&&z>me&&(z=me),ce!==void 0&&z<ce&&(z=ce),m=z;let Ee=m;return(ge===be&&fe||ge===Le&&de)&&(Ee=100-Ee),ge===be?d.style.top=`${Ee}%`:d.style.left=`${Ee}%`,_e!==m},te=z=>z===d||d.contains(z),F=(z,ce,me,ge)=>{T=z,U=ce,G=me,R=ge},se=z=>{D=z,d.classList.toggle("disabled",D),D?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},Te=(z,ce)=>{ce==null?d.removeAttribute(z):d.setAttribute(z,ce)},we=z=>d.getAttribute(z),Y=z=>{if(!D){switch(z.key){case"ArrowLeft":{z.preventDefault(),typeof T=="function"&&T(b);break}case"ArrowRight":{z.preventDefault(),typeof U=="function"&&U(b);break}case"ArrowUp":{z.preventDefault(),typeof G=="function"&&G(b);break}case"ArrowDown":{z.preventDefault(),typeof R=="function"&&R(b);break}}sl(c,z)}},Q=()=>{D||rl(c,d)};return d.className=`pointer pointer-${b}`,d.addEventListener("keydown",Y),d.addEventListener("click",Q),{$pointer:d,get percent(){return m},get disabled(){return D},set disabled(z){se(z)},updatePosition:K,isClicked:te,setCallbacks:F,setAttr:Te,getAttr:we,destroy:()=>{d.removeEventListener("keydown",Y),d.removeEventListener("click",Q),d.remove()}}},al=c=>{if(c==null)return;if(Array.isArray(c))return c;if(c.trim()==="")return;let d=c.split(","),b=[],m=!0;for(let T=0;T<d.length;T++){let U=d[T].trim();U!==""&&(b.push(U),ue(U)||(m=!1))}return m?b.map(T=>Number(T)):b},ll=(c,d)=>d?d.findIndex(b=>b===c||b.toString().trim()===c.toString().trim()):-1,cl=c=>({updatePosition:(d,b,m,T)=>{if(b.length<=0)return;let U=b.length===1,G=b[0],R=b[b.length-1];d===be?(c.style.removeProperty("width"),c.style.removeProperty("right"),c.style.removeProperty("left"),U?c.style.height=`${G}%`:c.style.height=`${Math.abs(G-R)}%`,T?(c.style.bottom="0%",U?c.style.top="auto":c.style.top=`${Math.min(100-R,100-G)}%`):(c.style.bottom="auto",U?c.style.top="0%":c.style.top=`${Math.min(G,R)}%`)):(c.style.removeProperty("height"),c.style.removeProperty("top"),c.style.removeProperty("bottom"),U?c.style.width=`${G}%`:c.style.width=`${Math.abs(G-R)}%`,m?(c.style.right="0%",U?c.style.left="auto":c.style.left=`${Math.min(100-R,100-G)}%`):(c.style.right="auto",U?c.style.left="0%":c.style.left=`${Math.min(G,R)}%`))}}),Yn="--animate-onclick",ul="--width",hl="--height",dl="--panel-bg-border-radius",fl="--panel-bg",pl="--panel-bg-hover",gl="--panel-bg-fill",vl="--pointer-width",ml="--pointer-height",yl="--pointer-border-radius",bl="--pointer-bg",xl="--pointer-bg-hover",$l="--pointer-bg-focus",wl="--pointer-shadow",_l="--pointer-shadow-hover",El="--pointer-shadow-focus",Ml="--pointer-border",Al="--pointer-border-hover",Ol="--pointer-border-focus",Wt=(c,d,b)=>{let m=new Map;for(let T of c.attributes){let U=T.nodeName.trim().toLowerCase();if(!d.test(U))continue;let G=U.replace(/\D/g,"").trim(),R=G===""||G==="0"||G==="1"?0:oe(G,0)-1,D=b&&typeof b=="function"?b(T.value):T.value;m.set(R,D)}return m},Sl=c=>{if(!c)return null;let d=c.getAttribute(Ie);if(!d)return null;let b=d.split(";"),m=[];for(let T of b)T.trim()!==""&&m.push(T.trim());return m},zn=[[ul,E,"sliderWidth",null],[hl,A,"sliderHeight",null],[dl,C,"sliderRadius",null],[fl,L,"sliderBg",null],[pl,I,"sliderBgHover",null],[gl,W,"sliderBgFill",null],[vl,re,"pointer#Width",/^pointer([0-9]*)-width$/],[ml,k,"pointer#Height",/^pointer([0-9]*)-height$/],[yl,_,"pointer#Radius",/^pointer([0-9]*)-radius$/],[bl,O,"pointer#Bg",/^pointer([0-9]*)-bg$/],[xl,B,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[$l,P,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[wl,H,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[_l,V,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[El,ee,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[Ml,le,"pointer#Border",/^pointer([0-9]*)-border$/],[Al,Z,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[Ol,ve,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],Pl=(c,d,b)=>{let m=null,T=[],U=new Map,G=(Y,Q=d)=>{let z=[...Q.classList];for(let ce of z)ce.startsWith(Y)&&d.classList.remove(ce)},R=()=>{G("shape");let Y=d.querySelectorAll(".pointer");for(let Q of Y)G("shape",Q)},D=Y=>{m=Y,G("theme-"),typeof Y=="string"&&d.classList.add(`theme-${Y}`)},K=()=>{if(R(),!(T.length<=0)){d.classList.add("shape",`shape-${T[0]}`);for(let Y=1;Y<T.length;Y++){let Q=T[Y];if(!Q)continue;let z=d.querySelector(`.pointer-${Y}`);!z||z.classList.add("shape",`shape-${Q}`)}}},te=(Y,Q)=>{T[Y]=Q,K()},F=()=>{R();let Y=Wt(c,/^pointer([0-9]*)-shape$/);if(!(Y.size<=0)){for(let Q of Y){let z=Q[0];T[z]=Q[1]}K()}},se=(Y,Q)=>`${Y}-${Q}`,Te=(Y,Q,z)=>{let ce=b[z];if(!ce)return;let me=z===0?d:ce.$pointer;if(Q==null){U.has(se(Y,z))&&U.delete(se(Y,z)),me.style.removeProperty(Y);return}U.set(se(Y,z),Q),me.style.setProperty(Y,Q)},we=(Y,Q)=>U.get(se(Y,Q));return(()=>{for(let Y of zn){let[Q,z,ce,me]=Y;if(me){let de=Wt(c,me);for(let fe of de){let _e=fe[0],Ee=fe[1];Te(Q,Ee,_e)}}else{let de=c.getAttribute(z);Te(Q,de,0)}let ge=[];if(ce.indexOf("#")===-1)ge.push([ce,0]);else{ge.push([ce.replace("#",""),0]),ge.push([ce.replace("#","0"),0]),ge.push([ce.replace("#","1"),0]);for(let de=1;de<b.length;de++)ge.push([ce.replace("#",(de+1).toString()),de])}for(let de of ge)try{let fe=de[0],_e=de[1];Object.prototype.hasOwnProperty.call(c,fe)||Object.defineProperty(c,fe,{get(){return we(Q,_e)},set:Ee=>{Te(Q,Ee,_e)}})}catch(fe){console.error(fe)}}D(c.getAttribute(q)),F()})(),{setStyle:Te,getStyle:we,get theme(){return m},set theme(Y){D(Y)},get pointerShapes(){return T},setPointerShape:te}},$t="animate-on-click",Xn="range-dragging",Cl=(c,d,b,m)=>{let T=[],U=te=>{for(let F of T)F.update&&typeof F.update=="function"&&F.update(te)},G=()=>{for(let te of T)te.destroy&&typeof te.destroy=="function"&&te.destroy()},R=(te,F)=>{for(let se of T)se.onAttrChange&&typeof se.onAttrChange=="function"&&se.onAttrChange(te,F)},D=te=>{if(te.gettersAndSetters){for(let F of te.gettersAndSetters)if(!(!F.name||!F.attributes))try{Object.prototype.hasOwnProperty.call(c,F.name)||Object.defineProperty(c,F.name,F.attributes)}catch(se){console.error("defineSettersGetters error:",se)}}},K=te=>{var F;if(!te.css)return;let se=(F=c.shadowRoot)==null?void 0:F.querySelector("style");!se||(se.innerHTML+=te.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let te of window.tcRangeSliderPlugins){let F=te();T.push(F),F.init&&typeof F.init=="function"&&(F.init(c,d,b,m),D(F),K(F))}},update:U,onAttrChange:R,destroy:G}},kl=10,Ll=(c,d)=>{let b=new Map,m=/^value([0-9]*)$/;for(let R of c.attributes){let D=R.nodeName.trim().toLowerCase();if(!m.test(D))continue;let K=D.replace("value","").trim(),te=K===""||K==="0"||K==="1"?0:oe(K,0)-1,F=ue(R.value)?oe(R.value,0):R.value;b.set(te,F)}let T=Math.max(...Array.from(b.keys())),U=[];U.push([Kr(c,d,0),b.get(0)]);let G=d;for(let R=1;R<=T;R++){let D=d.cloneNode(!0);G.after(D),G=D,U.push([Kr(c,D,R),b.get(R)])}return U},Vn=(c,d,b,m,T,U,G)=>{try{Object.defineProperty(c,m,{configurable:!0,get(){if(!d)return;let R=d.pointers[b];if(!R)return;let D=d.getTextValue(R.percent);return ue(D)?oe(D,D):D},set:R=>{d.pointers[b]?d==null||d.setValue(R,b):d==null||d.addPointer(R)}}),Object.defineProperty(c,T,{configurable:!0,get(){var R,D;return(D=(R=d==null?void 0:d.pointers[b])==null?void 0:R.getAttr("aria-label"))!=null?D:void 0},set:R=>{!d||d.setAriaLabel(b,R)}}),Object.defineProperty(c,U,{configurable:!0,get(){var R,D;return(D=(R=d==null?void 0:d.styles)==null?void 0:R.pointerShapes[b])!=null?D:null},set:R=>{!d||!d.styles||d.styles.setPointerShape(b,R)}}),Object.defineProperty(c,G,{configurable:!0,get(){var R;return(R=d==null?void 0:d.pointers[b].disabled)!=null?R:!1},set:R=>{if(!d)return;let D=d==null?void 0:d.pointers[b];!D||(D.disabled=R)}})}catch(R){console.error(R)}},Tl=(c,d)=>{let b=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let m=2;m<kl;m++)b.push([`value${m}`,`ariaLabel${m}`,`pointer${m}Shape`,`pointer${m}Disabled`,m-1]);for(let m of b)Vn(c,d,m[4],m[0],m[1],m[2],m[3])},Wn=(c,d,b)=>{var m;let T=(m=b.shadowRoot)==null?void 0:m.querySelector(".container");if(T)for(let U of c)d?T.prepend(U.$pointer):T.append(U.$pointer)},Jr=0,Lt=100,wt=2,qn="0.3s",Rl=(c,d,b)=>{let m=b.map(h=>h[0]),T=null,U=null,G=null,R=null,D=Jr,K=Lt,te,F,se=Le,Te=wt,we=!1,Y=!1,Q=!1,z=0,ce=1/0,me=!1,ge,de,fe=!1,_e=!1,Ee=!1,Ze=qn,Gn=[],Kn=h=>{fe||(h.preventDefault&&h.preventDefault(),ot(h),window.addEventListener("mousemove",ot),window.addEventListener("mouseup",qt),il(c,h))},qt=h=>{fe||(ge=void 0,de=void 0,window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",qt),Ze&&d.classList.add($t),nl(c,h))},jl=(h,w)=>{if(m.length<=0)return;if(m.length===1)return m[0].isClicked(h)&&Ze&&d.classList.remove($t),m[0];let N=Bl(h);if(me){let ie=w,je=Kt(ie);je!==void 0&&(ie=bt(ie,je)),N?(ge=ie,de=0,Ze&&d.classList.remove($t)):ge!==void 0&&(de=ie-ge,ge=ie)}if(!Nl(h)&&!N){for(let ie of m)if(!(!ie.isClicked(h)||ie.disabled))return Ze&&d.classList.remove($t),ie;for(let ie of m)if(T===ie)return ie}let ae=1/0,pe=null;for(let ie of m){if(ie.disabled)continue;let je=Math.abs(w-ie.percent);je<ae&&(ae=je,pe=ie)}return pe},Jn=()=>m.findIndex(h=>T===h&&!h.disabled),ot=h=>{let w;if(se===be){let{height:ae,top:pe}=d.getBoundingClientRect(),ie=h.type.indexOf("mouse")!==-1?h.clientY:h.touches[0].clientY;w=Math.min(Math.max(0,ie-pe),ae)*100/ae}else{let{width:ae,left:pe}=d.getBoundingClientRect(),ie=h.type.indexOf("mouse")!==-1?h.clientX:h.touches[0].clientX;w=Math.min(Math.max(0,ie-pe),ae)*100/ae}if((we||Y)&&(w=100-w),T=jl(h.target,w),me&&m.length>1&&de!==void 0){let ae=m[0],pe=m[m.length-1],ie=ae.percent+de<0,je=pe.percent+de>100;if(ie||je)return;for(let nr=0;nr<m.length;nr++)Me(nr,m[nr].percent+de);return}let N=Jn();N!==-1&&(Me(N,w),T==null||T.$pointer.focus())},Gt=h=>{if(fe||document.activeElement!==c||T!=null&&T.disabled)return;h.stopPropagation(),h.preventDefault();let w=h.deltaY<0,N=we||Y,ae=w?!N:N,pe=Jn();pe!==-1&&(ae?Tt(pe,m[pe].percent):Rt(pe,m[pe].percent))},Zn=h=>{fe||_e||(se===be?Y?Me(h,100):Me(h,0):we?Rt(h,m[h].percent):Tt(h,m[h].percent))},Qn=h=>{fe||_e||(se===be?Y?Me(h,0):Me(h,100):we?Tt(h,m[h].percent):Rt(h,m[h].percent))},es=h=>{fe||_e||(se===be?Y?Rt(h,m[h].percent):Tt(h,m[h].percent):we?Me(h,100):Me(h,0))},ts=h=>{fe||_e||(se===be?Y?Tt(h,m[h].percent):Rt(h,m[h].percent):we?Me(h,0):Me(h,100))},Nl=h=>h.classList.contains("panel"),Bl=h=>h.classList.contains("panel-fill"),Tt=(h,w)=>{if(w===void 0)return;let N=Kt(w);N==null&&(N=1),w-=N,w<0&&(w=0),Me(h,w)},Rt=(h,w)=>{if(w===void 0)return;let N=Kt(w);N==null&&(N=1),w+=N,w>100&&(w=100),Me(h,w)},at=()=>{!R||R.update({percents:rs(),values:is(),$pointers:ns(),min:ss(),max:os(),data:ei(),step:Qr(),round:ri(),type:ti(),textMin:Jt(),textMax:Zt(),rightToLeft:si(),bottomToTop:oi(),pointersOverlap:ui(),pointersMinDistance:ii(),pointersMaxDistance:ni(),rangeDragging:hi(),disabled:ai(),keyboardDisabled:li(),mousewheelDisabled:ci()})},Fl=()=>{at()},Hl=h=>{if(!(Q||m.length<=1||K===D))if(h===0){let w=ce*100/(K-D);return Math.max(0,m[h+1].percent-w)}else{let w=z*100/(K-D);return Math.min(m[h-1].percent+w,100)}},Ul=h=>{if(!(Q||m.length<=1||K===D))if(h===m.length-1){let w=ce*100/(K-D);return Math.min(m[h-1].percent+w,100)}else{let w=z*100/(K-D);return Math.max(0,m[h+1].percent-w)}},Kt=h=>{let w;if(typeof te=="function"){let N=He(0,100,D,K,h);w=te(N,h)}else w=te;if(ue(w)){let N=K-D;return w=N===0?0:w*100/N,w}},_t=h=>{if(h===void 0)return;let w=He(0,100,D,K,h);return F!==void 0?F[Math.round(w)]:xt(w,Te)},Jt=()=>F!==void 0?F[D]:D,Zt=()=>F!==void 0?F[K]:K,Qr=()=>te,Yl=h=>{var w;return h<=0||Q?Jt():(w=_t(m[h-1].percent))!=null?w:""},zl=h=>{var w;return m.length<=1||h>=m.length-1||Q?Zt():(w=_t(m[h+1].percent))!=null?w:""},rs=()=>m.map(h=>h.percent),is=()=>m.map(h=>_t(h.percent)),ns=()=>m.map(h=>h.$pointer),ss=()=>D,os=()=>K,ei=()=>F,ti=()=>se,ri=()=>Te,ii=()=>z,ni=()=>ce,Xl=h=>Gn[h],si=()=>we,oi=()=>Y,ai=()=>fe,li=()=>_e,ci=()=>Ee,ui=()=>Q,hi=()=>me,Me=(h,w)=>{if(w===void 0)return;let N=Kt(w);N!==void 0&&(w=bt(w,N));let ae=m[h];if(!ae)return;let pe=ae.updatePosition(w,Hl(h),Ul(h),se,we,Y);U==null||U.updatePosition(se,m.map(ie=>ie.percent),we,Y),at();for(let ie of m){let je=_t(ie.percent);je!==void 0&&(ie.setAttr("aria-valuenow",je.toString()),ie.setAttr("aria-valuetext",je.toString()))}Wl(),pe&&ol(c,m.map(ie=>_t(ie.percent)))},Ue=()=>{for(let h=0;h<m.length;h++)Me(h,m[h].percent)},Vl=(h,w)=>{D=F!==void 0?0:oe(h,Jr),K=F!==void 0?F.length-1:oe(w,Lt),Qt(D),er(K)},Wl=()=>{var h,w;for(let N=0;N<m.length;N++){let ae=m[N];ae.setAttr("aria-valuemin",((h=Yl(N))!=null?h:"").toString()),ae.setAttr("aria-valuemax",((w=zl(N))!=null?w:"").toString())}},Qt=h=>{D=oe(h,Jr),D>K&&(K=D+Lt),Ue()},er=h=>{K=oe(h,Lt),K<D&&(K=D+Lt),Ue()},as=h=>{Q=!0;for(let w=0;w<h.length;w++)tr(h[w],w);Q=!1;for(let w=0;w<h.length;w++)tr(h[w],w)},tr=(h,w)=>{let N;F!==void 0?(N=h==null?0:ll(h,F),N===-1&&(N=0)):(N=oe(h,D),N<D&&(N=D),N>K&&(N=K));let ae=He(D,K,0,100,N);Me(w,ae)},rr=h=>{if(h==null){te=void 0;return}if(typeof h=="function"){te=h,Ue();return}if(ue(h)){te=oe(h,1);let w=Math.abs(K-D);te>w&&(te=void 0),Ue();return}te=void 0},di=h=>{Q=h,Ue()},fi=h=>{(!ue(h)||h<0)&&(h=0),z=h},pi=h=>{(!ue(h)||h<0)&&(h=1/0),ce=h},gi=h=>{fe=h,d.classList.toggle("disabled",fe),fe?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},ls=h=>{_e=h},cs=h=>{Ee=h,Ee?document.removeEventListener("wheel",Gt):document.addEventListener("wheel",Gt,{passive:!1})},vi=h=>{if(h==null){F=void 0;return}if(F=al(h),F===void 0||F.length<=0){F=void 0;return}Qt(0),er(F.length-1),te===void 0&&rr(1)},mi=h=>{var w;typeof h=="string"?se=h.trim().toLowerCase()===be?be:Le:se=Le;let N=(w=c.shadowRoot)==null?void 0:w.querySelector(".range-slider-box");if(!N)return;N.className=`range-slider-box type-${se}`,Ue();let ae=se===be?"vertical":"horizontal";for(let pe of m)pe.setAttr("aria-orientation",ae)},yi=h=>{we=h,m.length>1&&Wn(m,we,c),Ue(),at()},bi=h=>{Y=h,m.length>1&&Wn(m,Y,c),Ue(),at()},xi=h=>{Te=oe(h,wt),Te<0&&(Te=wt),at()},us=h=>{h==null||h.toString().trim().toLowerCase()==="false"?(Ze=void 0,d.style.removeProperty(Yn),d.classList.remove($t)):(Ze=h.toString(),d.style.setProperty(Yn,Ze),d.classList.add($t))},hs=(h,w)=>{let N=m[h];!N||(N.setAttr("aria-label",w),Gn[h]=w)},ir=h=>{if(ge=void 0,m.length<=1){me=!1,d.classList.remove(Xn);return}me=h,d.classList.toggle(Xn,me)},ql=()=>{gi(xe(c.getAttribute(g))),_e=xe(c.getAttribute($)),Ee=xe(c.getAttribute(S));let h=Wt(c,/^pointer([0-9]*)-disabled$/,w=>xe(w));for(let w of h){let N=w[0];!m[N]||(m[N].disabled=w[1])}},Gl=()=>{let h=Wt(c,/^aria-label([0-9]*)$/);for(let w of h){let N=w[0];hs(N,w[1])}},Kl=h=>{let w=m.length,N=m[w-1].$pointer,ae=N.cloneNode(!0);N.after(ae);let pe=Kr(c,ae,w);return pe.setCallbacks(Zn,Qn,es,ts),m.push(pe),tr(h,w),Ue(),at(),w},Jl=()=>{let h=m.length,w=m[h-1];return w?(w.destroy(),m.pop(),m.length<=1&&ir(!1),Ue(),at(),h-1):-1};return(()=>{var h,w;for(let ae of m)ae.setCallbacks(Zn,Qn,es,ts);let N=(h=c.shadowRoot)==null?void 0:h.querySelector(".panel-fill");N&&(U=cl(N)),mi(c.getAttribute(j)),yi(xe(c.getAttribute(J))),bi(xe(c.getAttribute(f))),Vl(c.getAttribute(v),c.getAttribute(y)),rr(c.getAttribute(x)),vi(c.getAttribute(p)),as(b.map(ae=>ae[1])),di(xe(c.getAttribute(o))),fi(oe(c.getAttribute(l),0)),pi(oe(c.getAttribute(a),1/0)),ir(xe(c.getAttribute(u))),xi(oe(c.getAttribute(M),wt)),ql(),Gl(),G=Pl(c,d,m),us((w=c.getAttribute(De))!=null?w:qn),d.addEventListener("mousedown",Kn),d.addEventListener("mouseup",qt),d.addEventListener("touchmove",ot),d.addEventListener("touchstart",ot),Ee||document.addEventListener("wheel",Gt,{passive:!1}),R=Cl(c,Fl,{setValues:as,setMin:Qt,setMax:er,setStep:rr,setPointersOverlap:di,setPointersMinDistance:fi,setPointersMaxDistance:pi,setDisabled:gi,setType:mi,setRightToLeft:yi,setBottomToTop:bi,setRound:xi,setKeyboardDisabled:ls,setMousewheelDisabled:cs,setRangeDragging:ir,setData:vi},{getPercents:rs,getValues:is,getPointerElements:ns,getMin:ss,getMax:os,getStep:Qr,getData:ei,getType:ti,getRound:ri,getTextMin:Jt,getTextMax:Zt,isRightToLeft:si,isBottomToTop:oi,isDisabled:ai,isKeyboardDisabled:li,isMousewheelDisabled:ci,isPointersOverlap:ui,isRangeDraggingEnabled:hi,getPointersMinDistance:ii,getPointersMaxDistance:ni}),R.init()})(),{get pointers(){return m},get styles(){return G},get pluginsManager(){return R},get min(){return Jt()},get max(){return Zt()},get step(){return Qr()},get pointersOverlap(){return ui()},set pointersOverlap(h){di(h)},get pointersMinDistance(){return ii()},set pointersMinDistance(h){fi(h)},get pointersMaxDistance(){return ni()},set pointersMaxDistance(h){pi(h)},get disabled(){return ai()},set disabled(h){gi(h)},get data(){return ei()},get type(){return ti()},set type(h){mi(h)},get rightToLeft(){return si()},set rightToLeft(h){yi(h)},get bottomToTop(){return oi()},set bottomToTop(h){bi(h)},get round(){return ri()},set round(h){xi(h)},get animateOnClick(){return Ze},set animateOnClick(h){us(h)},get keyboardDisabled(){return li()},set keyboardDisabled(h){ls(h)},get mousewheelDisabled(){return ci()},set mousewheelDisabled(h){cs(h)},get rangeDragging(){return hi()},set rangeDragging(h){ir(h)},setMin:Qt,setMax:er,setValue:tr,setStep:rr,setData:vi,getTextValue:_t,setAriaLabel:hs,getAriaLabel:Xl,addPointer:Kl,removePointer:Jl,destroy:()=>{d.removeEventListener("mousedown",Kn),d.removeEventListener("mouseup",qt),d.removeEventListener("touchmove",ot),d.removeEventListener("touchstart",ot),document.removeEventListener("wheel",Gt);for(let h of m)h.destroy();R==null||R.destroy()}}},Dl=(c,d,b)=>{let m=zn.find(([R,D,K,te])=>D.replace("#","")===d.replace(/\d+/g,""));if(m&&c.styles){let[R,D,K,te]=m,F=d.replace(/\D/g,"").trim(),se=F===""||F==="0"||F==="1"?0:oe(F,0)-1;c.styles.setStyle(R,b,se);return}switch(c&&c.pluginsManager&&c.pluginsManager.onAttrChange(d,b),d){case v:{c.setMin(b);break}case y:{c.setMax(b);break}case x:{c.setStep(b);break}case o:{c.pointersOverlap=xe(b);break}case l:{c.pointersMinDistance=oe(b,0);break}case u:{c.rangeDragging=xe(b);break}case a:{c.pointersMaxDistance=oe(b,1/0);break}case g:{c.disabled=xe(b);break}case $:{c.keyboardDisabled=xe(b);break}case S:{c.mousewheelDisabled=xe(b);break}case p:{c.setData(b);break}case j:{c.type=b;break}case J:{c.rightToLeft=xe(b);break}case f:{c.bottomToTop=xe(b);break}case M:{c.round=oe(b,wt);break}case q:{c.styles&&(c.styles.theme=b);break}case De:{c.animateOnClick=b;break}}let T=null;if(/^value([0-9]*)$/.test(d)&&(T="value"),/^pointer([0-9]*)-disabled$/.test(d)&&(T="pointer-disabled"),/^aria-label([0-9]*)$/.test(d)&&(T="aria-label"),/^pointer([0-9]*)-shape$/.test(d)&&(T="pointer-shape"),!T)return;let U=d.replace(/\D/g,"").trim(),G=U===""||U==="0"||U==="1"?0:oe(U,0)-1;switch(T){case"value":{c.setValue(b,G);break}case"pointer-disabled":{let R=c==null?void 0:c.pointers[G];if(!R)return;R.disabled=xe(b);break}case"aria-label":{c.setAriaLabel(G,b);break}case"pointer-shape":{c.styles&&c.styles.setPointerShape(G,b);break}}},Il=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(c){this.slider&&this.slider.setStep(c)}get step(){var c;return(c=this.slider)==null?void 0:c.step}set disabled(c){this.slider&&(this.slider.disabled=c)}get disabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.disabled)!=null?d:!1}set data(c){var d;(d=this.slider)==null||d.setData(c)}get data(){var c;return(c=this.slider)==null?void 0:c.data}set min(c){var d;(d=this.slider)==null||d.setMin(c)}get min(){var c;return(c=this.slider)==null?void 0:c.min}set max(c){var d;(d=this.slider)==null||d.setMax(c)}get max(){var c;return(c=this.slider)==null?void 0:c.max}set round(c){!this.slider||(this.slider.round=c)}get round(){var c,d;return(d=(c=this.slider)==null?void 0:c.round)!=null?d:wt}set type(c){!this.slider||(this.slider.type=c??Le)}get type(){var c;return((c=this.slider)==null?void 0:c.type)||Le}set pointersOverlap(c){!this.slider||(this.slider.pointersOverlap=c)}get pointersOverlap(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersOverlap)!=null?d:!1}set pointersMinDistance(c){!this.slider||(this.slider.pointersMinDistance=c)}get pointersMinDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMinDistance)!=null?d:0}set pointersMaxDistance(c){!this.slider||(this.slider.pointersMaxDistance=c)}get pointersMaxDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMaxDistance)!=null?d:1/0}set theme(c){!this.slider||!this.slider.styles||(this.slider.styles.theme=c)}get theme(){var c,d,b;return(b=(d=(c=this.slider)==null?void 0:c.styles)==null?void 0:d.theme)!=null?b:null}set rtl(c){!this.slider||(this.slider.rightToLeft=c)}get rtl(){var c,d;return(d=(c=this.slider)==null?void 0:c.rightToLeft)!=null?d:!1}set btt(c){!this.slider||(this.slider.bottomToTop=c)}get btt(){var c,d;return(d=(c=this.slider)==null?void 0:c.bottomToTop)!=null?d:!1}set keyboardDisabled(c){!this.slider||(this.slider.keyboardDisabled=c)}get keyboardDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.keyboardDisabled)!=null?d:!1}set mousewheelDisabled(c){!this.slider||(this.slider.mousewheelDisabled=c)}get mousewheelDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.mousewheelDisabled)!=null?d:!1}set animateOnClick(c){!this.slider||(this.slider.animateOnClick=c)}get animateOnClick(){var c;return(c=this.slider)==null?void 0:c.animateOnClick}get rangeDragging(){var c,d;return(d=(c=this.slider)==null?void 0:c.rangeDragging)!=null?d:!1}set rangeDragging(c){this.slider&&(this.slider.rangeDragging=xe(c))}get externalCSSList(){return this._externalCSSList}addPointer(c){var d;if(!this.slider)return;let b=(d=this.slider)==null?void 0:d.addPointer(c);Vn(this,this.slider,b,`value${b+1}`,`ariaLabel${b+1}`,`pointerShape${b+1}`,`pointer${b+1}Disabled`)}removePointer(){var c;!this.slider||(c=this.slider)==null||c.removePointer()}addCSS(c){if(!this.shadowRoot)return;let d=document.createElement("style");d.textContent=c,this.shadowRoot.appendChild(d)}connectedCallback(){var c,d;if(!this.shadowRoot)return;this._externalCSSList=Sl(this),this.shadowRoot.innerHTML=n(s,this._externalCSSList);let b=(c=this.shadowRoot)==null?void 0:c.querySelector(".pointer");if(!b)return;let m=(d=this.shadowRoot)==null?void 0:d.getElementById("range-slider");if(!m)return;let T=Ll(this,b);this.slider=Rl(this,m,T),Tl(this,this.slider),this._observer=new MutationObserver(U=>{U.forEach(G=>{var R;if(!this.slider||G.type!=="attributes")return;let D=G.attributeName;!D||Dl(this.slider,D,(R=this.getAttribute(D))!=null?R:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},Zr=Il;window.tcRangeSlider=Zr,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",Zr),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends Zr{})})();var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $r(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function wr(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){if(this instanceof i){var n=[null];n.push.apply(n,arguments);var s=Function.bind.apply(e,n);return new s}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var Ki={exports:{}};(function(r,e){(function(t,i){r.exports=i()})(ft,function(){var t=1e3,i=6e4,n=36e5,s="millisecond",o="second",l="minute",a="hour",u="day",p="week",v="month",y="quarter",x="year",M="date",j="Invalid Date",q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,J=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var _=["th","st","nd","rd"],O=k%100;return"["+k+(_[(O-20)%10]||_[O]||_[0])+"]"}},g=function(k,_,O){var B=String(k);return!B||B.length>=_?k:""+Array(_+1-B.length).join(O)+k},$={s:g,z:function(k){var _=-k.utcOffset(),O=Math.abs(_),B=Math.floor(O/60),P=O%60;return(_<=0?"+":"-")+g(B,2,"0")+":"+g(P,2,"0")},m:function k(_,O){if(_.date()<O.date())return-k(O,_);var B=12*(O.year()-_.year())+(O.month()-_.month()),P=_.clone().add(B,v),H=O-P<0,V=_.clone().add(B+(H?-1:1),v);return+(-(B+(O-P)/(H?P-V:V-P))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:v,y:x,w:p,d:u,D:M,h:a,m:l,s:o,ms:s,Q:y}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},S="en",E={};E[S]=f;var A=function(k){return k instanceof W},C=function k(_,O,B){var P;if(!_)return S;if(typeof _=="string"){var H=_.toLowerCase();E[H]&&(P=H),O&&(E[H]=O,P=H);var V=_.split("-");if(!P&&V.length>1)return k(V[0])}else{var ee=_.name;E[ee]=_,P=ee}return!B&&P&&(S=P),P||!B&&S},L=function(k,_){if(A(k))return k.clone();var O=typeof _=="object"?_:{};return O.date=k,O.args=arguments,new W(O)},I=$;I.l=C,I.i=A,I.w=function(k,_){return L(k,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var W=function(){function k(O){this.$L=C(O.locale,null,!0),this.parse(O)}var _=k.prototype;return _.parse=function(O){this.$d=function(B){var P=B.date,H=B.utc;if(P===null)return new Date(NaN);if(I.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var V=P.match(q);if(V){var ee=V[2]-1||0,le=(V[7]||"0").substring(0,3);return H?new Date(Date.UTC(V[1],ee,V[3]||1,V[4]||0,V[5]||0,V[6]||0,le)):new Date(V[1],ee,V[3]||1,V[4]||0,V[5]||0,V[6]||0,le)}}return new Date(P)}(O),this.$x=O.x||{},this.init()},_.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},_.$utils=function(){return I},_.isValid=function(){return this.$d.toString()!==j},_.isSame=function(O,B){var P=L(O);return this.startOf(B)<=P&&P<=this.endOf(B)},_.isAfter=function(O,B){return L(O)<this.startOf(B)},_.isBefore=function(O,B){return this.endOf(B)<L(O)},_.$g=function(O,B,P){return I.u(O)?this[B]:this.set(P,O)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(O,B){var P=this,H=!!I.u(B)||B,V=I.p(O),ee=function(He,ue){var oe=I.w(P.$u?Date.UTC(P.$y,ue,He):new Date(P.$y,ue,He),P);return H?oe:oe.endOf(u)},le=function(He,ue){return I.w(P.toDate()[He].apply(P.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(ue)),P)},Z=this.$W,ve=this.$M,De=this.$D,Ie="set"+(this.$u?"UTC":"");switch(V){case x:return H?ee(1,0):ee(31,11);case v:return H?ee(1,ve):ee(0,ve+1);case p:var be=this.$locale().weekStart||0,Le=(Z<be?Z+7:Z)-be;return ee(H?De-Le:De+(6-Le),ve);case u:case M:return le(Ie+"Hours",0);case a:return le(Ie+"Minutes",1);case l:return le(Ie+"Seconds",2);case o:return le(Ie+"Milliseconds",3);default:return this.clone()}},_.endOf=function(O){return this.startOf(O,!1)},_.$set=function(O,B){var P,H=I.p(O),V="set"+(this.$u?"UTC":""),ee=(P={},P[u]=V+"Date",P[M]=V+"Date",P[v]=V+"Month",P[x]=V+"FullYear",P[a]=V+"Hours",P[l]=V+"Minutes",P[o]=V+"Seconds",P[s]=V+"Milliseconds",P)[H],le=H===u?this.$D+(B-this.$W):B;if(H===v||H===x){var Z=this.clone().set(M,1);Z.$d[ee](le),Z.init(),this.$d=Z.set(M,Math.min(this.$D,Z.daysInMonth())).$d}else ee&&this.$d[ee](le);return this.init(),this},_.set=function(O,B){return this.clone().$set(O,B)},_.get=function(O){return this[I.p(O)]()},_.add=function(O,B){var P,H=this;O=Number(O);var V=I.p(B),ee=function(ve){var De=L(H);return I.w(De.date(De.date()+Math.round(ve*O)),H)};if(V===v)return this.set(v,this.$M+O);if(V===x)return this.set(x,this.$y+O);if(V===u)return ee(1);if(V===p)return ee(7);var le=(P={},P[l]=i,P[a]=n,P[o]=t,P)[V]||1,Z=this.$d.getTime()+O*le;return I.w(Z,this)},_.subtract=function(O,B){return this.add(-1*O,B)},_.format=function(O){var B=this,P=this.$locale();if(!this.isValid())return P.invalidDate||j;var H=O||"YYYY-MM-DDTHH:mm:ssZ",V=I.z(this),ee=this.$H,le=this.$m,Z=this.$M,ve=P.weekdays,De=P.months,Ie=function(ue,oe,bt,xt){return ue&&(ue[oe]||ue(B,H))||bt[oe].slice(0,xt)},be=function(ue){return I.s(ee%12||12,ue,"0")},Le=P.meridiem||function(ue,oe,bt){var xt=ue<12?"AM":"PM";return bt?xt.toLowerCase():xt},He={YY:String(this.$y).slice(-2),YYYY:I.s(this.$y,4,"0"),M:Z+1,MM:I.s(Z+1,2,"0"),MMM:Ie(P.monthsShort,Z,De,3),MMMM:Ie(De,Z),D:this.$D,DD:I.s(this.$D,2,"0"),d:String(this.$W),dd:Ie(P.weekdaysMin,this.$W,ve,2),ddd:Ie(P.weekdaysShort,this.$W,ve,3),dddd:ve[this.$W],H:String(ee),HH:I.s(ee,2,"0"),h:be(1),hh:be(2),a:Le(ee,le,!0),A:Le(ee,le,!1),m:String(le),mm:I.s(le,2,"0"),s:String(this.$s),ss:I.s(this.$s,2,"0"),SSS:I.s(this.$ms,3,"0"),Z:V};return H.replace(J,function(ue,oe){return oe||He[ue]||V.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(O,B,P){var H,V=I.p(B),ee=L(O),le=(ee.utcOffset()-this.utcOffset())*i,Z=this-ee,ve=I.m(this,ee);return ve=(H={},H[x]=ve/12,H[v]=ve,H[y]=ve/3,H[p]=(Z-le)/6048e5,H[u]=(Z-le)/864e5,H[a]=Z/n,H[l]=Z/i,H[o]=Z/t,H)[V]||Z,P?ve:I.a(ve)},_.daysInMonth=function(){return this.endOf(v).$D},_.$locale=function(){return E[this.$L]},_.locale=function(O,B){if(!O)return this.$L;var P=this.clone(),H=C(O,B,!0);return H&&(P.$L=H),P},_.clone=function(){return I.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},k}(),re=W.prototype;return L.prototype=re,[["$ms",s],["$s",o],["$m",l],["$H",a],["$W",u],["$M",v],["$y",x],["$D",M]].forEach(function(k){re[k[1]]=function(_){return this.$g(_,k[0],k[1])}}),L.extend=function(k,_){return k.$i||(k(_,W,L),k.$i=!0),L},L.locale=C,L.isDayjs=A,L.unix=function(k){return L(1e3*k)},L.en=E[S],L.Ls=E,L.p={},L})})(Ki);var Cs=Ki.exports;const Bt=$r(Cs);class ks extends Pe{constructor(){super(...arguments),this.templates={},this._renderedTemplates={}}setBindingSyntax(e,t){this._startExpression=e,this._endExpression=t;const i=this.escapeRegex(this._startExpression),n=this.escapeRegex(this._endExpression);this._expression=new RegExp(`${i}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${n}`,"g")}hasTemplate(e){return this.templates&&!!this.templates[e]}renderTemplate(e,t,i){if(!this.hasTemplate(e))return null;i=i||e;const n=he` <slot name=${i}></slot> `,s={[e]:{...t}};if(this._renderedTemplates.hasOwnProperty(i)){const{slot:l}=this._renderedTemplates[i];this.contains(l)&&this.removeChild(l)}const o=document.createElement("div");return o.slot=i,o.dataset.generated="template",this._renderTemplate(o,this.templates[e],s),this.appendChild(o),this._renderedTemplates[i]={context:s,slot:o},n}getTemplates(){const e={};for(let t=0;t<this.children.length;t++){const i=this.children[t];if(i.nodeName==="TEMPLATE"){const n=i;n.dataset.type?e[n.dataset.type]=n:e.default=n,n.templateOrder=t}}return e}_renderTemplate(e,t,i){let n;if(t.content&&t.content.childNodes.length){const s=t.content.cloneNode(!0);n=this.renderNode(s,e,i)}n&&e.appendChild(n)}expandExpressionsAsString(e,t){return e.replace(this.expression,(i,n)=>{const s=this.evalInContext(n||this.trimExpression(i),t);return s?typeof s=="object"?JSON.stringify(s):s.toString():""})}get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}escapeRegex(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}evalInContext(e,t){t={...t};const i=new Function("with(this) { return "+e+";}");let n;try{n=i.call(t)}catch{}return n}trimExpression(e){return e=e.trim(),e.startsWith(this._startExpression)&&e.endsWith(this._endExpression)&&(e=e.substr(this._startExpression.length,e.length-this._startExpression.length-this._endExpression.length),e=e.trim()),e}renderNode(e,t,i){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,i),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=i,e;for(let n=0;n<e.childNodes.length;n++){const s=e.childNodes[n];this.renderNode(s,t,i)}return e}firstUpdated(){this.templates=this.getTemplates()}}const Ji=`
63
+ */const qi=Symbol.for(""),Ss=r=>{if((r==null?void 0:r.r)===qi)return r==null?void 0:r._$litStatic$},Nt=r=>({_$litStatic$:r,r:qi}),Gi=new Map,Ps=r=>(e,...t)=>{const i=t.length;let n,s;const o=[],l=[];let a,u=0,p=!1;for(;u<i;){for(a=e[u];u<i&&(s=t[u],(n=Ss(s))!==void 0);)a+=n+e[++u],p=!0;u!==i&&l.push(s),o.push(a),u++}if(u===i&&o.push(e[i]),p){const v=o.join("$$lit$$");(e=Gi.get(v))===void 0&&(o.raw=o,Gi.set(v,e=o)),t=l}return r(e,...t)},xr=Ps(he);(()=>{var r=Object.defineProperty,e=Math.pow,t=(c,d,b)=>d in c?r(c,d,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[d]=b,i=(c,d,b)=>(t(c,typeof d!="symbol"?d+"":d,b),b),n=(c,d)=>` ${d&&d.length>0?d.map(b=>`<link rel="stylesheet" href="${b}" />`).join(""):""} <style> ${c} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`,s=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",o="pointers-overlap",l="pointers-min-distance",a="pointers-max-distance",u="range-dragging",p="data",v="min",y="max",x="step",M="round",j="type",q="theme",J="rtl",f="btt",g="disabled",$="keyboard-disabled",S="mousewheel-disabled",E="slider-width",A="slider-height",C="slider-radius",L="slider-bg",I="slider-bg-hover",W="slider-bg-fill",re="pointer-width",k="pointer-height",_="pointer-radius",O="pointer-bg",B="pointer-bg-hover",P="pointer-bg-focus",H="pointer-shadow",V="pointer-shadow-hover",ee="pointer-shadow-focus",le="pointer-border",Z="pointer-border-hover",ve="pointer-border-focus",De="animate-onclick",Ie="css-links",be="vertical",Le="horizontal",He=(c,d,b,m,T)=>{let U=d-c;return U===0?b:(m-b)*(T-c)/U+b},ue=c=>!isNaN(parseFloat(c))&&isFinite(c),oe=(c,d)=>ue(c)?Number(c):d,bt=(c,d)=>d===0?0:Math.round(c/d)*d,xt=(c,d=1/0)=>{if(d===1/0)return c;let b=e(10,d);return Math.round(c*b)/b},xe=c=>c==null?!1:typeof c=="boolean"?c:c.trim().toLowerCase()==="true",rl=(c,d)=>{c.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:d}}))},il=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:d}}))},nl=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:d}}))},sl=(c,d)=>{c.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:d}}))},ol=(c,d)=>{if(!d||d.length<=0)return;let b=d.map(T=>ue(T)?oe(T,T):T),m={values:b||[]};m.value=b[0],m.value0=b[0],m.value1=b[0];for(let T=1;T<b.length;T++)m[`value${T+1}`]=b[T];c.dispatchEvent(new CustomEvent("change",{detail:m}))},Kr=(c,d,b)=>{let m=0,T,U,G,R,D=!1,K=(z,ce,me,ge,de,fe)=>{let _e=m;me!==void 0&&z>me&&(z=me),ce!==void 0&&z<ce&&(z=ce),m=z;let Ee=m;return(ge===be&&fe||ge===Le&&de)&&(Ee=100-Ee),ge===be?d.style.top=`${Ee}%`:d.style.left=`${Ee}%`,_e!==m},te=z=>z===d||d.contains(z),F=(z,ce,me,ge)=>{T=z,U=ce,G=me,R=ge},se=z=>{D=z,d.classList.toggle("disabled",D),D?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},Te=(z,ce)=>{ce==null?d.removeAttribute(z):d.setAttribute(z,ce)},we=z=>d.getAttribute(z),Y=z=>{if(!D){switch(z.key){case"ArrowLeft":{z.preventDefault(),typeof T=="function"&&T(b);break}case"ArrowRight":{z.preventDefault(),typeof U=="function"&&U(b);break}case"ArrowUp":{z.preventDefault(),typeof G=="function"&&G(b);break}case"ArrowDown":{z.preventDefault(),typeof R=="function"&&R(b);break}}sl(c,z)}},Q=()=>{D||rl(c,d)};return d.className=`pointer pointer-${b}`,d.addEventListener("keydown",Y),d.addEventListener("click",Q),{$pointer:d,get percent(){return m},get disabled(){return D},set disabled(z){se(z)},updatePosition:K,isClicked:te,setCallbacks:F,setAttr:Te,getAttr:we,destroy:()=>{d.removeEventListener("keydown",Y),d.removeEventListener("click",Q),d.remove()}}},al=c=>{if(c==null)return;if(Array.isArray(c))return c;if(c.trim()==="")return;let d=c.split(","),b=[],m=!0;for(let T=0;T<d.length;T++){let U=d[T].trim();U!==""&&(b.push(U),ue(U)||(m=!1))}return m?b.map(T=>Number(T)):b},ll=(c,d)=>d?d.findIndex(b=>b===c||b.toString().trim()===c.toString().trim()):-1,cl=c=>({updatePosition:(d,b,m,T)=>{if(b.length<=0)return;let U=b.length===1,G=b[0],R=b[b.length-1];d===be?(c.style.removeProperty("width"),c.style.removeProperty("right"),c.style.removeProperty("left"),U?c.style.height=`${G}%`:c.style.height=`${Math.abs(G-R)}%`,T?(c.style.bottom="0%",U?c.style.top="auto":c.style.top=`${Math.min(100-R,100-G)}%`):(c.style.bottom="auto",U?c.style.top="0%":c.style.top=`${Math.min(G,R)}%`)):(c.style.removeProperty("height"),c.style.removeProperty("top"),c.style.removeProperty("bottom"),U?c.style.width=`${G}%`:c.style.width=`${Math.abs(G-R)}%`,m?(c.style.right="0%",U?c.style.left="auto":c.style.left=`${Math.min(100-R,100-G)}%`):(c.style.right="auto",U?c.style.left="0%":c.style.left=`${Math.min(G,R)}%`))}}),Yn="--animate-onclick",ul="--width",hl="--height",dl="--panel-bg-border-radius",fl="--panel-bg",pl="--panel-bg-hover",gl="--panel-bg-fill",vl="--pointer-width",ml="--pointer-height",yl="--pointer-border-radius",bl="--pointer-bg",xl="--pointer-bg-hover",$l="--pointer-bg-focus",wl="--pointer-shadow",_l="--pointer-shadow-hover",El="--pointer-shadow-focus",Ml="--pointer-border",Al="--pointer-border-hover",Ol="--pointer-border-focus",Wt=(c,d,b)=>{let m=new Map;for(let T of c.attributes){let U=T.nodeName.trim().toLowerCase();if(!d.test(U))continue;let G=U.replace(/\D/g,"").trim(),R=G===""||G==="0"||G==="1"?0:oe(G,0)-1,D=b&&typeof b=="function"?b(T.value):T.value;m.set(R,D)}return m},Sl=c=>{if(!c)return null;let d=c.getAttribute(Ie);if(!d)return null;let b=d.split(";"),m=[];for(let T of b)T.trim()!==""&&m.push(T.trim());return m},zn=[[ul,E,"sliderWidth",null],[hl,A,"sliderHeight",null],[dl,C,"sliderRadius",null],[fl,L,"sliderBg",null],[pl,I,"sliderBgHover",null],[gl,W,"sliderBgFill",null],[vl,re,"pointer#Width",/^pointer([0-9]*)-width$/],[ml,k,"pointer#Height",/^pointer([0-9]*)-height$/],[yl,_,"pointer#Radius",/^pointer([0-9]*)-radius$/],[bl,O,"pointer#Bg",/^pointer([0-9]*)-bg$/],[xl,B,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[$l,P,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[wl,H,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[_l,V,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[El,ee,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[Ml,le,"pointer#Border",/^pointer([0-9]*)-border$/],[Al,Z,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[Ol,ve,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],Pl=(c,d,b)=>{let m=null,T=[],U=new Map,G=(Y,Q=d)=>{let z=[...Q.classList];for(let ce of z)ce.startsWith(Y)&&d.classList.remove(ce)},R=()=>{G("shape");let Y=d.querySelectorAll(".pointer");for(let Q of Y)G("shape",Q)},D=Y=>{m=Y,G("theme-"),typeof Y=="string"&&d.classList.add(`theme-${Y}`)},K=()=>{if(R(),!(T.length<=0)){d.classList.add("shape",`shape-${T[0]}`);for(let Y=1;Y<T.length;Y++){let Q=T[Y];if(!Q)continue;let z=d.querySelector(`.pointer-${Y}`);!z||z.classList.add("shape",`shape-${Q}`)}}},te=(Y,Q)=>{T[Y]=Q,K()},F=()=>{R();let Y=Wt(c,/^pointer([0-9]*)-shape$/);if(!(Y.size<=0)){for(let Q of Y){let z=Q[0];T[z]=Q[1]}K()}},se=(Y,Q)=>`${Y}-${Q}`,Te=(Y,Q,z)=>{let ce=b[z];if(!ce)return;let me=z===0?d:ce.$pointer;if(Q==null){U.has(se(Y,z))&&U.delete(se(Y,z)),me.style.removeProperty(Y);return}U.set(se(Y,z),Q),me.style.setProperty(Y,Q)},we=(Y,Q)=>U.get(se(Y,Q));return(()=>{for(let Y of zn){let[Q,z,ce,me]=Y;if(me){let de=Wt(c,me);for(let fe of de){let _e=fe[0],Ee=fe[1];Te(Q,Ee,_e)}}else{let de=c.getAttribute(z);Te(Q,de,0)}let ge=[];if(ce.indexOf("#")===-1)ge.push([ce,0]);else{ge.push([ce.replace("#",""),0]),ge.push([ce.replace("#","0"),0]),ge.push([ce.replace("#","1"),0]);for(let de=1;de<b.length;de++)ge.push([ce.replace("#",(de+1).toString()),de])}for(let de of ge)try{let fe=de[0],_e=de[1];Object.prototype.hasOwnProperty.call(c,fe)||Object.defineProperty(c,fe,{get(){return we(Q,_e)},set:Ee=>{Te(Q,Ee,_e)}})}catch(fe){console.error(fe)}}D(c.getAttribute(q)),F()})(),{setStyle:Te,getStyle:we,get theme(){return m},set theme(Y){D(Y)},get pointerShapes(){return T},setPointerShape:te}},$t="animate-on-click",Xn="range-dragging",Cl=(c,d,b,m)=>{let T=[],U=te=>{for(let F of T)F.update&&typeof F.update=="function"&&F.update(te)},G=()=>{for(let te of T)te.destroy&&typeof te.destroy=="function"&&te.destroy()},R=(te,F)=>{for(let se of T)se.onAttrChange&&typeof se.onAttrChange=="function"&&se.onAttrChange(te,F)},D=te=>{if(te.gettersAndSetters){for(let F of te.gettersAndSetters)if(!(!F.name||!F.attributes))try{Object.prototype.hasOwnProperty.call(c,F.name)||Object.defineProperty(c,F.name,F.attributes)}catch(se){console.error("defineSettersGetters error:",se)}}},K=te=>{var F;if(!te.css)return;let se=(F=c.shadowRoot)==null?void 0:F.querySelector("style");!se||(se.innerHTML+=te.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let te of window.tcRangeSliderPlugins){let F=te();T.push(F),F.init&&typeof F.init=="function"&&(F.init(c,d,b,m),D(F),K(F))}},update:U,onAttrChange:R,destroy:G}},kl=10,Ll=(c,d)=>{let b=new Map,m=/^value([0-9]*)$/;for(let R of c.attributes){let D=R.nodeName.trim().toLowerCase();if(!m.test(D))continue;let K=D.replace("value","").trim(),te=K===""||K==="0"||K==="1"?0:oe(K,0)-1,F=ue(R.value)?oe(R.value,0):R.value;b.set(te,F)}let T=Math.max(...Array.from(b.keys())),U=[];U.push([Kr(c,d,0),b.get(0)]);let G=d;for(let R=1;R<=T;R++){let D=d.cloneNode(!0);G.after(D),G=D,U.push([Kr(c,D,R),b.get(R)])}return U},Vn=(c,d,b,m,T,U,G)=>{try{Object.defineProperty(c,m,{configurable:!0,get(){if(!d)return;let R=d.pointers[b];if(!R)return;let D=d.getTextValue(R.percent);return ue(D)?oe(D,D):D},set:R=>{d.pointers[b]?d==null||d.setValue(R,b):d==null||d.addPointer(R)}}),Object.defineProperty(c,T,{configurable:!0,get(){var R,D;return(D=(R=d==null?void 0:d.pointers[b])==null?void 0:R.getAttr("aria-label"))!=null?D:void 0},set:R=>{!d||d.setAriaLabel(b,R)}}),Object.defineProperty(c,U,{configurable:!0,get(){var R,D;return(D=(R=d==null?void 0:d.styles)==null?void 0:R.pointerShapes[b])!=null?D:null},set:R=>{!d||!d.styles||d.styles.setPointerShape(b,R)}}),Object.defineProperty(c,G,{configurable:!0,get(){var R;return(R=d==null?void 0:d.pointers[b].disabled)!=null?R:!1},set:R=>{if(!d)return;let D=d==null?void 0:d.pointers[b];!D||(D.disabled=R)}})}catch(R){console.error(R)}},Tl=(c,d)=>{let b=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let m=2;m<kl;m++)b.push([`value${m}`,`ariaLabel${m}`,`pointer${m}Shape`,`pointer${m}Disabled`,m-1]);for(let m of b)Vn(c,d,m[4],m[0],m[1],m[2],m[3])},Wn=(c,d,b)=>{var m;let T=(m=b.shadowRoot)==null?void 0:m.querySelector(".container");if(T)for(let U of c)d?T.prepend(U.$pointer):T.append(U.$pointer)},Jr=0,Lt=100,wt=2,qn="0.3s",Rl=(c,d,b)=>{let m=b.map(h=>h[0]),T=null,U=null,G=null,R=null,D=Jr,K=Lt,te,F,se=Le,Te=wt,we=!1,Y=!1,Q=!1,z=0,ce=1/0,me=!1,ge,de,fe=!1,_e=!1,Ee=!1,Ze=qn,Gn=[],Kn=h=>{fe||(h.preventDefault&&h.preventDefault(),ot(h),window.addEventListener("mousemove",ot),window.addEventListener("mouseup",qt),il(c,h))},qt=h=>{fe||(ge=void 0,de=void 0,window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",qt),Ze&&d.classList.add($t),nl(c,h))},jl=(h,w)=>{if(m.length<=0)return;if(m.length===1)return m[0].isClicked(h)&&Ze&&d.classList.remove($t),m[0];let N=Bl(h);if(me){let ie=w,je=Kt(ie);je!==void 0&&(ie=bt(ie,je)),N?(ge=ie,de=0,Ze&&d.classList.remove($t)):ge!==void 0&&(de=ie-ge,ge=ie)}if(!Nl(h)&&!N){for(let ie of m)if(!(!ie.isClicked(h)||ie.disabled))return Ze&&d.classList.remove($t),ie;for(let ie of m)if(T===ie)return ie}let ae=1/0,pe=null;for(let ie of m){if(ie.disabled)continue;let je=Math.abs(w-ie.percent);je<ae&&(ae=je,pe=ie)}return pe},Jn=()=>m.findIndex(h=>T===h&&!h.disabled),ot=h=>{let w;if(se===be){let{height:ae,top:pe}=d.getBoundingClientRect(),ie=h.type.indexOf("mouse")!==-1?h.clientY:h.touches[0].clientY;w=Math.min(Math.max(0,ie-pe),ae)*100/ae}else{let{width:ae,left:pe}=d.getBoundingClientRect(),ie=h.type.indexOf("mouse")!==-1?h.clientX:h.touches[0].clientX;w=Math.min(Math.max(0,ie-pe),ae)*100/ae}if((we||Y)&&(w=100-w),T=jl(h.target,w),me&&m.length>1&&de!==void 0){let ae=m[0],pe=m[m.length-1],ie=ae.percent+de<0,je=pe.percent+de>100;if(ie||je)return;for(let nr=0;nr<m.length;nr++)Me(nr,m[nr].percent+de);return}let N=Jn();N!==-1&&(Me(N,w),T==null||T.$pointer.focus())},Gt=h=>{if(fe||document.activeElement!==c||T!=null&&T.disabled)return;h.stopPropagation(),h.preventDefault();let w=h.deltaY<0,N=we||Y,ae=w?!N:N,pe=Jn();pe!==-1&&(ae?Tt(pe,m[pe].percent):Rt(pe,m[pe].percent))},Zn=h=>{fe||_e||(se===be?Y?Me(h,100):Me(h,0):we?Rt(h,m[h].percent):Tt(h,m[h].percent))},Qn=h=>{fe||_e||(se===be?Y?Me(h,0):Me(h,100):we?Tt(h,m[h].percent):Rt(h,m[h].percent))},es=h=>{fe||_e||(se===be?Y?Rt(h,m[h].percent):Tt(h,m[h].percent):we?Me(h,100):Me(h,0))},ts=h=>{fe||_e||(se===be?Y?Tt(h,m[h].percent):Rt(h,m[h].percent):we?Me(h,0):Me(h,100))},Nl=h=>h.classList.contains("panel"),Bl=h=>h.classList.contains("panel-fill"),Tt=(h,w)=>{if(w===void 0)return;let N=Kt(w);N==null&&(N=1),w-=N,w<0&&(w=0),Me(h,w)},Rt=(h,w)=>{if(w===void 0)return;let N=Kt(w);N==null&&(N=1),w+=N,w>100&&(w=100),Me(h,w)},at=()=>{!R||R.update({percents:rs(),values:is(),$pointers:ns(),min:ss(),max:os(),data:ei(),step:Qr(),round:ri(),type:ti(),textMin:Jt(),textMax:Zt(),rightToLeft:si(),bottomToTop:oi(),pointersOverlap:ui(),pointersMinDistance:ii(),pointersMaxDistance:ni(),rangeDragging:hi(),disabled:ai(),keyboardDisabled:li(),mousewheelDisabled:ci()})},Fl=()=>{at()},Hl=h=>{if(!(Q||m.length<=1||K===D))if(h===0){let w=ce*100/(K-D);return Math.max(0,m[h+1].percent-w)}else{let w=z*100/(K-D);return Math.min(m[h-1].percent+w,100)}},Ul=h=>{if(!(Q||m.length<=1||K===D))if(h===m.length-1){let w=ce*100/(K-D);return Math.min(m[h-1].percent+w,100)}else{let w=z*100/(K-D);return Math.max(0,m[h+1].percent-w)}},Kt=h=>{let w;if(typeof te=="function"){let N=He(0,100,D,K,h);w=te(N,h)}else w=te;if(ue(w)){let N=K-D;return w=N===0?0:w*100/N,w}},_t=h=>{if(h===void 0)return;let w=He(0,100,D,K,h);return F!==void 0?F[Math.round(w)]:xt(w,Te)},Jt=()=>F!==void 0?F[D]:D,Zt=()=>F!==void 0?F[K]:K,Qr=()=>te,Yl=h=>{var w;return h<=0||Q?Jt():(w=_t(m[h-1].percent))!=null?w:""},zl=h=>{var w;return m.length<=1||h>=m.length-1||Q?Zt():(w=_t(m[h+1].percent))!=null?w:""},rs=()=>m.map(h=>h.percent),is=()=>m.map(h=>_t(h.percent)),ns=()=>m.map(h=>h.$pointer),ss=()=>D,os=()=>K,ei=()=>F,ti=()=>se,ri=()=>Te,ii=()=>z,ni=()=>ce,Xl=h=>Gn[h],si=()=>we,oi=()=>Y,ai=()=>fe,li=()=>_e,ci=()=>Ee,ui=()=>Q,hi=()=>me,Me=(h,w)=>{if(w===void 0)return;let N=Kt(w);N!==void 0&&(w=bt(w,N));let ae=m[h];if(!ae)return;let pe=ae.updatePosition(w,Hl(h),Ul(h),se,we,Y);U==null||U.updatePosition(se,m.map(ie=>ie.percent),we,Y),at();for(let ie of m){let je=_t(ie.percent);je!==void 0&&(ie.setAttr("aria-valuenow",je.toString()),ie.setAttr("aria-valuetext",je.toString()))}Wl(),pe&&ol(c,m.map(ie=>_t(ie.percent)))},Ue=()=>{for(let h=0;h<m.length;h++)Me(h,m[h].percent)},Vl=(h,w)=>{D=F!==void 0?0:oe(h,Jr),K=F!==void 0?F.length-1:oe(w,Lt),Qt(D),er(K)},Wl=()=>{var h,w;for(let N=0;N<m.length;N++){let ae=m[N];ae.setAttr("aria-valuemin",((h=Yl(N))!=null?h:"").toString()),ae.setAttr("aria-valuemax",((w=zl(N))!=null?w:"").toString())}},Qt=h=>{D=oe(h,Jr),D>K&&(K=D+Lt),Ue()},er=h=>{K=oe(h,Lt),K<D&&(K=D+Lt),Ue()},as=h=>{Q=!0;for(let w=0;w<h.length;w++)tr(h[w],w);Q=!1;for(let w=0;w<h.length;w++)tr(h[w],w)},tr=(h,w)=>{let N;F!==void 0?(N=h==null?0:ll(h,F),N===-1&&(N=0)):(N=oe(h,D),N<D&&(N=D),N>K&&(N=K));let ae=He(D,K,0,100,N);Me(w,ae)},rr=h=>{if(h==null){te=void 0;return}if(typeof h=="function"){te=h,Ue();return}if(ue(h)){te=oe(h,1);let w=Math.abs(K-D);te>w&&(te=void 0),Ue();return}te=void 0},di=h=>{Q=h,Ue()},fi=h=>{(!ue(h)||h<0)&&(h=0),z=h},pi=h=>{(!ue(h)||h<0)&&(h=1/0),ce=h},gi=h=>{fe=h,d.classList.toggle("disabled",fe),fe?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},ls=h=>{_e=h},cs=h=>{Ee=h,Ee?document.removeEventListener("wheel",Gt):document.addEventListener("wheel",Gt,{passive:!1})},vi=h=>{if(h==null){F=void 0;return}if(F=al(h),F===void 0||F.length<=0){F=void 0;return}Qt(0),er(F.length-1),te===void 0&&rr(1)},mi=h=>{var w;typeof h=="string"?se=h.trim().toLowerCase()===be?be:Le:se=Le;let N=(w=c.shadowRoot)==null?void 0:w.querySelector(".range-slider-box");if(!N)return;N.className=`range-slider-box type-${se}`,Ue();let ae=se===be?"vertical":"horizontal";for(let pe of m)pe.setAttr("aria-orientation",ae)},yi=h=>{we=h,m.length>1&&Wn(m,we,c),Ue(),at()},bi=h=>{Y=h,m.length>1&&Wn(m,Y,c),Ue(),at()},xi=h=>{Te=oe(h,wt),Te<0&&(Te=wt),at()},us=h=>{h==null||h.toString().trim().toLowerCase()==="false"?(Ze=void 0,d.style.removeProperty(Yn),d.classList.remove($t)):(Ze=h.toString(),d.style.setProperty(Yn,Ze),d.classList.add($t))},hs=(h,w)=>{let N=m[h];!N||(N.setAttr("aria-label",w),Gn[h]=w)},ir=h=>{if(ge=void 0,m.length<=1){me=!1,d.classList.remove(Xn);return}me=h,d.classList.toggle(Xn,me)},ql=()=>{gi(xe(c.getAttribute(g))),_e=xe(c.getAttribute($)),Ee=xe(c.getAttribute(S));let h=Wt(c,/^pointer([0-9]*)-disabled$/,w=>xe(w));for(let w of h){let N=w[0];!m[N]||(m[N].disabled=w[1])}},Gl=()=>{let h=Wt(c,/^aria-label([0-9]*)$/);for(let w of h){let N=w[0];hs(N,w[1])}},Kl=h=>{let w=m.length,N=m[w-1].$pointer,ae=N.cloneNode(!0);N.after(ae);let pe=Kr(c,ae,w);return pe.setCallbacks(Zn,Qn,es,ts),m.push(pe),tr(h,w),Ue(),at(),w},Jl=()=>{let h=m.length,w=m[h-1];return w?(w.destroy(),m.pop(),m.length<=1&&ir(!1),Ue(),at(),h-1):-1};return(()=>{var h,w;for(let ae of m)ae.setCallbacks(Zn,Qn,es,ts);let N=(h=c.shadowRoot)==null?void 0:h.querySelector(".panel-fill");N&&(U=cl(N)),mi(c.getAttribute(j)),yi(xe(c.getAttribute(J))),bi(xe(c.getAttribute(f))),Vl(c.getAttribute(v),c.getAttribute(y)),rr(c.getAttribute(x)),vi(c.getAttribute(p)),as(b.map(ae=>ae[1])),di(xe(c.getAttribute(o))),fi(oe(c.getAttribute(l),0)),pi(oe(c.getAttribute(a),1/0)),ir(xe(c.getAttribute(u))),xi(oe(c.getAttribute(M),wt)),ql(),Gl(),G=Pl(c,d,m),us((w=c.getAttribute(De))!=null?w:qn),d.addEventListener("mousedown",Kn),d.addEventListener("mouseup",qt),d.addEventListener("touchmove",ot),d.addEventListener("touchstart",ot),Ee||document.addEventListener("wheel",Gt,{passive:!1}),R=Cl(c,Fl,{setValues:as,setMin:Qt,setMax:er,setStep:rr,setPointersOverlap:di,setPointersMinDistance:fi,setPointersMaxDistance:pi,setDisabled:gi,setType:mi,setRightToLeft:yi,setBottomToTop:bi,setRound:xi,setKeyboardDisabled:ls,setMousewheelDisabled:cs,setRangeDragging:ir,setData:vi},{getPercents:rs,getValues:is,getPointerElements:ns,getMin:ss,getMax:os,getStep:Qr,getData:ei,getType:ti,getRound:ri,getTextMin:Jt,getTextMax:Zt,isRightToLeft:si,isBottomToTop:oi,isDisabled:ai,isKeyboardDisabled:li,isMousewheelDisabled:ci,isPointersOverlap:ui,isRangeDraggingEnabled:hi,getPointersMinDistance:ii,getPointersMaxDistance:ni}),R.init()})(),{get pointers(){return m},get styles(){return G},get pluginsManager(){return R},get min(){return Jt()},get max(){return Zt()},get step(){return Qr()},get pointersOverlap(){return ui()},set pointersOverlap(h){di(h)},get pointersMinDistance(){return ii()},set pointersMinDistance(h){fi(h)},get pointersMaxDistance(){return ni()},set pointersMaxDistance(h){pi(h)},get disabled(){return ai()},set disabled(h){gi(h)},get data(){return ei()},get type(){return ti()},set type(h){mi(h)},get rightToLeft(){return si()},set rightToLeft(h){yi(h)},get bottomToTop(){return oi()},set bottomToTop(h){bi(h)},get round(){return ri()},set round(h){xi(h)},get animateOnClick(){return Ze},set animateOnClick(h){us(h)},get keyboardDisabled(){return li()},set keyboardDisabled(h){ls(h)},get mousewheelDisabled(){return ci()},set mousewheelDisabled(h){cs(h)},get rangeDragging(){return hi()},set rangeDragging(h){ir(h)},setMin:Qt,setMax:er,setValue:tr,setStep:rr,setData:vi,getTextValue:_t,setAriaLabel:hs,getAriaLabel:Xl,addPointer:Kl,removePointer:Jl,destroy:()=>{d.removeEventListener("mousedown",Kn),d.removeEventListener("mouseup",qt),d.removeEventListener("touchmove",ot),d.removeEventListener("touchstart",ot),document.removeEventListener("wheel",Gt);for(let h of m)h.destroy();R==null||R.destroy()}}},Dl=(c,d,b)=>{let m=zn.find(([R,D,K,te])=>D.replace("#","")===d.replace(/\d+/g,""));if(m&&c.styles){let[R,D,K,te]=m,F=d.replace(/\D/g,"").trim(),se=F===""||F==="0"||F==="1"?0:oe(F,0)-1;c.styles.setStyle(R,b,se);return}switch(c&&c.pluginsManager&&c.pluginsManager.onAttrChange(d,b),d){case v:{c.setMin(b);break}case y:{c.setMax(b);break}case x:{c.setStep(b);break}case o:{c.pointersOverlap=xe(b);break}case l:{c.pointersMinDistance=oe(b,0);break}case u:{c.rangeDragging=xe(b);break}case a:{c.pointersMaxDistance=oe(b,1/0);break}case g:{c.disabled=xe(b);break}case $:{c.keyboardDisabled=xe(b);break}case S:{c.mousewheelDisabled=xe(b);break}case p:{c.setData(b);break}case j:{c.type=b;break}case J:{c.rightToLeft=xe(b);break}case f:{c.bottomToTop=xe(b);break}case M:{c.round=oe(b,wt);break}case q:{c.styles&&(c.styles.theme=b);break}case De:{c.animateOnClick=b;break}}let T=null;if(/^value([0-9]*)$/.test(d)&&(T="value"),/^pointer([0-9]*)-disabled$/.test(d)&&(T="pointer-disabled"),/^aria-label([0-9]*)$/.test(d)&&(T="aria-label"),/^pointer([0-9]*)-shape$/.test(d)&&(T="pointer-shape"),!T)return;let U=d.replace(/\D/g,"").trim(),G=U===""||U==="0"||U==="1"?0:oe(U,0)-1;switch(T){case"value":{c.setValue(b,G);break}case"pointer-disabled":{let R=c==null?void 0:c.pointers[G];if(!R)return;R.disabled=xe(b);break}case"aria-label":{c.setAriaLabel(G,b);break}case"pointer-shape":{c.styles&&c.styles.setPointerShape(G,b);break}}},Il=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(c){this.slider&&this.slider.setStep(c)}get step(){var c;return(c=this.slider)==null?void 0:c.step}set disabled(c){this.slider&&(this.slider.disabled=c)}get disabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.disabled)!=null?d:!1}set data(c){var d;(d=this.slider)==null||d.setData(c)}get data(){var c;return(c=this.slider)==null?void 0:c.data}set min(c){var d;(d=this.slider)==null||d.setMin(c)}get min(){var c;return(c=this.slider)==null?void 0:c.min}set max(c){var d;(d=this.slider)==null||d.setMax(c)}get max(){var c;return(c=this.slider)==null?void 0:c.max}set round(c){!this.slider||(this.slider.round=c)}get round(){var c,d;return(d=(c=this.slider)==null?void 0:c.round)!=null?d:wt}set type(c){!this.slider||(this.slider.type=c??Le)}get type(){var c;return((c=this.slider)==null?void 0:c.type)||Le}set pointersOverlap(c){!this.slider||(this.slider.pointersOverlap=c)}get pointersOverlap(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersOverlap)!=null?d:!1}set pointersMinDistance(c){!this.slider||(this.slider.pointersMinDistance=c)}get pointersMinDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMinDistance)!=null?d:0}set pointersMaxDistance(c){!this.slider||(this.slider.pointersMaxDistance=c)}get pointersMaxDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMaxDistance)!=null?d:1/0}set theme(c){!this.slider||!this.slider.styles||(this.slider.styles.theme=c)}get theme(){var c,d,b;return(b=(d=(c=this.slider)==null?void 0:c.styles)==null?void 0:d.theme)!=null?b:null}set rtl(c){!this.slider||(this.slider.rightToLeft=c)}get rtl(){var c,d;return(d=(c=this.slider)==null?void 0:c.rightToLeft)!=null?d:!1}set btt(c){!this.slider||(this.slider.bottomToTop=c)}get btt(){var c,d;return(d=(c=this.slider)==null?void 0:c.bottomToTop)!=null?d:!1}set keyboardDisabled(c){!this.slider||(this.slider.keyboardDisabled=c)}get keyboardDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.keyboardDisabled)!=null?d:!1}set mousewheelDisabled(c){!this.slider||(this.slider.mousewheelDisabled=c)}get mousewheelDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.mousewheelDisabled)!=null?d:!1}set animateOnClick(c){!this.slider||(this.slider.animateOnClick=c)}get animateOnClick(){var c;return(c=this.slider)==null?void 0:c.animateOnClick}get rangeDragging(){var c,d;return(d=(c=this.slider)==null?void 0:c.rangeDragging)!=null?d:!1}set rangeDragging(c){this.slider&&(this.slider.rangeDragging=xe(c))}get externalCSSList(){return this._externalCSSList}addPointer(c){var d;if(!this.slider)return;let b=(d=this.slider)==null?void 0:d.addPointer(c);Vn(this,this.slider,b,`value${b+1}`,`ariaLabel${b+1}`,`pointerShape${b+1}`,`pointer${b+1}Disabled`)}removePointer(){var c;!this.slider||(c=this.slider)==null||c.removePointer()}addCSS(c){if(!this.shadowRoot)return;let d=document.createElement("style");d.textContent=c,this.shadowRoot.appendChild(d)}connectedCallback(){var c,d;if(!this.shadowRoot)return;this._externalCSSList=Sl(this),this.shadowRoot.innerHTML=n(s,this._externalCSSList);let b=(c=this.shadowRoot)==null?void 0:c.querySelector(".pointer");if(!b)return;let m=(d=this.shadowRoot)==null?void 0:d.getElementById("range-slider");if(!m)return;let T=Ll(this,b);this.slider=Rl(this,m,T),Tl(this,this.slider),this._observer=new MutationObserver(U=>{U.forEach(G=>{var R;if(!this.slider||G.type!=="attributes")return;let D=G.attributeName;!D||Dl(this.slider,D,(R=this.getAttribute(D))!=null?R:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},Zr=Il;window.tcRangeSlider=Zr,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",Zr),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends Zr{})})();var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $r(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function wr(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){if(this instanceof i){var n=[null];n.push.apply(n,arguments);var s=Function.bind.apply(e,n);return new s}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var Ki={exports:{}};(function(r,e){(function(t,i){r.exports=i()})(ft,function(){var t=1e3,i=6e4,n=36e5,s="millisecond",o="second",l="minute",a="hour",u="day",p="week",v="month",y="quarter",x="year",M="date",j="Invalid Date",q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,J=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var _=["th","st","nd","rd"],O=k%100;return"["+k+(_[(O-20)%10]||_[O]||_[0])+"]"}},g=function(k,_,O){var B=String(k);return!B||B.length>=_?k:""+Array(_+1-B.length).join(O)+k},$={s:g,z:function(k){var _=-k.utcOffset(),O=Math.abs(_),B=Math.floor(O/60),P=O%60;return(_<=0?"+":"-")+g(B,2,"0")+":"+g(P,2,"0")},m:function k(_,O){if(_.date()<O.date())return-k(O,_);var B=12*(O.year()-_.year())+(O.month()-_.month()),P=_.clone().add(B,v),H=O-P<0,V=_.clone().add(B+(H?-1:1),v);return+(-(B+(O-P)/(H?P-V:V-P))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:v,y:x,w:p,d:u,D:M,h:a,m:l,s:o,ms:s,Q:y}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},S="en",E={};E[S]=f;var A=function(k){return k instanceof W},C=function k(_,O,B){var P;if(!_)return S;if(typeof _=="string"){var H=_.toLowerCase();E[H]&&(P=H),O&&(E[H]=O,P=H);var V=_.split("-");if(!P&&V.length>1)return k(V[0])}else{var ee=_.name;E[ee]=_,P=ee}return!B&&P&&(S=P),P||!B&&S},L=function(k,_){if(A(k))return k.clone();var O=typeof _=="object"?_:{};return O.date=k,O.args=arguments,new W(O)},I=$;I.l=C,I.i=A,I.w=function(k,_){return L(k,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var W=function(){function k(O){this.$L=C(O.locale,null,!0),this.parse(O)}var _=k.prototype;return _.parse=function(O){this.$d=function(B){var P=B.date,H=B.utc;if(P===null)return new Date(NaN);if(I.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var V=P.match(q);if(V){var ee=V[2]-1||0,le=(V[7]||"0").substring(0,3);return H?new Date(Date.UTC(V[1],ee,V[3]||1,V[4]||0,V[5]||0,V[6]||0,le)):new Date(V[1],ee,V[3]||1,V[4]||0,V[5]||0,V[6]||0,le)}}return new Date(P)}(O),this.$x=O.x||{},this.init()},_.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},_.$utils=function(){return I},_.isValid=function(){return this.$d.toString()!==j},_.isSame=function(O,B){var P=L(O);return this.startOf(B)<=P&&P<=this.endOf(B)},_.isAfter=function(O,B){return L(O)<this.startOf(B)},_.isBefore=function(O,B){return this.endOf(B)<L(O)},_.$g=function(O,B,P){return I.u(O)?this[B]:this.set(P,O)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(O,B){var P=this,H=!!I.u(B)||B,V=I.p(O),ee=function(He,ue){var oe=I.w(P.$u?Date.UTC(P.$y,ue,He):new Date(P.$y,ue,He),P);return H?oe:oe.endOf(u)},le=function(He,ue){return I.w(P.toDate()[He].apply(P.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(ue)),P)},Z=this.$W,ve=this.$M,De=this.$D,Ie="set"+(this.$u?"UTC":"");switch(V){case x:return H?ee(1,0):ee(31,11);case v:return H?ee(1,ve):ee(0,ve+1);case p:var be=this.$locale().weekStart||0,Le=(Z<be?Z+7:Z)-be;return ee(H?De-Le:De+(6-Le),ve);case u:case M:return le(Ie+"Hours",0);case a:return le(Ie+"Minutes",1);case l:return le(Ie+"Seconds",2);case o:return le(Ie+"Milliseconds",3);default:return this.clone()}},_.endOf=function(O){return this.startOf(O,!1)},_.$set=function(O,B){var P,H=I.p(O),V="set"+(this.$u?"UTC":""),ee=(P={},P[u]=V+"Date",P[M]=V+"Date",P[v]=V+"Month",P[x]=V+"FullYear",P[a]=V+"Hours",P[l]=V+"Minutes",P[o]=V+"Seconds",P[s]=V+"Milliseconds",P)[H],le=H===u?this.$D+(B-this.$W):B;if(H===v||H===x){var Z=this.clone().set(M,1);Z.$d[ee](le),Z.init(),this.$d=Z.set(M,Math.min(this.$D,Z.daysInMonth())).$d}else ee&&this.$d[ee](le);return this.init(),this},_.set=function(O,B){return this.clone().$set(O,B)},_.get=function(O){return this[I.p(O)]()},_.add=function(O,B){var P,H=this;O=Number(O);var V=I.p(B),ee=function(ve){var De=L(H);return I.w(De.date(De.date()+Math.round(ve*O)),H)};if(V===v)return this.set(v,this.$M+O);if(V===x)return this.set(x,this.$y+O);if(V===u)return ee(1);if(V===p)return ee(7);var le=(P={},P[l]=i,P[a]=n,P[o]=t,P)[V]||1,Z=this.$d.getTime()+O*le;return I.w(Z,this)},_.subtract=function(O,B){return this.add(-1*O,B)},_.format=function(O){var B=this,P=this.$locale();if(!this.isValid())return P.invalidDate||j;var H=O||"YYYY-MM-DDTHH:mm:ssZ",V=I.z(this),ee=this.$H,le=this.$m,Z=this.$M,ve=P.weekdays,De=P.months,Ie=function(ue,oe,bt,xt){return ue&&(ue[oe]||ue(B,H))||bt[oe].slice(0,xt)},be=function(ue){return I.s(ee%12||12,ue,"0")},Le=P.meridiem||function(ue,oe,bt){var xt=ue<12?"AM":"PM";return bt?xt.toLowerCase():xt},He={YY:String(this.$y).slice(-2),YYYY:I.s(this.$y,4,"0"),M:Z+1,MM:I.s(Z+1,2,"0"),MMM:Ie(P.monthsShort,Z,De,3),MMMM:Ie(De,Z),D:this.$D,DD:I.s(this.$D,2,"0"),d:String(this.$W),dd:Ie(P.weekdaysMin,this.$W,ve,2),ddd:Ie(P.weekdaysShort,this.$W,ve,3),dddd:ve[this.$W],H:String(ee),HH:I.s(ee,2,"0"),h:be(1),hh:be(2),a:Le(ee,le,!0),A:Le(ee,le,!1),m:String(le),mm:I.s(le,2,"0"),s:String(this.$s),ss:I.s(this.$s,2,"0"),SSS:I.s(this.$ms,3,"0"),Z:V};return H.replace(J,function(ue,oe){return oe||He[ue]||V.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(O,B,P){var H,V=I.p(B),ee=L(O),le=(ee.utcOffset()-this.utcOffset())*i,Z=this-ee,ve=I.m(this,ee);return ve=(H={},H[x]=ve/12,H[v]=ve,H[y]=ve/3,H[p]=(Z-le)/6048e5,H[u]=(Z-le)/864e5,H[a]=Z/n,H[l]=Z/i,H[o]=Z/t,H)[V]||Z,P?ve:I.a(ve)},_.daysInMonth=function(){return this.endOf(v).$D},_.$locale=function(){return E[this.$L]},_.locale=function(O,B){if(!O)return this.$L;var P=this.clone(),H=C(O,B,!0);return H&&(P.$L=H),P},_.clone=function(){return I.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},k}(),re=W.prototype;return L.prototype=re,[["$ms",s],["$s",o],["$m",l],["$H",a],["$W",u],["$M",v],["$y",x],["$D",M]].forEach(function(k){re[k[1]]=function(_){return this.$g(_,k[0],k[1])}}),L.extend=function(k,_){return k.$i||(k(_,W,L),k.$i=!0),L},L.locale=C,L.isDayjs=A,L.unix=function(k){return L(1e3*k)},L.en=E[S],L.Ls=E,L.p={},L})})(Ki);var Cs=Ki.exports;const Bt=$r(Cs);class ks extends Pe{constructor(){super(...arguments),this.templates={},this._renderedTemplates={}}setBindingSyntax(e,t){this._startExpression=e,this._endExpression=t;const i=this.escapeRegex(this._startExpression),n=this.escapeRegex(this._endExpression);this._expression=new RegExp(`${i}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${n}`,"g")}hasTemplate(e){return this.templates&&!!this.templates[e]}renderTemplate(e,t,i){if(!this.hasTemplate(e))return null;i=i||e;const n=he` <slot name=${i}></slot> `,s={[e]:{...t}};if(this._renderedTemplates.hasOwnProperty(i)){const{slot:l}=this._renderedTemplates[i];this.contains(l)&&this.removeChild(l)}const o=document.createElement("div");return o.slot=i,o.dataset.generated="template",this._renderTemplate(o,this.templates[e],s),this.appendChild(o),this._renderedTemplates[i]={context:s,slot:o},n}getTemplates(){const e={};for(let t=0;t<this.children.length;t++){const i=this.children[t];if(i.nodeName==="RENDER-TEMPLATE"){const n=i;n.dataset.type?e[n.dataset.type]=n:e.default=n,n.templateOrder=t}}return e}_renderTemplate(e,t,i){let n;if(t&&t.childNodes.length){const s=t.cloneNode(!0);n=this.renderNode(s,e,i)}n&&e.appendChild(n)}expandExpressionsAsString(e,t){return e.replace(this.expression,(i,n)=>{const s=this.evalInContext(n||this.trimExpression(i),t);return s?typeof s=="object"?JSON.stringify(s):s.toString():""})}get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}escapeRegex(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}evalInContext(e,t){t={...t};const i=new Function("with(this) { return "+e+";}");let n;try{n=i.call(t)}catch{}return n}trimExpression(e){return e=e.trim(),e.startsWith(this._startExpression)&&e.endsWith(this._endExpression)&&(e=e.substr(this._startExpression.length,e.length-this._startExpression.length-this._endExpression.length),e=e.trim()),e}renderNode(e,t,i){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,i),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=i,e;for(let n=0;n<e.childNodes.length;n++){const s=e.childNodes[n];this.renderNode(s,t,i)}return e}firstUpdated(){this.templates=this.getTemplates()}}const Ji=`
64
64
  :host {
65
65
  display: flex;
66
66
  box-sizing: border-box;
@@ -172,11 +172,14 @@ button.small {
172
172
 
173
173
  input[type=checkbox] {
174
174
  appearance: none;
175
+ -webkit-appearance: none;
175
176
  margin: 0;
176
177
  cursor: pointer;
177
178
  display: flex;
178
179
  flex-direction: row;
179
180
  align-items: center;
181
+ width: 24px;
182
+ height: 24px;
180
183
  }
181
184
  input[type=checkbox]:after {
182
185
  display: block;
@@ -193,12 +196,20 @@ input[type=checkbox]:checked:after {
193
196
 
194
197
  input[type=radio] {
195
198
  appearance: none;
199
+ -webkit-appearance: none;
196
200
  margin: 0;
197
201
  cursor: pointer;
198
202
  display: flex;
199
203
  flex-direction: row;
200
204
  align-items: center;
205
+ width: 24px;
206
+ height: 24px;
201
207
  }
208
+
209
+ label span {
210
+ font-size: small;
211
+ }
212
+
202
213
  input[type=radio]:after {
203
214
  display: block;
204
215
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E");
@@ -315,6 +326,11 @@ details summary {
315
326
  border-bottom: 1px solid #0002;
316
327
  padding: .5rem 0;
317
328
  }
329
+
330
+ details > summary::-webkit-details-marker {
331
+ display: none;
332
+ }
333
+
318
334
  .title {
319
335
  font-size: small;
320
336
  align-items: center;
@@ -438,12 +454,13 @@ eox-itemfilter-range {
438
454
  .range-after {
439
455
  margin-left: .5rem;
440
456
  }
441
- `;var Ls=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,_r=(r,e,t,i)=>{for(var n=i>1?void 0:i?Ts(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Ls(e,t,n),n};let Ft=class extends Pe{render(){return he`
457
+ `;var Ls=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,_r=(r,e,t,i)=>{for(var n=i>1?void 0:i?Ts(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Ls(e,t,n),n};let Ft=class extends Pe{handleDetailsToggle(r){this.dispatchEvent(new CustomEvent("details-toggled",{detail:r,bubbles:!0,composed:!0}))}render(){return he`
442
458
  <style>
443
459
  ${Ji}
444
460
  ${!this.unstyled&&Zi}
445
461
  </style>
446
462
  <details
463
+ @toggle="${this.handleDetailsToggle}"
447
464
  class="details-filter"
448
465
  part="details-filter"
449
466
  open=${this.filterObject.expanded||ne}
@@ -545,7 +562,7 @@ eox-itemfilter-range {
545
562
  value="${Object.values(this.filterObject.state)[0]}"
546
563
  @input="${this.debouncedInputHandler}"
547
564
  />
548
- `}};On([Ae()],Fr.prototype,"filterObject",2),Fr=On([qe("eox-itemfilter-text")],Fr);function Xe(r){return Array.isArray?Array.isArray(r):Cn(r)==="[object Array]"}const pa=1/0;function ga(r){if(typeof r=="string")return r;let e=r+"";return e=="0"&&1/r==-pa?"-0":e}function va(r){return r==null?"":ga(r)}function Fe(r){return typeof r=="string"}function Sn(r){return typeof r=="number"}function ma(r){return r===!0||r===!1||ya(r)&&Cn(r)=="[object Boolean]"}function Pn(r){return typeof r=="object"}function ya(r){return Pn(r)&&r!==null}function Oe(r){return r!=null}function Hr(r){return!r.trim().length}function Cn(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const ic="Extended search is not available",ba="Incorrect 'index' type",xa=r=>`Invalid value for key ${r}`,$a=r=>`Pattern length exceeds max of ${r}.`,wa=r=>`Missing ${r} property in key`,_a=r=>`Property 'weight' in key '${r}' must be a positive integer`,kn=Object.prototype.hasOwnProperty;class Ea{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(i=>{let n=Ln(i);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(i=>{i.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ln(r){let e=null,t=null,i=null,n=1,s=null;if(Fe(r)||Xe(r))i=r,e=Tn(r),t=Ur(r);else{if(!kn.call(r,"name"))throw new Error(wa("name"));const o=r.name;if(i=o,kn.call(r,"weight")&&(n=r.weight,n<=0))throw new Error(_a(o));e=Tn(o),t=Ur(o),s=r.getFn}return{path:e,id:t,weight:n,src:i,getFn:s}}function Tn(r){return Xe(r)?r:r.split(".")}function Ur(r){return Xe(r)?r.join("."):r}function Ma(r,e){let t=[],i=!1;const n=(s,o,l)=>{if(Oe(s))if(!o[l])t.push(s);else{let a=o[l];const u=s[a];if(!Oe(u))return;if(l===o.length-1&&(Fe(u)||Sn(u)||ma(u)))t.push(va(u));else if(Xe(u)){i=!0;for(let p=0,v=u.length;p<v;p+=1)n(u[p],o,l+1)}else o.length&&n(u,o,l+1)}};return n(r,Fe(e)?e.split("."):e,0),i?t:t[0]}var X={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,e)=>r.score===e.score?r.idx<e.idx?-1:1:r.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Ma,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const Aa=/[^ ]+/g;function Oa(r=1,e=3){const t=new Map,i=Math.pow(10,e);return{get(n){const s=n.match(Aa).length;if(t.has(s))return t.get(s);const o=1/Math.pow(s,.5*r),l=parseFloat(Math.round(o*i)/i);return t.set(s,l),l},clear(){t.clear()}}}class Yr{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=Oa(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,i)=>{this._keysMap[t.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Fe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Fe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Oe(e)||Hr(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((n,s)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(Oe(o)){if(Xe(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:u,value:p}=a.pop();if(Oe(p))if(Fe(p)&&!Hr(p)){let v={v:p,i:u,n:this.norm.get(p)};l.push(v)}else Xe(p)&&p.forEach((v,y)=>{a.push({nestedArrIndex:y,value:v})})}i.$[s]=l}else if(Fe(o)&&!Hr(o)){let l={v:o,n:this.norm.get(o)};i.$[s]=l}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Rn(r,e,{getFn:t=X.getFn,fieldNormWeight:i=X.fieldNormWeight}={}){const n=new Yr({getFn:t,fieldNormWeight:i});return n.setKeys(r.map(Ln)),n.setSources(e),n.create(),n}function Sa(r,{getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){const{keys:i,records:n}=r,s=new Yr({getFn:e,fieldNormWeight:t});return s.setKeys(i),s.setIndexRecords(n),s}function Xt(r,{errors:e=0,currentLocation:t=0,expectedLocation:i=0,distance:n=X.distance,ignoreLocation:s=X.ignoreLocation}={}){const o=e/r.length;if(s)return o;const l=Math.abs(i-t);return n?o+l/n:l?1:o}function Pa(r=[],e=X.minMatchCharLength){let t=[],i=-1,n=-1,s=0;for(let o=r.length;s<o;s+=1){let l=r[s];l&&i===-1?i=s:!l&&i!==-1&&(n=s-1,n-i+1>=e&&t.push([i,n]),i=-1)}return r[s-1]&&s-i>=e&&t.push([i,s-1]),t}const st=32;function Ca(r,e,t,{location:i=X.location,distance:n=X.distance,threshold:s=X.threshold,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,includeMatches:a=X.includeMatches,ignoreLocation:u=X.ignoreLocation}={}){if(e.length>st)throw new Error($a(st));const p=e.length,v=r.length,y=Math.max(0,Math.min(i,v));let x=s,M=y;const j=l>1||a,q=j?Array(v):[];let J;for(;(J=r.indexOf(e,M))>-1;){let A=Xt(e,{currentLocation:J,expectedLocation:y,distance:n,ignoreLocation:u});if(x=Math.min(A,x),M=J+p,j){let C=0;for(;C<p;)q[J+C]=1,C+=1}}M=-1;let f=[],g=1,$=p+v;const S=1<<p-1;for(let A=0;A<p;A+=1){let C=0,L=$;for(;C<L;)Xt(e,{errors:A,currentLocation:y+L,expectedLocation:y,distance:n,ignoreLocation:u})<=x?C=L:$=L,L=Math.floor(($-C)/2+C);$=L;let I=Math.max(1,y-L+1),W=o?v:Math.min(y+L,v)+p,re=Array(W+2);re[W+1]=(1<<A)-1;for(let _=W;_>=I;_-=1){let O=_-1,B=t[r.charAt(O)];if(j&&(q[O]=+!!B),re[_]=(re[_+1]<<1|1)&B,A&&(re[_]|=(f[_+1]|f[_])<<1|1|f[_+1]),re[_]&S&&(g=Xt(e,{errors:A,currentLocation:O,expectedLocation:y,distance:n,ignoreLocation:u}),g<=x)){if(x=g,M=O,M<=y)break;I=Math.max(1,2*y-M)}}if(Xt(e,{errors:A+1,currentLocation:y,expectedLocation:y,distance:n,ignoreLocation:u})>x)break;f=re}const E={isMatch:M>=0,score:Math.max(.001,g)};if(j){const A=Pa(q,l);A.length?a&&(E.indices=A):E.isMatch=!1}return E}function ka(r){let e={};for(let t=0,i=r.length;t<i;t+=1){const n=r.charAt(t);e[n]=(e[n]||0)|1<<i-t-1}return e}class Dn{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const p=(y,x)=>{this.chunks.push({pattern:y,alphabet:ka(y),startIndex:x})},v=this.pattern.length;if(v>st){let y=0;const x=v%st,M=v-x;for(;y<M;)p(this.pattern.substr(y,st),y),y+=st;if(x){const j=v-st;p(this.pattern.substr(j),j)}}else p(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let M={isMatch:!0,score:0};return i&&(M.indices=[[0,e.length-1]]),M}const{location:n,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,ignoreLocation:u}=this.options;let p=[],v=0,y=!1;this.chunks.forEach(({pattern:M,alphabet:j,startIndex:q})=>{const{isMatch:J,score:f,indices:g}=Ca(e,M,j,{location:n+q,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});J&&(y=!0),v+=f,J&&g&&(p=[...p,...g])});let x={isMatch:y,score:y?v/this.chunks.length:1};return y&&i&&(x.indices=p),x}}class Je{constructor(e){this.pattern=e}static isMultiMatch(e){return In(e,this.multiRegex)}static isSingleMatch(e){return In(e,this.singleRegex)}search(){}}function In(r,e){const t=r.match(e);return t?t[1]:null}class La extends Je{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Ta extends Je{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class Ra extends Je{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Da extends Je{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Ia extends Je{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ja extends Je{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class jn extends Je{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){super(e),this._bitapSearch=new Dn(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Nn extends Je{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,i;const n=[],s=this.pattern.length;for(;(i=e.indexOf(this.pattern,t))>-1;)t=i+s,n.push([i,t-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const zr=[La,Nn,Ra,Da,ja,Ia,Ta,jn],Bn=zr.length,Na=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ba="|";function Fa(r,e={}){return r.split(Ba).map(t=>{let i=t.trim().split(Na).filter(s=>s&&!!s.trim()),n=[];for(let s=0,o=i.length;s<o;s+=1){const l=i[s];let a=!1,u=-1;for(;!a&&++u<Bn;){const p=zr[u];let v=p.isMultiMatch(l);v&&(n.push(new p(v,e)),a=!0)}if(!a)for(u=-1;++u<Bn;){const p=zr[u];let v=p.isSingleMatch(l);if(v){n.push(new p(v,e));break}}}return n})}const Ha=new Set([jn.type,Nn.type]);class Ua{constructor(e,{isCaseSensitive:t=X.isCaseSensitive,includeMatches:i=X.includeMatches,minMatchCharLength:n=X.minMatchCharLength,ignoreLocation:s=X.ignoreLocation,findAllMatches:o=X.findAllMatches,location:l=X.location,threshold:a=X.threshold,distance:u=X.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:l,threshold:a,distance:u},this.pattern=t?e:e.toLowerCase(),this.query=Fa(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let s=0,o=[],l=0;for(let a=0,u=t.length;a<u;a+=1){const p=t[a];o.length=0,s=0;for(let v=0,y=p.length;v<y;v+=1){const x=p[v],{isMatch:M,indices:j,score:q}=x.search(e);if(M){if(s+=1,l+=q,i){const J=x.constructor.type;Ha.has(J)?o=[...o,...j]:o.push(j)}}else{l=0,s=0,o.length=0;break}}if(s){let v={isMatch:!0,score:l/s};return i&&(v.indices=o),v}}return{isMatch:!1,score:1}}}const Xr=[];function Ya(...r){Xr.push(...r)}function Vr(r,e){for(let t=0,i=Xr.length;t<i;t+=1){let n=Xr[t];if(n.condition(r,e))return new n(r,e)}return new Dn(r,e)}const Vt={AND:"$and",OR:"$or"},Wr={PATH:"$path",PATTERN:"$val"},qr=r=>!!(r[Vt.AND]||r[Vt.OR]),za=r=>!!r[Wr.PATH],Xa=r=>!Xe(r)&&Pn(r)&&!qr(r),Fn=r=>({[Vt.AND]:Object.keys(r).map(e=>({[e]:r[e]}))});function Hn(r,e,{auto:t=!0}={}){const i=n=>{let s=Object.keys(n);const o=za(n);if(!o&&s.length>1&&!qr(n))return i(Fn(n));if(Xa(n)){const a=o?n[Wr.PATH]:s[0],u=o?n[Wr.PATTERN]:n[a];if(!Fe(u))throw new Error(xa(a));const p={keyId:Ur(a),pattern:u};return t&&(p.searcher=Vr(u,e)),p}let l={children:[],operator:s[0]};return s.forEach(a=>{const u=n[a];Xe(u)&&u.forEach(p=>{l.children.push(i(p))})}),l};return qr(r)||(r=Fn(r)),i(r)}function Va(r,{ignoreFieldNorm:e=X.ignoreFieldNorm}){r.forEach(t=>{let i=1;t.matches.forEach(({key:n,norm:s,score:o})=>{const l=n?n.weight:null;i*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=i})}function Wa(r,e){const t=r.matches;e.matches=[],Oe(t)&&t.forEach(i=>{if(!Oe(i.indices)||!i.indices.length)return;const{indices:n,value:s}=i;let o={indices:n,value:s};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function qa(r,e){e.score=r.score}function Ga(r,e,{includeMatches:t=X.includeMatches,includeScore:i=X.includeScore}={}){const n=[];return t&&n.push(Wa),i&&n.push(qa),r.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return n.length&&n.forEach(a=>{a(s,l)}),l})}class yt{constructor(e,t={},i){this.options={...X,...t},this.options.useExtendedSearch,this._keyStore=new Ea(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Yr))throw new Error(ba);this._myIndex=t||Rn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Oe(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const s=this._docs[i];e(s,i)&&(this.removeAt(i),i-=1,n-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:s,sortFn:o,ignoreFieldNorm:l}=this.options;let a=Fe(e)?Fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Va(a,{ignoreFieldNorm:l}),s&&a.sort(o),Sn(t)&&t>-1&&(a=a.slice(0,t)),Ga(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Vr(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=t.searchIn(s);a&&n.push({item:s,idx:o,matches:[{score:u,value:s,norm:l,indices:p}]})}),n}_searchLogical(e){const t=Hn(e,this.options),i=(l,a,u)=>{if(!l.children){const{keyId:v,searcher:y}=l,x=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(a,v),searcher:y});return x&&x.length?[{idx:u,item:a,matches:x}]:[]}const p=[];for(let v=0,y=l.children.length;v<y;v+=1){const x=l.children[v],M=i(x,a,u);if(M.length)p.push(...M);else if(l.operator===Vt.AND)return[]}return p},n=this._myIndex.records,s={},o=[];return n.forEach(({$:l,i:a})=>{if(Oe(l)){let u=i(t,l,a);u.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),u.forEach(({matches:p})=>{s[a].matches.push(...p)}))}}),o}_searchObjectList(e){const t=Vr(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:o,i:l})=>{if(!Oe(o))return;let a=[];i.forEach((u,p)=>{a.push(...this._findMatches({key:u,value:o[p],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:i}){if(!Oe(t))return[];let n=[];if(Xe(t))t.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=i.searchIn(s);a&&n.push({score:u,key:e,value:s,idx:o,norm:l,indices:p})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:u}=i.searchIn(s);l&&n.push({score:a,key:e,value:s,norm:o,indices:u})}return n}}yt.version="6.6.2",yt.createIndex=Rn,yt.parseIndex=Sa,yt.config=X,yt.parseQuery=Hn,Ya(Ua);const Ka=(r,e="highlight",t="title")=>{const i=(s,o,l)=>{const a=o.split(".");let u;for(u=0;u<a.length-1;u++)s=s[a[u]];s[a[u]]=l},n=(s,o=[])=>{let l="",a=0;return o.forEach(u=>{const p=u[1]+1;l+=[s.substring(a,u[0]),`<mark class="${e}">`,s.substring(u[0],p),"</mark>"].join(""),a=p}),l+=s.substring(a),l};return r.filter(({matches:s})=>s&&s.length).map(({item:s,matches:o})=>{const l={...s};return o.forEach(a=>{a.key===t&&i(l,a.key,n(a.value,a.indices))}),l})};let Un;const Ja=(r,e)=>{Un=new yt(r,{threshold:.4,distance:50,includeMatches:!0,useExtendedSearch:!0,...e})},Za=async(r,e,t)=>{const i=Object.entries(e).filter(([l,a])=>a.type==="text"||a.type==="select"||a.type==="multiselect").reduce((l,[a,u])=>{const p="$or",v=[],y=(x,M)=>{const j={};u.type==="text"?j[x]=`${M}`:j[a]=`="${x}"`,v.push(j)};return Object.entries(u.state).filter(([x,M])=>M).forEach(([x,M])=>y(x,M)),v.length>0&&l.push({[p]:v}),l},[]);let n;if(!(i.length>0)&&t.matchAllWhenEmpty!==!1)n=r;else{const l={$and:[...i]},a=Un.search(l);n=t.enableHighlighting?Ka(a,"highlight",t.titleProperty):a.map(u=>u.item)}const s=Object.entries(e).filter(([l,a])=>a.type==="range").reduce((l,[a,u])=>(l[a]={min:u.state.min,max:u.state.max,format:u.format},l),{});if(Object.keys(s).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const[p,v]of Object.entries(s)){const y=x=>v.format==="date"?Bt(x).unix():x;n[a].hasOwnProperty(p)?Array.isArray(n[a][p])?u[p]=s[p].min<=y(n[a][p][1])&&y(n[a][p][0])<=s[p].max:y(n[a][p])>=s[p].min&&y(n[a][p])<=s[p].max?u[p]=!0:u[p]=!1:u[p]=!0}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}const o=Object.entries(e).filter(([l,a])=>a.type==="spatial").reduce((l,[a,u])=>(l[a]={geometry:u.state.geometry,mode:u.state.mode},l),{});if(Object.values(o).map(l=>l.geometry).filter(l=>!!l).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const p of Object.keys(o)){const v=o[p].mode||"within";n[a].hasOwnProperty(p)&&(v==="within"?ha(n[a][p],o[p].geometry):ua(n[a][p],o[p].geometry))?u[p]=!0:u[p]=!1}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}return n},Qa=async(r,e,t)=>(await(await fetch(`${t.externalFilter(r,e)}`)).json()).features;var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Ve=(r,e,t,i)=>{for(var n=i>1?void 0:i?tl(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&el(e,t,n),n};class Gr{constructor(){this.aggregateResults=void 0,this.enableHighlighting=!1,this.filterProperties=[],this.inlineMode=!1,this.matchAllWhenEmpty=!0,this.onFilter=()=>{},this.onSelect=()=>{},this.showResults=!0,this.titleProperty="title"}}ye.EOxItemFilter=class extends ks{constructor(){super(...arguments),this._resultAggregation=[],this.filters={},this.items=[],this._config=new Gr,this.apply=e=>{this.items=e.map((i,n)=>({id:`item-${n}`,...i})),this._config.filterProperties.length&&this._config.filterProperties.forEach(i=>{const n={},s=o=>i.format==="date"?Bt(o).unix():parseInt(o);this.items.forEach(o=>{if(i.type==="range"){if(Array.isArray(o[i.key])){const l=[s(o[i.key][0]),s(o[i.key][1])];n.min=n.min!==void 0?Math.min(n.min,l[0]):l[0],n.max=n.max!==void 0?Math.max(n.max,l[1]):l[1]}else{const l=s(o[i.key]);n.min=n.min!==void 0?Math.min(n.min,l):l,n.max=n.max!==void 0?Math.max(n.max,l):l}return}Array.isArray(o[i.key])?o[i.key].forEach(l=>{n[l]=void 0}):i.type==="spatial"?(n.geometry=void 0,n.mode=i.mode||"intersects"):n[o[i.key]]=void 0}),this.filters[i.key||i.keys.join("|")]={...i,type:i.type||"multiselect",state:{...n,...i.state},...i.state&&{dirty:!0},...i.type==="range"&&{min:n.min,max:n.max,format:i.format}}}),this._config.matchAllWhenEmpty!==!1&&(this.results=this.sortResults(this.items),this.requestUpdate()),this._config.aggregateResults&&(this._resultAggregation=[...new Set(this.items.reduce((i,n)=>i.concat(n[this._config.aggregateResults]),[]))].sort((i,n)=>i.localeCompare(n)));const t=[];Object.values(this.filters).forEach(i=>{i.type==="text"?i.keys.forEach(n=>{t.includes(n)||t.push(n)}):(i.type==="select"||i.type==="multiselect")&&(t.includes(i.key)||t.push(i.key))}),Ja(this.items,{keys:t,...this._config.fuseConfig}),this.search()}}set config(e){const t=this._config;this._config={...new Gr,...e},this.requestUpdate("config",t)}get config(){return this._config}async search(){let e;this.config.externalFilter?e=await Qa(this.items,this.filters,this._config):e=await Za(this.items,this.filters,this._config),this.results=this.sortResults(e),this._config.onFilter(this.results,this.filters)}aggregateResults(e,t){return e.filter(i=>{const n=i[this._config.aggregateResults];let s;return this.filters[this._config.aggregateResults]&&(s=Object.keys(this.filters[this._config.aggregateResults]).filter(l=>this.filters[this._config.aggregateResults].state[l])),(s!=null&&s.length?s.includes(t):!0)&&Array.isArray(n)?n.includes(t):n===t})}sortResults(e){return[...e].sort((t,i)=>t[this._config.titleProperty].localeCompare(i[this._config.titleProperty]))}resetFilters(){this.renderRoot.querySelectorAll("[data-type='filter']").forEach(e=>{e.reset()}),this.search()}render(){return he`
565
+ `}};On([Ae()],Fr.prototype,"filterObject",2),Fr=On([qe("eox-itemfilter-text")],Fr);function Xe(r){return Array.isArray?Array.isArray(r):Cn(r)==="[object Array]"}const pa=1/0;function ga(r){if(typeof r=="string")return r;let e=r+"";return e=="0"&&1/r==-pa?"-0":e}function va(r){return r==null?"":ga(r)}function Fe(r){return typeof r=="string"}function Sn(r){return typeof r=="number"}function ma(r){return r===!0||r===!1||ya(r)&&Cn(r)=="[object Boolean]"}function Pn(r){return typeof r=="object"}function ya(r){return Pn(r)&&r!==null}function Oe(r){return r!=null}function Hr(r){return!r.trim().length}function Cn(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}const ic="Extended search is not available",ba="Incorrect 'index' type",xa=r=>`Invalid value for key ${r}`,$a=r=>`Pattern length exceeds max of ${r}.`,wa=r=>`Missing ${r} property in key`,_a=r=>`Property 'weight' in key '${r}' must be a positive integer`,kn=Object.prototype.hasOwnProperty;class Ea{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(i=>{let n=Ln(i);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(i=>{i.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ln(r){let e=null,t=null,i=null,n=1,s=null;if(Fe(r)||Xe(r))i=r,e=Tn(r),t=Ur(r);else{if(!kn.call(r,"name"))throw new Error(wa("name"));const o=r.name;if(i=o,kn.call(r,"weight")&&(n=r.weight,n<=0))throw new Error(_a(o));e=Tn(o),t=Ur(o),s=r.getFn}return{path:e,id:t,weight:n,src:i,getFn:s}}function Tn(r){return Xe(r)?r:r.split(".")}function Ur(r){return Xe(r)?r.join("."):r}function Ma(r,e){let t=[],i=!1;const n=(s,o,l)=>{if(Oe(s))if(!o[l])t.push(s);else{let a=o[l];const u=s[a];if(!Oe(u))return;if(l===o.length-1&&(Fe(u)||Sn(u)||ma(u)))t.push(va(u));else if(Xe(u)){i=!0;for(let p=0,v=u.length;p<v;p+=1)n(u[p],o,l+1)}else o.length&&n(u,o,l+1)}};return n(r,Fe(e)?e.split("."):e,0),i?t:t[0]}var X={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(r,e)=>r.score===e.score?r.idx<e.idx?-1:1:r.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Ma,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const Aa=/[^ ]+/g;function Oa(r=1,e=3){const t=new Map,i=Math.pow(10,e);return{get(n){const s=n.match(Aa).length;if(t.has(s))return t.get(s);const o=1/Math.pow(s,.5*r),l=parseFloat(Math.round(o*i)/i);return t.set(s,l),l},clear(){t.clear()}}}class Yr{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=Oa(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,i)=>{this._keysMap[t.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Fe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Fe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Oe(e)||Hr(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((n,s)=>{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(Oe(o)){if(Xe(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:u,value:p}=a.pop();if(Oe(p))if(Fe(p)&&!Hr(p)){let v={v:p,i:u,n:this.norm.get(p)};l.push(v)}else Xe(p)&&p.forEach((v,y)=>{a.push({nestedArrIndex:y,value:v})})}i.$[s]=l}else if(Fe(o)&&!Hr(o)){let l={v:o,n:this.norm.get(o)};i.$[s]=l}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Rn(r,e,{getFn:t=X.getFn,fieldNormWeight:i=X.fieldNormWeight}={}){const n=new Yr({getFn:t,fieldNormWeight:i});return n.setKeys(r.map(Ln)),n.setSources(e),n.create(),n}function Sa(r,{getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){const{keys:i,records:n}=r,s=new Yr({getFn:e,fieldNormWeight:t});return s.setKeys(i),s.setIndexRecords(n),s}function Xt(r,{errors:e=0,currentLocation:t=0,expectedLocation:i=0,distance:n=X.distance,ignoreLocation:s=X.ignoreLocation}={}){const o=e/r.length;if(s)return o;const l=Math.abs(i-t);return n?o+l/n:l?1:o}function Pa(r=[],e=X.minMatchCharLength){let t=[],i=-1,n=-1,s=0;for(let o=r.length;s<o;s+=1){let l=r[s];l&&i===-1?i=s:!l&&i!==-1&&(n=s-1,n-i+1>=e&&t.push([i,n]),i=-1)}return r[s-1]&&s-i>=e&&t.push([i,s-1]),t}const st=32;function Ca(r,e,t,{location:i=X.location,distance:n=X.distance,threshold:s=X.threshold,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,includeMatches:a=X.includeMatches,ignoreLocation:u=X.ignoreLocation}={}){if(e.length>st)throw new Error($a(st));const p=e.length,v=r.length,y=Math.max(0,Math.min(i,v));let x=s,M=y;const j=l>1||a,q=j?Array(v):[];let J;for(;(J=r.indexOf(e,M))>-1;){let A=Xt(e,{currentLocation:J,expectedLocation:y,distance:n,ignoreLocation:u});if(x=Math.min(A,x),M=J+p,j){let C=0;for(;C<p;)q[J+C]=1,C+=1}}M=-1;let f=[],g=1,$=p+v;const S=1<<p-1;for(let A=0;A<p;A+=1){let C=0,L=$;for(;C<L;)Xt(e,{errors:A,currentLocation:y+L,expectedLocation:y,distance:n,ignoreLocation:u})<=x?C=L:$=L,L=Math.floor(($-C)/2+C);$=L;let I=Math.max(1,y-L+1),W=o?v:Math.min(y+L,v)+p,re=Array(W+2);re[W+1]=(1<<A)-1;for(let _=W;_>=I;_-=1){let O=_-1,B=t[r.charAt(O)];if(j&&(q[O]=+!!B),re[_]=(re[_+1]<<1|1)&B,A&&(re[_]|=(f[_+1]|f[_])<<1|1|f[_+1]),re[_]&S&&(g=Xt(e,{errors:A,currentLocation:O,expectedLocation:y,distance:n,ignoreLocation:u}),g<=x)){if(x=g,M=O,M<=y)break;I=Math.max(1,2*y-M)}}if(Xt(e,{errors:A+1,currentLocation:y,expectedLocation:y,distance:n,ignoreLocation:u})>x)break;f=re}const E={isMatch:M>=0,score:Math.max(.001,g)};if(j){const A=Pa(q,l);A.length?a&&(E.indices=A):E.isMatch=!1}return E}function ka(r){let e={};for(let t=0,i=r.length;t<i;t+=1){const n=r.charAt(t);e[n]=(e[n]||0)|1<<i-t-1}return e}class Dn{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const p=(y,x)=>{this.chunks.push({pattern:y,alphabet:ka(y),startIndex:x})},v=this.pattern.length;if(v>st){let y=0;const x=v%st,M=v-x;for(;y<M;)p(this.pattern.substr(y,st),y),y+=st;if(x){const j=v-st;p(this.pattern.substr(j),j)}}else p(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let M={isMatch:!0,score:0};return i&&(M.indices=[[0,e.length-1]]),M}const{location:n,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,ignoreLocation:u}=this.options;let p=[],v=0,y=!1;this.chunks.forEach(({pattern:M,alphabet:j,startIndex:q})=>{const{isMatch:J,score:f,indices:g}=Ca(e,M,j,{location:n+q,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});J&&(y=!0),v+=f,J&&g&&(p=[...p,...g])});let x={isMatch:y,score:y?v/this.chunks.length:1};return y&&i&&(x.indices=p),x}}class Je{constructor(e){this.pattern=e}static isMultiMatch(e){return In(e,this.multiRegex)}static isSingleMatch(e){return In(e,this.singleRegex)}search(){}}function In(r,e){const t=r.match(e);return t?t[1]:null}class La extends Je{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Ta extends Je{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class Ra extends Je{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class Da extends Je{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Ia extends Je{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ja extends Je{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class jn extends Je{constructor(e,{location:t=X.location,threshold:i=X.threshold,distance:n=X.distance,includeMatches:s=X.includeMatches,findAllMatches:o=X.findAllMatches,minMatchCharLength:l=X.minMatchCharLength,isCaseSensitive:a=X.isCaseSensitive,ignoreLocation:u=X.ignoreLocation}={}){super(e),this._bitapSearch=new Dn(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Nn extends Je{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,i;const n=[],s=this.pattern.length;for(;(i=e.indexOf(this.pattern,t))>-1;)t=i+s,n.push([i,t-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const zr=[La,Nn,Ra,Da,ja,Ia,Ta,jn],Bn=zr.length,Na=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Ba="|";function Fa(r,e={}){return r.split(Ba).map(t=>{let i=t.trim().split(Na).filter(s=>s&&!!s.trim()),n=[];for(let s=0,o=i.length;s<o;s+=1){const l=i[s];let a=!1,u=-1;for(;!a&&++u<Bn;){const p=zr[u];let v=p.isMultiMatch(l);v&&(n.push(new p(v,e)),a=!0)}if(!a)for(u=-1;++u<Bn;){const p=zr[u];let v=p.isSingleMatch(l);if(v){n.push(new p(v,e));break}}}return n})}const Ha=new Set([jn.type,Nn.type]);class Ua{constructor(e,{isCaseSensitive:t=X.isCaseSensitive,includeMatches:i=X.includeMatches,minMatchCharLength:n=X.minMatchCharLength,ignoreLocation:s=X.ignoreLocation,findAllMatches:o=X.findAllMatches,location:l=X.location,threshold:a=X.threshold,distance:u=X.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:l,threshold:a,distance:u},this.pattern=t?e:e.toLowerCase(),this.query=Fa(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let s=0,o=[],l=0;for(let a=0,u=t.length;a<u;a+=1){const p=t[a];o.length=0,s=0;for(let v=0,y=p.length;v<y;v+=1){const x=p[v],{isMatch:M,indices:j,score:q}=x.search(e);if(M){if(s+=1,l+=q,i){const J=x.constructor.type;Ha.has(J)?o=[...o,...j]:o.push(j)}}else{l=0,s=0,o.length=0;break}}if(s){let v={isMatch:!0,score:l/s};return i&&(v.indices=o),v}}return{isMatch:!1,score:1}}}const Xr=[];function Ya(...r){Xr.push(...r)}function Vr(r,e){for(let t=0,i=Xr.length;t<i;t+=1){let n=Xr[t];if(n.condition(r,e))return new n(r,e)}return new Dn(r,e)}const Vt={AND:"$and",OR:"$or"},Wr={PATH:"$path",PATTERN:"$val"},qr=r=>!!(r[Vt.AND]||r[Vt.OR]),za=r=>!!r[Wr.PATH],Xa=r=>!Xe(r)&&Pn(r)&&!qr(r),Fn=r=>({[Vt.AND]:Object.keys(r).map(e=>({[e]:r[e]}))});function Hn(r,e,{auto:t=!0}={}){const i=n=>{let s=Object.keys(n);const o=za(n);if(!o&&s.length>1&&!qr(n))return i(Fn(n));if(Xa(n)){const a=o?n[Wr.PATH]:s[0],u=o?n[Wr.PATTERN]:n[a];if(!Fe(u))throw new Error(xa(a));const p={keyId:Ur(a),pattern:u};return t&&(p.searcher=Vr(u,e)),p}let l={children:[],operator:s[0]};return s.forEach(a=>{const u=n[a];Xe(u)&&u.forEach(p=>{l.children.push(i(p))})}),l};return qr(r)||(r=Fn(r)),i(r)}function Va(r,{ignoreFieldNorm:e=X.ignoreFieldNorm}){r.forEach(t=>{let i=1;t.matches.forEach(({key:n,norm:s,score:o})=>{const l=n?n.weight:null;i*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=i})}function Wa(r,e){const t=r.matches;e.matches=[],Oe(t)&&t.forEach(i=>{if(!Oe(i.indices)||!i.indices.length)return;const{indices:n,value:s}=i;let o={indices:n,value:s};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function qa(r,e){e.score=r.score}function Ga(r,e,{includeMatches:t=X.includeMatches,includeScore:i=X.includeScore}={}){const n=[];return t&&n.push(Wa),i&&n.push(qa),r.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return n.length&&n.forEach(a=>{a(s,l)}),l})}class yt{constructor(e,t={},i){this.options={...X,...t},this.options.useExtendedSearch,this._keyStore=new Ea(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Yr))throw new Error(ba);this._myIndex=t||Rn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Oe(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i<n;i+=1){const s=this._docs[i];e(s,i)&&(this.removeAt(i),i-=1,n-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:i,includeScore:n,shouldSort:s,sortFn:o,ignoreFieldNorm:l}=this.options;let a=Fe(e)?Fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Va(a,{ignoreFieldNorm:l}),s&&a.sort(o),Sn(t)&&t>-1&&(a=a.slice(0,t)),Ga(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Vr(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=t.searchIn(s);a&&n.push({item:s,idx:o,matches:[{score:u,value:s,norm:l,indices:p}]})}),n}_searchLogical(e){const t=Hn(e,this.options),i=(l,a,u)=>{if(!l.children){const{keyId:v,searcher:y}=l,x=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(a,v),searcher:y});return x&&x.length?[{idx:u,item:a,matches:x}]:[]}const p=[];for(let v=0,y=l.children.length;v<y;v+=1){const x=l.children[v],M=i(x,a,u);if(M.length)p.push(...M);else if(l.operator===Vt.AND)return[]}return p},n=this._myIndex.records,s={},o=[];return n.forEach(({$:l,i:a})=>{if(Oe(l)){let u=i(t,l,a);u.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),u.forEach(({matches:p})=>{s[a].matches.push(...p)}))}}),o}_searchObjectList(e){const t=Vr(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:o,i:l})=>{if(!Oe(o))return;let a=[];i.forEach((u,p)=>{a.push(...this._findMatches({key:u,value:o[p],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:i}){if(!Oe(t))return[];let n=[];if(Xe(t))t.forEach(({v:s,i:o,n:l})=>{if(!Oe(s))return;const{isMatch:a,score:u,indices:p}=i.searchIn(s);a&&n.push({score:u,key:e,value:s,idx:o,norm:l,indices:p})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:u}=i.searchIn(s);l&&n.push({score:a,key:e,value:s,norm:o,indices:u})}return n}}yt.version="6.6.2",yt.createIndex=Rn,yt.parseIndex=Sa,yt.config=X,yt.parseQuery=Hn,Ya(Ua);const Ka=(r,e="highlight",t="title")=>{const i=(s,o,l)=>{const a=o.split(".");let u;for(u=0;u<a.length-1;u++)s=s[a[u]];s[a[u]]=l},n=(s,o=[])=>{let l="",a=0;return o.forEach(u=>{const p=u[1]+1;l+=[s.substring(a,u[0]),`<mark class="${e}">`,s.substring(u[0],p),"</mark>"].join(""),a=p}),l+=s.substring(a),l};return r.filter(({matches:s})=>s&&s.length).map(({item:s,matches:o})=>{const l={...s};return o.forEach(a=>{a.key===t&&i(l,a.key,n(a.value,a.indices))}),l})};let Un;const Ja=(r,e)=>{Un=new yt(r,{threshold:.4,distance:50,includeMatches:!0,useExtendedSearch:!0,...e})},Za=async(r,e,t)=>{const i=Object.entries(e).filter(([l,a])=>a.type==="text"||a.type==="select"||a.type==="multiselect").reduce((l,[a,u])=>{const p="$or",v=[],y=(x,M)=>{const j={};u.type==="text"?j[x]=`${M}`:j[a]=`="${x}"`,v.push(j)};return Object.entries(u.state).filter(([x,M])=>M).forEach(([x,M])=>y(x,M)),v.length>0&&l.push({[p]:v}),l},[]);let n;if(!(i.length>0)&&t.matchAllWhenEmpty!==!1)n=r;else{const l={$and:[...i]},a=Un.search(l);n=t.enableHighlighting?Ka(a,"highlight",t.titleProperty):a.map(u=>u.item)}const s=Object.entries(e).filter(([l,a])=>a.type==="range").reduce((l,[a,u])=>(l[a]={min:u.state.min,max:u.state.max,format:u.format},l),{});if(Object.keys(s).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const[p,v]of Object.entries(s)){const y=x=>v.format==="date"?Bt(x).unix():x;n[a].hasOwnProperty(p)?Array.isArray(n[a][p])?u[p]=s[p].min<=y(n[a][p][1])&&y(n[a][p][0])<=s[p].max:y(n[a][p])>=s[p].min&&y(n[a][p])<=s[p].max?u[p]=!0:u[p]=!1:u[p]=!0}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}const o=Object.entries(e).filter(([l,a])=>a.type==="spatial").reduce((l,[a,u])=>(l[a]={geometry:u.state.geometry,mode:u.state.mode},l),{});if(Object.values(o).map(l=>l.geometry).filter(l=>!!l).length>0){const l=[];for(let a=0;a<n.length;a++){const u={};for(const p of Object.keys(o)){const v=o[p].mode||"within";n[a].hasOwnProperty(p)&&(v==="within"?ha(n[a][p],o[p].geometry):ua(n[a][p],o[p].geometry))?u[p]=!0:u[p]=!1}Object.values(u).every(p=>!!p)&&l.push(n[a])}n=[...l]}return n},Qa=async(r,e,t)=>(await(await fetch(`${t.externalFilter(r,e)}`)).json()).features;var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Ve=(r,e,t,i)=>{for(var n=i>1?void 0:i?tl(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&el(e,t,n),n};class Gr{constructor(){this.aggregateResults=void 0,this.enableHighlighting=!1,this.filterProperties=[],this.inlineMode=!1,this.matchAllWhenEmpty=!0,this.onFilter=()=>{},this.onSelect=()=>{},this.showResults=!0,this.titleProperty="title",this.expandMultipleFilters=!0,this.expandMultipleResults=!0}}ye.EOxItemFilter=class extends ks{constructor(){super(...arguments),this._resultAggregation=[],this.filters={},this.items=[],this._config=new Gr,this.apply=e=>{this.items=e.map((i,n)=>({id:`item-${n}`,...i})),this._config.filterProperties.length&&this._config.filterProperties.forEach(i=>{const n={},s=o=>i.format==="date"?Bt(o).unix():parseInt(o);this.items.forEach(o=>{if(i.type==="range"){if(Array.isArray(o[i.key])){const l=[s(o[i.key][0]),s(o[i.key][1])];n.min=n.min!==void 0?Math.min(n.min,l[0]):l[0],n.max=n.max!==void 0?Math.max(n.max,l[1]):l[1]}else{const l=s(o[i.key]);n.min=n.min!==void 0?Math.min(n.min,l):l,n.max=n.max!==void 0?Math.max(n.max,l):l}return}Array.isArray(o[i.key])?o[i.key].forEach(l=>{n[l]=void 0}):i.type==="spatial"?(n.geometry=void 0,n.mode=i.mode||"intersects"):n[o[i.key]]=void 0}),this.filters[i.key||i.keys.join("|")]={...i,type:i.type||"multiselect",state:{...n,...i.state},...i.state&&{dirty:!0},...i.type==="range"&&{min:n.min,max:n.max,format:i.format}}}),this._config.matchAllWhenEmpty!==!1&&(this.results=this.sortResults(this.items),this.requestUpdate()),this._config.aggregateResults&&(this._resultAggregation=[...new Set(this.items.reduce((i,n)=>i.concat(n[this._config.aggregateResults]),[]))].sort((i,n)=>i.localeCompare(n)));const t=[];Object.values(this.filters).forEach(i=>{i.type==="text"?i.keys.forEach(n=>{t.includes(n)||t.push(n)}):(i.type==="select"||i.type==="multiselect")&&(t.includes(i.key)||t.push(i.key))}),Ja(this.items,{keys:t,...this._config.fuseConfig}),this.search()}}set config(e){const t=this._config;this._config={...new Gr,...e},this.requestUpdate("config",t)}get config(){return this._config}async search(){let e;this.config.externalFilter?e=await Qa(this.items,this.filters,this._config):e=await Za(this.items,this.filters,this._config),this.results=this.sortResults(e),this._config.onFilter(this.results,this.filters)}aggregateResults(e,t){return e.filter(i=>{const n=i[this._config.aggregateResults];let s;return this.filters[this._config.aggregateResults]&&(s=Object.keys(this.filters[this._config.aggregateResults]).filter(l=>this.filters[this._config.aggregateResults].state[l])),(s!=null&&s.length?s.includes(t):!0)&&Array.isArray(n)?n.includes(t):n===t})}sortResults(e){return[...e].sort((t,i)=>t[this._config.titleProperty].localeCompare(i[this._config.titleProperty]))}resetFilters(){this.renderRoot.querySelectorAll("[data-type='filter']").forEach(e=>{e.reset()}),this.search()}toggleAccordion(e){let t;if(e.detail?t=e.detail.target:t=e.target,t.classList.contains("details-filter")){if(!t.open||this.config.expandMultipleFilters)return;this.shadowRoot.querySelectorAll("eox-itemfilter-expandcontainer").forEach(i=>{const n=i.shadowRoot.querySelector(".details-filter");n&&n!==t&&n.removeAttribute("open")})}else{if(!t.open||this.config.expandMultipleResults)return;this.shadowRoot.querySelectorAll("details").forEach(i=>{i!==t&&i.removeAttribute("open")})}}render(){return he`
549
566
  <style>
550
567
  ${Ji}
551
568
  ${!this.unstyled&&Zi}
@@ -576,6 +593,7 @@ eox-itemfilter-range {
576
593
  <eox-itemfilter-expandcontainer
577
594
  .filterObject=${e}
578
595
  .unstyled=${this.unstyled}
596
+ @details-toggled=${this.toggleAccordion}
579
597
  >
580
598
  <eox-itemfilter-${Nt(e.type)}
581
599
  slot="filter"
@@ -613,6 +631,7 @@ eox-itemfilter-range {
613
631
  <ul id="results" part="results">
614
632
  ${this._config.aggregateResults?dt(this._resultAggregation.filter(e=>this.aggregateResults(this.results,e).length),e=>he`<details
615
633
  class="details-results"
634
+ @toggle=${this.toggleAccordion}
616
635
  open
617
636
  >
618
637
  <summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eox/itemfilter",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@eox/eslint-config": "^1.0.0",
@@ -22,7 +22,7 @@
22
22
  "main": "./dist/eox-itemfilter.js",
23
23
  "scripts": {
24
24
  "start": "vite",
25
- "build": "tsc && vite build",
25
+ "build": "vite build",
26
26
  "watch": "tsc && vite build --watch",
27
27
  "format": "prettier --write .",
28
28
  "lint": "eslint --ext .js,.ts .",
@@ -137,4 +137,52 @@ describe("Item Filter Config", () => {
137
137
  // });
138
138
  // });
139
139
  // });
140
+
141
+ it("should allow only one accordion of each type to be open at a time if configured", () => {
142
+ cy.get("eox-itemfilter").then(($el) => {
143
+ (<EOxItemFilter>$el[0]).config.expandMultipleFilters = false;
144
+ (<EOxItemFilter>$el[0]).config.expandMultipleResults = false;
145
+ });
146
+
147
+ const checkExclusiveOpen = (selector: string, isSubcomponent = false) => {
148
+ cy.get("eox-itemfilter")
149
+ .shadow()
150
+ .within(() => {
151
+ cy.get(selector).then((accordions) => {
152
+ for (let i = 0; i < accordions.length; i++) {
153
+ const accordionToClick = isSubcomponent
154
+ ? cy
155
+ .get(selector)
156
+ .eq(i)
157
+ .find("eox-itemfilter-expandcontainer")
158
+ .shadow()
159
+ .find("details")
160
+ : cy.get(selector).eq(i).find("details");
161
+
162
+ accordionToClick.click({ multiple: true, force: true });
163
+ accordionToClick.should("have.attr", "open");
164
+
165
+ // Check that all other accordions are closed
166
+ for (let j = 0; j < accordions.length; j++) {
167
+ if (i !== j) {
168
+ const accordionToCheck = isSubcomponent
169
+ ? cy
170
+ .get(selector)
171
+ .eq(j)
172
+ .find("eox-itemfilter-expandcontainer")
173
+ .shadow()
174
+ .find("details")
175
+ : cy.get(selector).eq(j).find("details");
176
+
177
+ accordionToCheck.should("not.have.attr", "open");
178
+ }
179
+ }
180
+ }
181
+ });
182
+ });
183
+ };
184
+
185
+ checkExclusiveOpen("ul#filters", true);
186
+ checkExclusiveOpen("ul#results");
187
+ });
140
188
  });