@florid-kit/components 0.3.38 → 0.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/thumbnail-navigation.d.ts +3 -0
- package/index.js +27 -27
- package/index.mjs +254 -251
- package/package.json +1 -1
|
@@ -10,6 +10,9 @@ export declare class ThumbnailNavigation extends LitElement {
|
|
|
10
10
|
disabledIndexes: number[];
|
|
11
11
|
playIcon?: TemplateResult;
|
|
12
12
|
maxWidth: string;
|
|
13
|
+
swiperInstance?: {
|
|
14
|
+
slideTo: (index: number) => void;
|
|
15
|
+
};
|
|
13
16
|
private focusedIndex;
|
|
14
17
|
static styles: import('lit').CSSResult;
|
|
15
18
|
private handleKeyDown;
|
package/index.js
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const G=globalThis,ct=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),
|
|
5
|
+
*/const G=globalThis,ct=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),bt=new WeakMap;let Et=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ct&&t===void 0){const n=e!==void 0&&e.length===1;n&&(t=bt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&bt.set(e,t))}return t}toString(){return this.cssText}};const Bt=s=>new Et(typeof s=="string"?s:s+"",void 0,ht),A=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((n,o,r)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+s[r+1],s[0]);return new Et(e,s,ht)},It=(s,t)=>{if(ct)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const n=document.createElement("style"),o=G.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n)}},vt=ct?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return Bt(e)})(s):s;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ot,defineProperty:Ht,getOwnPropertyDescriptor:
|
|
9
|
+
*/const{is:Ot,defineProperty:Ht,getOwnPropertyDescriptor:Tt,getOwnPropertyNames:Mt,getOwnPropertySymbols:zt,getPrototypeOf:Dt}=Object,C=globalThis,gt=C.trustedTypes,Ut=gt?gt.emptyScript:"",st=C.reactiveElementPolyfillSupport,R=(s,t)=>s,X={toAttribute(s,t){switch(t){case Boolean:s=s?Ut:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},dt=(s,t)=>!Ot(s,t),yt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:dt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let z=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,e);o!==void 0&&Ht(this.prototype,t,o)}}static getPropertyDescriptor(t,e,n){const{get:o,set:r}=Tt(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:o,set(i){const c=o==null?void 0:o.call(this);r==null||r.call(this,i),this.requestUpdate(t,c,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??yt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const t=Dt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const e=this.properties,n=[...Mt(e),...zt(e)];for(const o of n)this.createProperty(o,e[o])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[n,o]of e)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[e,n]of this.elementProperties){const o=this._$Eu(e,n);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)e.unshift(vt(o))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){const n=e.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return It(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var n;return(n=e.hostConnected)==null?void 0:n.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var n;return(n=e.hostDisconnected)==null?void 0:n.call(e)})}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){var r;const n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(o!==void 0&&n.reflect===!0){const i=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:X).toAttribute(e,n.type);this._$Em=t,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(t,e){var r,i;const n=this.constructor,o=n._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const c=n.getPropertyOptions(o),l=typeof c.converter=="function"?{fromAttribute:c.converter}:((r=c.converter)==null?void 0:r.fromAttribute)!==void 0?c.converter:X;this._$Em=o,this[o]=l.fromAttribute(e,c.type)??((i=this._$Ej)==null?void 0:i.get(o))??null,this._$Em=null}}requestUpdate(t,e,n){var o;if(t!==void 0){const r=this.constructor,i=this[t];if(n??(n=r.getPropertyOptions(t)),!((n.hasChanged??dt)(i,e)||n.useDefault&&n.reflect&&i===((o=this._$Ej)==null?void 0:o.get(t))&&!this.hasAttribute(r._$Eu(t,n))))return;this.C(t,e,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:o,wrapped:r},i){n&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[r,i]of o){const{wrapped:c}=i,l=this[r];c!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,i,l)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(n=this._$EO)==null||n.forEach(o=>{var r;return(r=o.hostUpdate)==null?void 0:r.call(o)}),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[R("elementProperties")]=new Map,z[R("finalized")]=new Map,st==null||st({ReactiveElement:z}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const F=globalThis,J=F.trustedTypes,mt=J?J.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ct="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,Lt="?"+E,Nt=`<${Lt}>`,
|
|
14
|
-
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,wt=/>/g,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,_t=/"/g,Pt=/^(?:script|style|textarea|title)$/i,Rt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),d=Rt(1),
|
|
13
|
+
*/const F=globalThis,J=F.trustedTypes,mt=J?J.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ct="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,Lt="?"+E,Nt=`<${Lt}>`,O=document,V=()=>O.createComment(""),q=s=>s===null||typeof s!="object"&&typeof s!="function",pt=Array.isArray,jt=s=>pt(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",nt=`[
|
|
14
|
+
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,wt=/>/g,k=RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,_t=/"/g,Pt=/^(?:script|style|textarea|title)$/i,Rt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),d=Rt(1),H=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),At=new WeakMap,B=O.createTreeWalker(O,129);function kt(s,t){if(!pt(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return mt!==void 0?mt.createHTML(t):t}const Ft=(s,t)=>{const e=s.length-1,n=[];let o,r=t===2?"<svg>":t===3?"<math>":"",i=j;for(let c=0;c<e;c++){const l=s[c];let f,b,p=-1,x=0;for(;x<l.length&&(i.lastIndex=x,b=i.exec(l),b!==null);)x=i.lastIndex,i===j?b[1]==="!--"?i=$t:b[1]!==void 0?i=wt:b[2]!==void 0?(Pt.test(b[2])&&(o=RegExp("</"+b[2],"g")),i=k):b[3]!==void 0&&(i=k):i===k?b[0]===">"?(i=o??j,p=-1):b[1]===void 0?p=-2:(p=i.lastIndex-b[2].length,f=b[1],i=b[3]===void 0?k:b[3]==='"'?_t:xt):i===_t||i===xt?i=k:i===$t||i===wt?i=j:(i=k,o=void 0);const S=i===k&&s[c+1].startsWith("/>")?" ":"";r+=i===j?l+Nt:p>=0?(n.push(f),l.slice(0,p)+Ct+l.slice(p)+E+S):l+E+(p===-2?c:S)}return[kt(s,r+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class Z{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let r=0,i=0;const c=t.length-1,l=this.parts,[f,b]=Ft(t,e);if(this.el=Z.createElement(f,n),B.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=B.nextNode())!==null&&l.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(const p of o.getAttributeNames())if(p.endsWith(Ct)){const x=b[i++],S=o.getAttribute(p).split(E),K=/([.?@])?(.*)/.exec(x);l.push({type:1,index:r,name:K[2],strings:S,ctor:K[1]==="."?qt:K[1]==="?"?Zt:K[1]==="@"?Wt:Y}),o.removeAttribute(p)}else p.startsWith(E)&&(l.push({type:6,index:r}),o.removeAttribute(p));if(Pt.test(o.tagName)){const p=o.textContent.split(E),x=p.length-1;if(x>0){o.textContent=J?J.emptyScript:"";for(let S=0;S<x;S++)o.append(p[S],V()),B.nextNode(),l.push({type:2,index:++r});o.append(p[x],V())}}}else if(o.nodeType===8)if(o.data===Lt)l.push({type:2,index:r});else{let p=-1;for(;(p=o.data.indexOf(E,p+1))!==-1;)l.push({type:7,index:r}),p+=E.length-1}r++}}static createElement(t,e){const n=O.createElement("template");return n.innerHTML=t,n}}function D(s,t,e=s,n){var i,c;if(t===H)return t;let o=n!==void 0?(i=e._$Co)==null?void 0:i[n]:e._$Cl;const r=q(t)?void 0:t._$litDirective$;return(o==null?void 0:o.constructor)!==r&&((c=o==null?void 0:o._$AO)==null||c.call(o,!1),r===void 0?o=void 0:(o=new r(s),o._$AT(s,e,n)),n!==void 0?(e._$Co??(e._$Co=[]))[n]=o:e._$Cl=o),o!==void 0&&(t=D(s,o._$AS(s,t.values),o,n)),t}class Vt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,o=((t==null?void 0:t.creationScope)??O).importNode(e,!0);B.currentNode=o;let r=B.nextNode(),i=0,c=0,l=n[0];for(;l!==void 0;){if(i===l.index){let f;l.type===2?f=new W(r,r.nextSibling,this,t):l.type===1?f=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(f=new Kt(r,this,t)),this._$AV.push(f),l=n[++c]}i!==(l==null?void 0:l.index)&&(r=B.nextNode(),i++)}return B.currentNode=O,o}p(t){let e=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class W{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,n,o){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=D(this,t,e),q(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==H&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):jt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==h&&q(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Z.createElement(kt(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===o)this._$AH.p(e);else{const i=new Vt(o,this),c=i.u(this.options);i.p(e),this.T(c),this._$AH=i}}_$AC(t){let e=At.get(t.strings);return e===void 0&&At.set(t.strings,e=new Z(t)),e}k(t){pt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,o=0;for(const r of t)o===e.length?e.push(n=new W(this.O(V()),this.O(V()),this,this.options)):n=e[o],n._$AI(r),o++;o<e.length&&(this._$AR(n&&n._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,e);t&&t!==this._$AB;){const o=t.nextSibling;t.remove(),t=o}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,o,r){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=h}_$AI(t,e=this,n,o){const r=this.strings;let i=!1;if(r===void 0)t=D(this,t,e,0),i=!q(t)||t!==this._$AH&&t!==H,i&&(this._$AH=t);else{const c=t;let l,f;for(t=r[0],l=0;l<r.length-1;l++)f=D(this,c[n+l],e,l),f===H&&(f=this._$AH[l]),i||(i=!q(f)||f!==this._$AH[l]),f===h?t=h:t!==h&&(t+=(f??"")+r[l+1]),this._$AH[l]=f}i&&!o&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class qt extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}}class Zt extends Y{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}}class Wt extends Y{constructor(t,e,n,o,r){super(t,e,n,o,r),this.type=5}_$AI(t,e=this){if((t=D(this,t,e,0)??h)===H)return;const n=this._$AH,o=t===h&&n!==h||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==h&&(n===h||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Kt{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}}const ot=F.litHtmlPolyfillSupport;ot==null||ot(Z,W),(F.litHtmlVersions??(F.litHtmlVersions=[])).push("3.3.0");const Gt=(s,t,e)=>{const n=(e==null?void 0:e.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const r=(e==null?void 0:e.renderBefore)??null;n._$litPart$=o=new W(t.insertBefore(V(),r),r,void 0,e??{})}return o._$AI(s),o};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
19
|
+
*/const I=globalThis;let m=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Gt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return H}};var St;m._$litElement$=!0,m.finalized=!0,(St=I.litElementHydrateSupport)==null||St.call(I,{LitElement:m});const it=I.litElementPolyfillSupport;it==null||it({LitElement:m});(I.litElementVersions??(I.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const T=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const Xt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:dt},Jt=(s=Xt,t,e)=>{const{kind:
|
|
27
|
+
*/const Xt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:dt},Jt=(s=Xt,t,e)=>{const{kind:n,metadata:o}=e;let r=globalThis.litPropertyMetadata.get(o);if(r===void 0&&globalThis.litPropertyMetadata.set(o,r=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(e.name,s),n==="accessor"){const{name:i}=e;return{set(c){const l=t.get.call(this);t.set.call(this,c),this.requestUpdate(i,l,s)},init(c){return c!==void 0&&this.C(i,void 0,s,c),c}}}if(n==="setter"){const{name:i}=e;return function(c){const l=this[i];t.call(this,c),this.requestUpdate(i,l,s)}}throw Error("Unsupported decorator location: "+n)};function a(s){return(t,e)=>typeof e=="object"?Jt(s,t,e):((n,o,r)=>{const i=o.hasOwnProperty(r);return o.constructor.createProperty(r,n),i?Object.getOwnPropertyDescriptor(o,r):void 0})(s,t,e)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -44,19 +44,19 @@
|
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2023 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: Apache-2.0
|
|
47
|
-
*/function ee(s){s.addInitializer(t=>{const e=t;e.addEventListener("click",async
|
|
47
|
+
*/function ee(s){s.addInitializer(t=>{const e=t;e.addEventListener("click",async n=>{const{type:o,[ut]:r}=e,{form:i}=r;if(!(!i||o==="button")&&(await new Promise(c=>{setTimeout(c)}),!n.defaultPrevented)){if(o==="reset"){i.reset();return}i.addEventListener("submit",c=>{Object.defineProperty(c,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),r.setFormValue(e.value),i.requestSubmit()}})})}/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const se={CHILD:2},
|
|
51
|
+
*/const se={CHILD:2},ne=s=>(...t)=>({_$litDirective$:s,values:t});class oe{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2017 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/class at extends
|
|
55
|
+
*/class at extends oe{constructor(t){if(super(t),this.it=h,t.type!==se.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===H)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}at.directiveName="unsafeHTML",at.resultType=1;/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/class lt extends at{}lt.directiveName="unsafeSVG",lt.resultType=2;const Q=
|
|
59
|
+
*/class lt extends at{}lt.directiveName="unsafeSVG",lt.resultType=2;const Q=ne(lt),ie=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
60
60
|
<path d="M8 3.6275C7.06799 0.971489 3.25399 -0.0226278 1.67414 2.30983C0.0877404 4.65197 1.67414 6.99412 2.62598 8.33249C3.0147 8.87905 8 14 8 14C8 14 12.9853 8.87905 13.374 8.33249C14.3259 6.99412 15.9123 4.65197 14.3259 2.30983C12.746 -0.0226277 8.97167 0.971489 8 3.6275Z" stroke="#3F2B2E" stroke-linecap="round"/>
|
|
61
61
|
</svg>
|
|
62
62
|
`,re=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
<path d="M2 2L14 14" stroke="#3F2B2E"/>
|
|
88
88
|
<path d="M14 2L2 14" stroke="#3F2B2E"/>
|
|
89
89
|
</svg>
|
|
90
|
-
`,
|
|
90
|
+
`,be=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
91
91
|
<path d="M7.12506 1C10.5018 1 13.2509 3.74834 13.251 7.125C13.2511 8.59738 12.7172 10.0206 11.7491 11.1299L14.8731 14.2539C15.0433 14.4253 15.0435 14.7018 14.8731 14.873C14.7913 14.9555 14.6797 15.002 14.5635 15.002C14.4475 15.0019 14.3357 14.9554 14.254 14.873L11.1309 11.749C10.0555 12.6818 8.6564 13.251 7.12506 13.251C3.7484 13.2508 1.00006 10.5017 1.00006 7.125C1.00025 3.74846 3.74852 1.00019 7.12506 1ZM7.12506 1.875C4.22971 1.87522 1.87506 4.23058 1.87506 7.12598C1.87532 10.0212 4.22987 12.3758 7.12506 12.376C10.0204 12.376 12.3758 10.0213 12.376 7.12598C12.376 4.23044 10.0206 1.875 7.12506 1.875Z" fill="#3F2B2E"/>
|
|
92
92
|
</svg>
|
|
93
|
-
`,
|
|
93
|
+
`,ve=`<?xml version="1.0" encoding="utf-8"?>
|
|
94
94
|
<!-- Generator: $$$/GeneralStr/196=Adobe Illustrator 27.6.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
95
95
|
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
96
96
|
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</style>
|
|
110
110
|
<path class="st0" d="M27.3,20.7H12.7c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h14.7c0.4,0,0.7,0.3,0.7,0.7S27.7,20.7,27.3,20.7z"/>
|
|
111
111
|
</svg>
|
|
112
|
-
`,ft={wishlist:ie,playerv:re,chevronRight:ae,chevronLeft:le,icoPlus:
|
|
112
|
+
`,ft={wishlist:ie,playerv:re,chevronRight:ae,chevronLeft:le,icoPlus:ve,icoMinus:ge,"star-0":ce,"star-25":he,"star-50":de,"star-75":pe,"star-100":ue,cross:fe,search:be};var ye=Object.defineProperty,me=Object.getOwnPropertyDescriptor,L=(s,t,e,n)=>{for(var o=n>1?void 0:n?me(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&ye(t,e,o),o};let $=class extends m{constructor(){super(...arguments),this.bgstyle="background-light",this.size="medium",this.status="empty",this.type="button",this.strokewidth="1",this.icon="wishlist",this.disabled=!1}updated(s){super.updated(s),this.style.setProperty("--icon-stroke-width",this.strokewidth)}render(){const s=ft[this.icon]??"",t=`icon-${this.icon}`,e=s.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return d`
|
|
113
113
|
${this.type==="span"?d`
|
|
114
114
|
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
|
|
115
115
|
${Q(e)}
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
}
|
|
284
|
-
`;L([a({type:String,reflect:!0})],$.prototype,"bgstyle",2);L([a({type:String,reflect:!0})],$.prototype,"size",2);L([a({type:String,reflect:!0})],$.prototype,"status",2);L([a({type:String,reflect:!0})],$.prototype,"type",2);L([a({type:String})],$.prototype,"strokewidth",2);L([a({type:String})],$.prototype,"icon",2);L([a({type:Boolean,reflect:!0})],$.prototype,"disabled",2);$=L([
|
|
284
|
+
`;L([a({type:String,reflect:!0})],$.prototype,"bgstyle",2);L([a({type:String,reflect:!0})],$.prototype,"size",2);L([a({type:String,reflect:!0})],$.prototype,"status",2);L([a({type:String,reflect:!0})],$.prototype,"type",2);L([a({type:String})],$.prototype,"strokewidth",2);L([a({type:String})],$.prototype,"icon",2);L([a({type:Boolean,reflect:!0})],$.prototype,"disabled",2);$=L([T("o-icon-button")],$);var $e=Object.defineProperty,we=Object.getOwnPropertyDescriptor,v=(s,t,e,n)=>{for(var o=n>1?void 0:n?we(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&$e(t,e,o),o};const xe=te(m);let u=class extends xe{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.text="",this.textsecond="",this.fullwidth=!1,this.disabled=!1,this.iconstrokewidth="1",this.icon="",this.startIcon=!1,this.endIcon=!1,this.iconSize="small",this.panelTarget="",this.href="",this.target=""}get name(){return this.getAttribute("name")??""}set name(s){this.setAttribute("name",s)}get form(){return this[ut].form}handleClick(){if(this.panelTarget){const s=document.getElementById(this.panelTarget);s!=null&&s.openPanel&&typeof s.openPanel=="function"?s.openPanel():console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`)}}render(){return this.href?this.renderLink():this.renderButton()}renderIcon(s){return this.icon?d`<o-icon-button
|
|
285
285
|
class=${s==="start"?"icon-start":"icon-end"}
|
|
286
286
|
icon=${this.icon}
|
|
287
287
|
bgstyle="${this.variant==="primary"?"none-light":"none-contrast"}"
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
display: inline-flex;
|
|
440
440
|
align-items: center;
|
|
441
441
|
}
|
|
442
|
-
`;
|
|
442
|
+
`;v([a()],u.prototype,"type",2);v([a({reflect:!0})],u.prototype,"value",2);v([a({type:String,reflect:!0})],u.prototype,"variant",2);v([a({type:String})],u.prototype,"text",2);v([a({type:String})],u.prototype,"textsecond",2);v([a({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);v([a({type:Boolean,reflect:!0})],u.prototype,"disabled",2);v([a({type:String,attribute:"iconstrokewidth"})],u.prototype,"iconstrokewidth",2);v([a({type:String})],u.prototype,"icon",2);v([a({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);v([a({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);v([a({type:String,reflect:!0,attribute:"iconsize"})],u.prototype,"iconSize",2);v([a({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);v([a({type:String})],u.prototype,"href",2);v([a({type:String})],u.prototype,"target",2);u=v([T("o-button")],u);var _e=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,tt=(s,t,e,n)=>{for(var o=n>1?void 0:n?Ae(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&_e(t,e,o),o};let U=class extends m{constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist",this.toggleStatus=()=>{this.status=this.status==="empty"?"filled":"empty",this.setAttribute("aria-pressed",String(this.status==="filled")),this.dispatchEvent(new CustomEvent("wishlist-toggle",{detail:{status:this.status},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(this.status==="filled"))}firstUpdated(){this.addEventListener("click",this.toggleStatus),this.addEventListener("keydown",this.handleKeydown)}handleKeydown(s){(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this.toggleStatus())}render(){const s=ft.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return d`
|
|
443
443
|
<button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
|
|
444
444
|
<span class="sr-only">${this.label}</span>
|
|
445
445
|
${Q(s)}
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
width: 0.1rem !important;
|
|
504
504
|
white-space: nowrap !important;
|
|
505
505
|
}
|
|
506
|
-
`;tt([a({type:String,reflect:!0})],U.prototype,"status",2);tt([a({type:String,reflect:!0})],U.prototype,"ariaDescribedBy",2);tt([a({type:String,reflect:!0})],U.prototype,"label",2);U=tt([
|
|
506
|
+
`;tt([a({type:String,reflect:!0})],U.prototype,"status",2);tt([a({type:String,reflect:!0})],U.prototype,"ariaDescribedBy",2);tt([a({type:String,reflect:!0})],U.prototype,"label",2);U=tt([T("o-wishlist-button")],U);var Se=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,M=(s,t,e,n)=>{for(var o=n>1?void 0:n?Ee(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&Se(t,e,o),o};let _=class extends m{constructor(){super(...arguments),this.href="",this.target="",this.template="standard",this.inverse=!1,this.endIcon=!1,this.reverseEndIcon=!1}render(){return d`
|
|
507
507
|
<a href="${this.href}" target="${this.target}">
|
|
508
508
|
${this.endIcon&&this.reverseEndIcon?d`
|
|
509
509
|
<o-icon-button
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
></o-icon-button>
|
|
526
526
|
`:null}
|
|
527
527
|
</a>
|
|
528
|
-
`}};
|
|
528
|
+
`}};_.styles=A`
|
|
529
529
|
:host([template="standard"]) a {
|
|
530
530
|
color: var(--color-content-action-secondary);
|
|
531
531
|
font-size: var(--font-size-200);
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
height: 1px;
|
|
613
613
|
}
|
|
614
614
|
/* End of underline effect */
|
|
615
|
-
`;M([a({type:String})],
|
|
615
|
+
`;M([a({type:String})],_.prototype,"href",2);M([a({type:String})],_.prototype,"target",2);M([a({type:String,reflect:!0})],_.prototype,"template",2);M([a({type:Boolean,reflect:!0})],_.prototype,"inverse",2);M([a({type:Boolean,reflect:!0})],_.prototype,"endIcon",2);M([a({type:Boolean,reflect:!0})],_.prototype,"reverseEndIcon",2);_=M([T("o-link")],_);var Ce=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,et=(s,t,e,n)=>{for(var o=n>1?void 0:n?Le(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&Ce(t,e,o),o};let N=class extends m{constructor(){super(...arguments),this.rating=0}getStarKeys(){const s=[];for(let t=0;t<5;t++){const e=this.rating-t;let n;e>=1?n=100:e<=0?n=0:n=Math.round(e*100/25)*25,s.push(`star-${n}`)}return s}render(){const s=this.getStarKeys();return d`
|
|
616
616
|
<div class="rating">
|
|
617
617
|
<div class="stars">
|
|
618
618
|
${s.map(t=>d`<span class="star">${Q(ft[t]??"")}</span>`)}
|
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
text-decoration: underline;
|
|
653
653
|
cursor: pointer;
|
|
654
654
|
}
|
|
655
|
-
`;et([a({type:Number})],N.prototype,"rating",2);et([a({type:String})],N.prototype,"reviewCount",2);et([a({type:String})],N.prototype,"href",2);N=et([
|
|
655
|
+
`;et([a({type:Number})],N.prototype,"rating",2);et([a({type:String})],N.prototype,"reviewCount",2);et([a({type:String})],N.prototype,"href",2);N=et([T("o-rating")],N);var Pe=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,y=(s,t,e,n)=>{for(var o=n>1?void 0:n?ke(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&Pe(t,e,o),o};let g=class extends m{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.headerTitle="",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.secondaryButtonLabel="",this.secondaryButtonVariant="secondary",this.disablePortal=!1,this.previousFocusedElement=null,this.handleKeyDown=s=>{this.open&&(s.key==="Escape"?this.closePanel():s.key==="Tab"&&this.trapFocus(s))}}connectedCallback(){super.connectedCallback(),!this.disablePortal&&this.parentElement!==document.body&&document.body.appendChild(this),window.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),window.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback()}trapFocus(s){const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],n=t[t.length-1];s.shiftKey&&document.activeElement===e?(s.preventDefault(),n.focus()):!s.shiftKey&&document.activeElement===n&&(s.preventDefault(),e.focus())}getFocusableElements(){const s=this.renderRoot.querySelector(".panel");return s?Array.from(s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(t=>!t.hasAttribute("disabled")):[]}openPanel(){this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open"),this.updateComplete.then(()=>{const s=this.getFocusableElements()[0];s==null||s.focus()})}closePanel(){var s;this.open=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),(s=this.previousFocusedElement)==null||s.focus(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(){typeof this.onFirstButtonClick=="function"&&this.onFirstButtonClick(),this.closePanel()}handleSecondaryClick(){typeof this.onSecondaryButtonClick=="function"&&this.onSecondaryButtonClick(),this.closePanel()}render(){return d`
|
|
656
656
|
<div class="overlay" @click=${this.closePanel}></div>
|
|
657
657
|
<div
|
|
658
658
|
class="panel"
|
|
@@ -787,26 +787,26 @@
|
|
|
787
787
|
max-width: none;
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
|
-
`;y([a({type:Boolean,reflect:!0})],g.prototype,"open",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeader",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showFooter",2);y([a({type:String,reflect:!0})],g.prototype,"headerTitle",2);y([a({type:String,reflect:!0})],g.prototype,"closeButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonVariant",2);y([a({type:Function})],g.prototype,"onFirstButtonClick",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonVariant",2);y([a({type:Function})],g.prototype,"onSecondaryButtonClick",2);y([a({type:Boolean,reflect:!0})],g.prototype,"disablePortal",2);g=y([
|
|
790
|
+
`;y([a({type:Boolean,reflect:!0})],g.prototype,"open",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showHeader",2);y([a({type:Boolean,reflect:!0})],g.prototype,"showFooter",2);y([a({type:String,reflect:!0})],g.prototype,"headerTitle",2);y([a({type:String,reflect:!0})],g.prototype,"closeButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"firstButtonVariant",2);y([a({type:Function})],g.prototype,"onFirstButtonClick",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonLabel",2);y([a({type:String,reflect:!0})],g.prototype,"secondaryButtonVariant",2);y([a({type:Function})],g.prototype,"onSecondaryButtonClick",2);y([a({type:Boolean,reflect:!0})],g.prototype,"disablePortal",2);g=y([T("o-side-panel")],g);var Be=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,P=(s,t,e,n)=>{for(var o=n>1?void 0:n?Ie(t,e):t,r=s.length-1,i;r>=0;r--)(i=s[r])&&(o=(n?i(t,e,o):i(o))||o);return n&&o&&Be(t,e,o),o};let w=class extends m{constructor(){super(...arguments),this.thumbnails=[],this.activeIndex=0,this.disabledIndexes=[],this.maxWidth="100%",this.focusedIndex=0}handleKeyDown(s){s.key==="ArrowRight"?(s.preventDefault(),this.focusNext()):s.key==="ArrowLeft"?(s.preventDefault(),this.focusPrevious()):(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this.selectThumbnail(this.focusedIndex))}focusNext(){let s=this.focusedIndex+1;for(;this.disabledIndexes.includes(s)&&s<this.thumbnails.length;)s++;s<this.thumbnails.length&&(this.focusedIndex=s,this.focusThumbnail(s))}focusPrevious(){let s=this.focusedIndex-1;for(;this.disabledIndexes.includes(s)&&s>=0;)s--;s>=0&&(this.focusedIndex=s,this.focusThumbnail(s))}focusThumbnail(s){const t=this.renderRoot.querySelector(`[data-index="${s}"]`);t==null||t.focus()}selectThumbnail(s){this.disabledIndexes.includes(s)||(this.activeIndex=s,this.swiperInstance&&typeof this.swiperInstance.slideTo=="function"&&this.swiperInstance.slideTo(s),this.dispatchEvent(new CustomEvent("thumbnail-select",{detail:{index:s}})))}render(){return d`
|
|
791
791
|
<div class="scroll-container" style="max-width: ${this.maxWidth};">
|
|
792
|
-
${this.thumbnails.map((s,t)=>{const e=this.disabledIndexes.includes(t),
|
|
792
|
+
${this.thumbnails.map((s,t)=>{const e=this.disabledIndexes.includes(t),n=this.activeIndex===t,o=s.type==="video";return d`
|
|
793
793
|
<div class="thumb-wrapper">
|
|
794
794
|
<button
|
|
795
795
|
class="thumb"
|
|
796
796
|
data-index="${t}"
|
|
797
797
|
?disabled=${e}
|
|
798
|
-
aria-selected=${
|
|
798
|
+
aria-selected=${n}
|
|
799
799
|
tabindex="${this.focusedIndex===t?0:-1}"
|
|
800
800
|
@click=${()=>this.selectThumbnail(t)}
|
|
801
801
|
@keydown=${this.handleKeyDown}
|
|
802
802
|
>
|
|
803
803
|
<img src="${s.src}" />
|
|
804
804
|
</button>
|
|
805
|
-
${
|
|
805
|
+
${o&&this.playIcon?d`<div class="play-icon-wrapper">${this.playIcon}</div>`:null}
|
|
806
806
|
</div>
|
|
807
807
|
`})}
|
|
808
808
|
</div>
|
|
809
|
-
`}};
|
|
809
|
+
`}};w.styles=A`
|
|
810
810
|
:host {
|
|
811
811
|
display: flex;
|
|
812
812
|
gap: 8px;
|
|
@@ -878,4 +878,4 @@
|
|
|
878
878
|
background-color: var(--color-border-normal, #ccc);
|
|
879
879
|
border-radius: 3px;
|
|
880
880
|
}
|
|
881
|
-
`;
|
|
881
|
+
`;P([a({type:Array})],w.prototype,"thumbnails",2);P([a({type:Number})],w.prototype,"activeIndex",2);P([a({type:Array})],w.prototype,"disabledIndexes",2);P([a({type:Object})],w.prototype,"playIcon",2);P([a({type:String})],w.prototype,"maxWidth",2);P([a({type:Object})],w.prototype,"swiperInstance",2);P([Qt()],w.prototype,"focusedIndex",2);w=P([T("thumbnail-navigation")],w);
|