UNPKG

@relewise/web-components

Version:

Relewise is a next generation personalization SaaS-platform, which offers functionality within product- and content recommendations and personalized search. Our official Web Components provide simple and easy components for rendering personalized experien

203 lines (191 loc) 212 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RelewiseWebComponents={})}(this,(function(e){"use strict";function t(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o}"function"==typeof SuppressedError&&SuppressedError; /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const i=window,s=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(t,e))}return e}toString(){return this.cssText}};const l=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new o("string"==typeof e?e:e+"",void 0,r))(t)})(e):e /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */;var a;const d=window,c=d.trustedTypes,u=c?c.emptyScript:"",h=d.reactiveElementPolyfillSupport,p={toAttribute(e,t){switch(t){case Boolean:e=e?u:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},v=(e,t)=>t!==e&&(t==t||e==e),y={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:v},w="finalized";let g=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const s=this._$Ep(i,t);void 0!==s&&(this._$Ev.set(s,i),e.push(s))})),e}static createProperty(e,t=y){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){const r=this[e];this[t]=s,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||y}static finalize(){if(this.hasOwnProperty(w))return!1;this[w]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{s?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const s=document.createElement("style"),r=i.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=t.cssText,e.appendChild(s)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=y){var s;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:p).toAttribute(t,i.type);this._$El=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(e,t){var i;const s=this.constructor,r=s._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=s.getPropertyOptions(r),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:p;this._$El=r,this[r]=n.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let s=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||v)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var f;g[w]=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:g}),(null!==(a=d.reactiveElementVersions)&&void 0!==a?a:d.reactiveElementVersions=[]).push("1.6.3");const m=window,b=m.trustedTypes,C=b?b.createPolicy("lit-html",{createHTML:e=>e}):void 0,R="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,S="?"+$,P=`<${S}>`,A=document,F=()=>A.createComment(""),B=e=>null===e||"object"!=typeof e&&"function"!=typeof e,_=Array.isArray,k="[ \t\n\f\r]",x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,D=/>/g,I=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,q=/"/g,T=/^(?:script|style|textarea|title)$/i,M=Symbol.for("lit-noChange"),O=Symbol.for("lit-nothing"),U=new WeakMap,H=A.createTreeWalker(A,129,null,!1);function N(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}let L=class e{constructor({strings:t,_$litType$:i},s){let r;this.parts=[];let n=0,o=0;const l=t.length-1,a=this.parts,[d,c]=((e,t)=>{const i=e.length-1,s=[];let r,n=2===t?"<svg>":"",o=x;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===x?"!--"===a[1]?o=E:void 0!==a[1]?o=D:void 0!==a[2]?(T.test(a[2])&&(r=RegExp("</"+a[2],"g")),o=I):void 0!==a[3]&&(o=I):o===I?">"===a[0]?(o=null!=r?r:x,d=-1):void 0===a[1]?d=-2:(d=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?I:'"'===a[3]?q:V):o===q||o===V?o=I:o===E||o===D?o=x:(o=I,r=void 0);const u=o===I&&e[t+1].startsWith("/>")?" ":"";n+=o===x?i+P:d>=0?(s.push(l),i.slice(0,d)+R+i.slice(d)+$+u):i+$+(-2===d?(s.push(void 0),t):u)}return[N(e,n+(e[i]||"<?>")+(2===t?"</svg>":"")),s]})(t,i);if(this.el=e.createElement(d,s),H.currentNode=this.el.content,2===i){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(r=H.nextNode())&&a.length<l;){if(1===r.nodeType){if(r.hasAttributes()){const e=[];for(const t of r.getAttributeNames())if(t.endsWith(R)||t.startsWith($)){const i=c[o++];if(e.push(t),void 0!==i){const e=r.getAttribute(i.toLowerCase()+R).split($),t=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:t[2],strings:e,ctor:"."===t[1]?Q:"?"===t[1]?J:"@"===t[1]?Y:W})}else a.push({type:6,index:n})}for(const t of e)r.removeAttribute(t)}if(T.test(r.tagName)){const e=r.textContent.split($),t=e.length-1;if(t>0){r.textContent=b?b.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],F()),H.nextNode(),a.push({type:2,index:++n});r.append(e[t],F())}}}else if(8===r.nodeType)if(r.data===S)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=r.data.indexOf($,e+1));)a.push({type:7,index:n}),e+=$.length-1}n++}}static createElement(e,t){const i=A.createElement("template");return i.innerHTML=e,i}};function j(e,t,i=e,s){var r,n,o,l;if(t===M)return t;let a=void 0!==s?null===(r=i._$Co)||void 0===r?void 0:r[s]:i._$Cl;const d=B(t)?void 0:t._$litDirective$;return(null==a?void 0:a.constructor)!==d&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===d?a=void 0:(a=new d(e),a._$AT(e,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(t=j(e,a._$AS(e,t.values),a,s)),t}let K=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:i},parts:s}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:A).importNode(i,!0);H.currentNode=r;let n=H.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new z(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new X(n,this,e)),this._$AV.push(t),a=s[++l]}o!==(null==a?void 0:a.index)&&(n=H.nextNode(),o++)}return H.currentNode=A,r}v(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},z=class e{constructor(e,t,i,s){var r;this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cp=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=j(this,e,t),B(e)?e===O||null==e||""===e?(this._$AH!==O&&this._$AR(),this._$AH=O):e!==this._$AH&&e!==M&&this._(e):void 0!==e._$litType$?this.g(e):void 0!==e.nodeType?this.$(e):(e=>_(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==O&&B(this._$AH)?this._$AA.nextSibling.data=e:this.$(A.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:s}=e,r="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=L.createElement(N(s.h,s.h[0]),this.options)),s);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.v(i);else{const e=new K(r,this),t=e.u(this.options);e.v(i),this.$(t),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new L(e)),t}T(t){_(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const n of t)r===i.length?i.push(s=new e(this.k(F()),this.k(F()),this,this.options)):s=i[r],s._$AI(n),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cp=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}},W=class{constructor(e,t,i,s,r){this.type=1,this._$AH=O,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=O}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){const r=this.strings;let n=!1;if(void 0===r)e=j(this,e,t,0),n=!B(e)||e!==this._$AH&&e!==M,n&&(this._$AH=e);else{const s=e;let o,l;for(e=r[0],o=0;o<r.length-1;o++)l=j(this,s[i+o],t,o),l===M&&(l=this._$AH[o]),n||(n=!B(l)||l!==this._$AH[o]),l===O?e=O:e!==O&&(e+=(null!=l?l:"")+r[o+1]),this._$AH[o]=l}n&&!s&&this.j(e)}j(e){e===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}},Q=class extends W{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===O?void 0:e}};const Z=b?b.emptyScript:"";let J=class extends W{constructor(){super(...arguments),this.type=4}j(e){e&&e!==O?this.element.setAttribute(this.name,Z):this.element.removeAttribute(this.name)}},Y=class extends W{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=j(this,e,t,0))&&void 0!==i?i:O)===M)return;const s=this._$AH,r=e===O&&s!==O||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==O&&(s===O||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}},X=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){j(this,e)}};const G=m.litHtmlPolyfillSupport;null==G||G(L,z),(null!==(f=m.litHtmlVersions)&&void 0!==f?f:m.litHtmlVersions=[]).push("2.8.0"); /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const ee=window,te=ee.ShadowRoot&&(void 0===ee.ShadyCSS||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ie=Symbol(),se=new WeakMap;let re=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==ie)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(te&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=se.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&se.set(t,e))}return e}toString(){return this.cssText}};const ne=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1]),e[0]);return new re(i,e,ie)},oe=te?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new re("string"==typeof e?e:e+"",void 0,ie))(t)})(e):e /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */;var le;const ae=window,de=ae.trustedTypes,ce=de?de.emptyScript:"",ue=ae.reactiveElementPolyfillSupport,he={toAttribute(e,t){switch(t){case Boolean:e=e?ce:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},pe=(e,t)=>t!==e&&(t==t||e==e),ve={attribute:!0,type:String,converter:he,reflect:!1,hasChanged:pe},ye="finalized";let we=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const s=this._$Ep(i,t);void 0!==s&&(this._$Ev.set(s,i),e.push(s))})),e}static createProperty(e,t=ve){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,i,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(s){const r=this[e];this[t]=s,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ve}static finalize(){if(this.hasOwnProperty(ye))return!1;this[ye]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(oe(e))}else void 0!==e&&t.push(oe(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{te?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const i=document.createElement("style"),s=ee.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=t.cssText,e.appendChild(i)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=ve){var s;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:he).toAttribute(t,i.type);this._$El=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(e,t){var i;const s=this.constructor,r=s._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=s.getPropertyOptions(r),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:he;this._$El=r,this[r]=n.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let s=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||pe)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var ge;we[ye]=!0,we.elementProperties=new Map,we.elementStyles=[],we.shadowRootOptions={mode:"open"},null==ue||ue({ReactiveElement:we}),(null!==(le=ae.reactiveElementVersions)&&void 0!==le?le:ae.reactiveElementVersions=[]).push("1.6.3");const fe=window,me=fe.trustedTypes,be=me?me.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ce="$lit$",Re=`lit$${(Math.random()+"").slice(9)}$`,$e="?"+Re,Se=`<${$e}>`,Pe=document,Ae=()=>Pe.createComment(""),Fe=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Be=Array.isArray,_e="[ \t\n\f\r]",ke=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xe=/-->/g,Ee=/>/g,De=RegExp(`>|${_e}(?:([^\\s"'>=/]+)(${_e}*=${_e}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ie=/'/g,Ve=/"/g,qe=/^(?:script|style|textarea|title)$/i,Te=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),Me=Symbol.for("lit-noChange"),Oe=Symbol.for("lit-nothing"),Ue=new WeakMap,He=Pe.createTreeWalker(Pe,129,null,!1);function Ne(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==be?be.createHTML(t):t}let Le=class e{constructor({strings:t,_$litType$:i},s){let r;this.parts=[];let n=0,o=0;const l=t.length-1,a=this.parts,[d,c]=((e,t)=>{const i=e.length-1,s=[];let r,n=2===t?"<svg>":"",o=ke;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===ke?"!--"===a[1]?o=xe:void 0!==a[1]?o=Ee:void 0!==a[2]?(qe.test(a[2])&&(r=RegExp("</"+a[2],"g")),o=De):void 0!==a[3]&&(o=De):o===De?">"===a[0]?(o=null!=r?r:ke,d=-1):void 0===a[1]?d=-2:(d=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?De:'"'===a[3]?Ve:Ie):o===Ve||o===Ie?o=De:o===xe||o===Ee?o=ke:(o=De,r=void 0);const u=o===De&&e[t+1].startsWith("/>")?" ":"";n+=o===ke?i+Se:d>=0?(s.push(l),i.slice(0,d)+Ce+i.slice(d)+Re+u):i+Re+(-2===d?(s.push(void 0),t):u)}return[Ne(e,n+(e[i]||"<?>")+(2===t?"</svg>":"")),s]})(t,i);if(this.el=e.createElement(d,s),He.currentNode=this.el.content,2===i){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(r=He.nextNode())&&a.length<l;){if(1===r.nodeType){if(r.hasAttributes()){const e=[];for(const t of r.getAttributeNames())if(t.endsWith(Ce)||t.startsWith(Re)){const i=c[o++];if(e.push(t),void 0!==i){const e=r.getAttribute(i.toLowerCase()+Ce).split(Re),t=/([.?@])?(.*)/.exec(i);a.push({type:1,index:n,name:t[2],strings:e,ctor:"."===t[1]?Qe:"?"===t[1]?Je:"@"===t[1]?Ye:We})}else a.push({type:6,index:n})}for(const t of e)r.removeAttribute(t)}if(qe.test(r.tagName)){const e=r.textContent.split(Re),t=e.length-1;if(t>0){r.textContent=me?me.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],Ae()),He.nextNode(),a.push({type:2,index:++n});r.append(e[t],Ae())}}}else if(8===r.nodeType)if(r.data===$e)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=r.data.indexOf(Re,e+1));)a.push({type:7,index:n}),e+=Re.length-1}n++}}static createElement(e,t){const i=Pe.createElement("template");return i.innerHTML=e,i}};function je(e,t,i=e,s){var r,n,o,l;if(t===Me)return t;let a=void 0!==s?null===(r=i._$Co)||void 0===r?void 0:r[s]:i._$Cl;const d=Fe(t)?void 0:t._$litDirective$;return(null==a?void 0:a.constructor)!==d&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===d?a=void 0:(a=new d(e),a._$AT(e,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(t=je(e,a._$AS(e,t.values),a,s)),t}let Ke=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:i},parts:s}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:Pe).importNode(i,!0);He.currentNode=r;let n=He.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new ze(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Xe(n,this,e)),this._$AV.push(t),a=s[++l]}o!==(null==a?void 0:a.index)&&(n=He.nextNode(),o++)}return He.currentNode=Pe,r}v(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},ze=class e{constructor(e,t,i,s){var r;this.type=2,this._$AH=Oe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cp=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=je(this,e,t),Fe(e)?e===Oe||null==e||""===e?(this._$AH!==Oe&&this._$AR(),this._$AH=Oe):e!==this._$AH&&e!==Me&&this._(e):void 0!==e._$litType$?this.g(e):void 0!==e.nodeType?this.$(e):(e=>Be(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Oe&&Fe(this._$AH)?this._$AA.nextSibling.data=e:this.$(Pe.createTextNode(e)),this._$AH=e}g(e){var t;const{values:i,_$litType$:s}=e,r="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=Le.createElement(Ne(s.h,s.h[0]),this.options)),s);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.v(i);else{const e=new Ke(r,this),t=e.u(this.options);e.v(i),this.$(t),this._$AH=e}}_$AC(e){let t=Ue.get(e.strings);return void 0===t&&Ue.set(e.strings,t=new Le(e)),t}T(t){Be(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,r=0;for(const n of t)r===i.length?i.push(s=new e(this.k(Ae()),this.k(Ae()),this,this.options)):s=i[r],s._$AI(n),r++;r<i.length&&(this._$AR(s&&s._$AB.nextSibling,r),i.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cp=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}},We=class{constructor(e,t,i,s,r){this.type=1,this._$AH=Oe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Oe}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,s){const r=this.strings;let n=!1;if(void 0===r)e=je(this,e,t,0),n=!Fe(e)||e!==this._$AH&&e!==Me,n&&(this._$AH=e);else{const s=e;let o,l;for(e=r[0],o=0;o<r.length-1;o++)l=je(this,s[i+o],t,o),l===Me&&(l=this._$AH[o]),n||(n=!Fe(l)||l!==this._$AH[o]),l===Oe?e=Oe:e!==Oe&&(e+=(null!=l?l:"")+r[o+1]),this._$AH[o]=l}n&&!s&&this.j(e)}j(e){e===Oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}};class Qe extends We{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Oe?void 0:e}}const Ze=me?me.emptyScript:"";class Je extends We{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Oe?this.element.setAttribute(this.name,Ze):this.element.removeAttribute(this.name)}}let Ye=class extends We{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=je(this,e,t,0))&&void 0!==i?i:Oe)===Me)return;const s=this._$AH,r=e===Oe&&s!==Oe||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==Oe&&(s===Oe||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}},Xe=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){je(this,e)}};const Ge=fe.litHtmlPolyfillSupport;null==Ge||Ge(Le,ze),(null!==(ge=fe.litHtmlVersions)&&void 0!==ge?ge:fe.litHtmlVersions=[]).push("2.8.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ var et,tt;let it=class extends we{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var s,r;const n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:t;let o=n._$litPart$;if(void 0===o){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=o=new ze(t.insertBefore(Ae(),e),e,void 0,null!=i?i:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return Me}};it.finalized=!0,it._$litElement$=!0,null===(et=globalThis.litElementHydrateSupport)||void 0===et||et.call(globalThis,{LitElement:it});const st=globalThis.litElementPolyfillSupport;null==st||st({LitElement:it}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.3.3"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const rt=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function nt(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):rt(e,t) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */}function ot(e){return nt({...e,state:!0})} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var lt;function at(){const e=window.relewiseUIOptions;if(!(e&&e.datasetId&&e.apiKey&&e.contextSettings))throw new Error("Relewise UI not correctly configured");return e}function dt(){return window.relewiseUISearchOptions}function ct(){return window.relewiseUISearchTargetedConfigurations}function ut(){return window.relewiseUIRecommendationTargetedConfigurations}function ht(e){const t=at().contextSettings;return{currency:t.currency,displayedAtLocation:e,language:t.language,user:t.getUser()}}function pt(e){if(!e)return"";const t=at().contextSettings;try{return new Intl.NumberFormat(t.language,{style:"currency",currency:t.currency}).format(Number(e))}catch{return e}}null===(lt=window.HTMLSlotElement)||void 0===lt||lt.prototype.assignedElements;const vt=ne` :host { --font: var(--relewise-font, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); --color: var(--relewise-color, #eee); --accent-color:var(--relewise-accent-color, #3764e4); --relewise-icon-color: var(--color); --relewise-x-icon-color: var(--color); --border-radius: var(--relewise-border-radius, 1rem); --border: var(--relewise-border, 2px solid) } .rw-button { margin: 0; padding: 0; font-family: var(--font); height: var(--relewise-button-height, 3rem); border: var(--border); border-radius: var(--border-radius); border-color: var(--accent-color); background-color: var(--accent-color); font-size: var(--relewise-button-font-size, 1rem); } .rw-border { border: var(--border); border-radius: var(--border-radius) } ` /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */,yt=globalThis,wt=yt.trustedTypes,gt=wt?wt.createPolicy("lit-html",{createHTML:e=>e}):void 0,ft="$lit$",mt=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+mt,Ct=`<${bt}>`,Rt=document,$t=()=>Rt.createComment(""),St=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Pt=Array.isArray,At="[ \t\n\f\r]",Ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Bt=/-->/g,_t=/>/g,kt=RegExp(`>|${At}(?:([^\\s"'>=/]+)(${At}*=${At}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,Et=/"/g,Dt=/^(?:script|style|textarea|title)$/i,It=Symbol.for("lit-noChange"),Vt=Symbol.for("lit-nothing"),qt=new WeakMap,Tt=Rt.createTreeWalker(Rt,129);function Mt(e,t){if(!Pt(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==gt?gt.createHTML(t):t}class Ot{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,n=0;const o=e.length-1,l=this.parts,[a,d]=((e,t)=>{const i=e.length-1,s=[];let r,n=2===t?"<svg>":3===t?"<math>":"",o=Ft;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===Ft?"!--"===a[1]?o=Bt:void 0!==a[1]?o=_t:void 0!==a[2]?(Dt.test(a[2])&&(r=RegExp("</"+a[2],"g")),o=kt):void 0!==a[3]&&(o=kt):o===kt?">"===a[0]?(o=r??Ft,d=-1):void 0===a[1]?d=-2:(d=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?kt:'"'===a[3]?Et:xt):o===Et||o===xt?o=kt:o===Bt||o===_t?o=Ft:(o=kt,r=void 0);const u=o===kt&&e[t+1].startsWith("/>")?" ":"";n+=o===Ft?i+Ct:d>=0?(s.push(l),i.slice(0,d)+ft+i.slice(d)+mt+u):i+mt+(-2===d?t:u)}return[Mt(e,n+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=Ot.createElement(a,i),Tt.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Tt.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(ft)){const t=d[n++],i=s.getAttribute(e).split(mt),o=/([.?@])?(.*)/.exec(t);l.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?jt:"?"===o[1]?Kt:"@"===o[1]?zt:Lt}),s.removeAttribute(e)}else e.startsWith(mt)&&(l.push({type:6,index:r}),s.removeAttribute(e));if(Dt.test(s.tagName)){const e=s.textContent.split(mt),t=e.length-1;if(t>0){s.textContent=wt?wt.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],$t()),Tt.nextNode(),l.push({type:2,index:++r});s.append(e[t],$t())}}}else if(8===s.nodeType)if(s.data===bt)l.push({type:2,index:r});else{let e=-1;for(;-1!==(e=s.data.indexOf(mt,e+1));)l.push({type:7,index:r}),e+=mt.length-1}r++}}static createElement(e,t){const i=Rt.createElement("template");return i.innerHTML=e,i}}function Ut(e,t,i=e,s){if(t===It)return t;let r=void 0!==s?i.o?.[s]:i.l;const n=St(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),void 0===n?r=void 0:(r=new n(e),r._$AT(e,i,s)),void 0!==s?(i.o??=[])[s]=r:i.l=r),void 0!==r&&(t=Ut(e,r._$AS(e,t.values),r,s)),t}class Ht{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??Rt).importNode(t,!0);Tt.currentNode=s;let r=Tt.nextNode(),n=0,o=0,l=i[0];for(;void 0!==l;){if(n===l.index){let t;2===l.type?t=new Nt(r,r.nextSibling,this,e):1===l.type?t=new l.ctor(r,l.name,l.strings,this,e):6===l.type&&(t=new Wt(r,this,e)),this._$AV.push(t),l=i[++o]}n!==l?.index&&(r=Tt.nextNode(),n++)}return Tt.currentNode=Rt,s}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Nt{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,i,s){this.type=2,this._$AH=Vt,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this.v=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ut(this,e,t),St(e)?e===Vt||null==e||""===e?(this._$AH!==Vt&&this._$AR(),this._$AH=Vt):e!==this._$AH&&e!==It&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>Pt(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Vt&&St(this._$AH)?this._$AA.nextSibling.data=e:this.T(Rt.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Ot.createElement(Mt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new Ht(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=qt.get(e.strings);return void 0===t&&qt.set(e.strings,t=new Ot(e)),t}k(e){Pt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const r of e)s===t.length?t.push(i=new Nt(this.O($t()),this.O($t()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class Lt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=Vt,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Vt}_$AI(e,t=this,i,s){const r=this.strings;let n=!1;if(void 0===r)e=Ut(this,e,t,0),n=!St(e)||e!==this._$AH&&e!==It,n&&(this._$AH=e);else{const s=e;let o,l;for(e=r[0],o=0;o<r.length-1;o++)l=Ut(this,s[i+o],t,o),l===It&&(l=this._$AH[o]),n||=!St(l)||l!==this._$AH[o],l===Vt?e=Vt:e!==Vt&&(e+=(l??"")+r[o+1]),this._$AH[o]=l}n&&!s&&this.j(e)}j(e){e===Vt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class jt extends Lt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Vt?void 0:e}}class Kt extends Lt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Vt)}}class zt extends Lt{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=Ut(this,e,t,0)??Vt)===It)return;const i=this._$AH,s=e===Vt&&i!==Vt||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Vt&&(i===Vt||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Wt{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Ut(this,e)}}const Qt=yt.litHtmlPolyfillSupport;Qt?.(Ot,Nt),(yt.litHtmlVersions??=[]).push("3.2.0"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const Zt=2,Jt=e=>(...t)=>({_$litDirective$:e,values:t});let Yt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this.t=e,this._$AM=t,this.i=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class Xt extends Yt{constructor(e){if(super(e),this.it=Vt,e.type!==Zt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Vt||null==e)return this._t=void 0,this.it=e;if(e===It)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Xt.directiveName="unsafeHTML",Xt.resultType=1;const Gt=Jt(Xt),ei=(e,t)=>{const i=e._$AN;if(void 0===i)return!1;for(const e of i)e._$AO?.(t,!1),ei(e,t);return!0},ti=e=>{let t,i;do{if(void 0===(t=e._$AM))break;i=t._$AN,i.delete(e),e=t}while(0===i?.size)},ii=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),ni(t)}}; /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function si(e){void 0!==this._$AN?(ti(this),this._$AM=e,ii(this)):this._$AM=e}function ri(e,t=!1,i=0){const s=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(s))for(let e=i;e<s.length;e++)ei(s[e],!1),ti(s[e]);else null!=s&&(ei(s,!1),ti(s));else ei(this,e)}const ni=e=>{e.type==Zt&&(e._$AP??=ri,e._$AQ??=si)};class oi extends Yt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),ii(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(ei(this,e),ti(this))}setValue(e){if((e=>void 0===e.strings) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */(this.t))this.t._$AI(e,this);else{const t=[...this.t._$AH];t[this.i]=e,this.t._$AI(t,this,0)}}disconnected(){}reconnected(){}} /** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class li{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}}class ai{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise((e=>this.q=e))}resume(){this.q?.(),this.Z=this.q=void 0}} /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const di=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,ci=1073741823;const ui=Jt(class extends oi{constructor(){super(...arguments),this.wt=ci,this.bt=[],this.K=new li(this),this.X=new ai}render(...e){return e.find((e=>!di(e)))??It}update(e,t){const i=this.bt;let s=i.length;this.bt=t;const r=this.K,n=this.X;this.isConnected||this.disconnected();for(let e=0;e<t.length&&!(e>this.wt);e++){const o=t[e];if(!di(o))return this.wt=e,o;e<s&&o===i[e]||(this.wt=ci,s=0,Promise.resolve(o).then((async e=>{for(;n.get();)await n.get();const t=r.deref();if(void 0!==t){const i=t.bt.indexOf(o);i>-1&&i<t.wt&&(t.wt=i,t.setValue(e))}})))}return It}disconnected(){this.K.disconnect(),this.X.pause()}reconnected(){this.K.reconnect(this),this.X.resume()}});class hi extends it{constructor(){super(...arguments),this.product=null}connectedCallback(){super.connectedCallback()}render(){if(!this.product)return;const e=at();return e.templates?.product?Te` ${ui(e.templates.product(this.product,{html:Te,helpers:{formatPrice:pt,unsafeHTML:Gt}}).then((e=>e)))} `:this.product.data&&"Url"in this.product.data?Te` <a class='rw-tile' href=${this.product.data.Url.value??""}> ${this.renderTileContent(this.product)} </a>`:Te` <div class='rw-tile'> ${this.renderTileContent(this.product)} </div>`}renderTileContent(e){return Te` ${e.data&&"ImageUrl"in e.data?Te`<div class="rw-image-container"><img class="rw-object-cover" src=${e.data.ImageUrl.value} /></div>`:Oe} <div class='rw-information-container'> <h5 class='rw-display-name'>${e.displayName}</h5> <div class='rw-price'> <span>${pt(e.salesPrice)}</span> ${e.salesPrice&&e.listPrice&&e.listPrice!==e.salesPrice?Te`<span class='rw-list-price'>${pt(e.listPrice)}</span>`:Oe} </div> </div>`}static{this.styles=[vt,ne` :host { font-family: var(--font); } .rw-tile { display: flex; flex-direction: column; position: relative; text-decoration: inherit; text-size-adjust: none; } .rw-image-container { display: flex; padding: var(--relewise-image-padding, 0); background-color: var(--relewise-image-background-color, #fff); justify-content: var(--relewise-image-align, center); } .rw-information-container { margin: var(--relewise-information-container-margin, 0.5rem 0); } .rw-object-cover { object-fit: contain; max-width: var(--relewise-image-width, 100%); height: var(--relewise-image-height, auto); } .rw-price { line-height: 1; display: flex; font-weight: var(--relewise-sales-price-font-weight, 600); font-size: var(--relewise-sales-price-font-size, 1.25rem); color: var(--relewise-sales-price-color, #212427); justify-content: var(--relewise-sales-price-alignment, start); margin: var(--relewise-sales-price-margin, 0.5rem 0rem 0rem 0rem); } .rw-display-name { display: flex; letter-spacing: var(--relewise-display-name-letter-spacing, -0.025rem); justify-content: var(--relewise-display-name-alignment, start); color: var(--relewise-display-name-color, #212427); line-height: var(--relewise-display-name-line-height, 1.25rem); font-weight: var(--relewise-display-name-font-weight, 600); font-size: var(--relewise-display-name-font-size, 1rem); margin: var(--relewise-display-name-margin, 0rem 0rem 0rem 0rem); } .rw-list-price { font-size: var(--relewise-list-price-font-size, .8rem); text-decoration: var(--relewise-list-price-text-decoration, line-through); color: var(--relewise-list-price-color, darkgray); margin: var(--relewise-list-price-margin, .25rem); } `]}}t([nt({type:Object})],hi.prototype,"product",void 0);class pi extends it{connectedCallback(){super.connectedCallback()}render(){return Te` <svg id="svg-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="122.879px" height="119.799px" viewBox="0 0 122.879 119.799" enable-background="new 0 0 122.879 119.799" xml:space="preserve"> <g> <path d="M49.988,0h0.016v0.007C63.803,0.011,76.298,5.608,85.34,14.652c9.027,9.031,14.619,21.515,14.628,35.303h0.007v0.033v0.04 h-0.007c-0.005,5.557-0.917,10.905-2.594,15.892c-0.281,0.837-0.575,1.641-0.877,2.409v0.007c-1.446,3.66-3.315,7.12-5.547,10.307 l29.082,26.139l0.018,0.016l0.157,0.146l0.011,0.011c1.642,1.563,2.536,3.656,2.649,5.78c0.11,2.1-0.543,4.248-1.979,5.971 l-0.011,0.016l-0.175,0.203l-0.035,0.035l-0.146,0.16l-0.016,0.021c-1.565,1.642-3.654,2.534-5.78,2.646 c-2.097,0.111-4.247-0.54-5.971-1.978l-0.015-0.011l-0.204-0.175l-0.029-0.024L78.761,90.865c-0.88,0.62-1.778,1.209-2.687,1.765 c-1.233,0.755-2.51,1.466-3.813,2.115c-6.699,3.342-14.269,5.222-22.272,5.222v0.007h-0.016v-0.007 c-13.799-0.004-26.296-5.601-35.338-14.645C5.605,76.291,0.016,63.805,0.007,50.021H0v-0.033v-0.016h0.007 c0.004-13.799,5.601-26.296,14.645-35.338C23.683,5.608,36.167,0.016,49.955,0.007V0H49.988L49.988,0z M50.004,11.21v0.007h-0.016 h-0.033V11.21c-10.686,0.007-20.372,4.35-27.384,11.359C15.56,29.578,11.213,39.274,11.21,49.973h0.007v0.016v0.033H11.21 c0.007,10.686,4.347,20.367,11.359,27.381c7.009,7.012,16.705,11.359,27.403,11.361v-0.007h0.016h0.033v0.007 c10.686-0.007,20.368-4.348,27.382-11.359c7.011-7.009,11.358-16.702,11.36-27.4h-0.006v-0.016v-0.033h0.006 c-0.006-10.686-4.35-20.372-11.358-27.384C70.396,15.56,60.703,11.213,50.004,11.21L50.004,11.21z"/> </g> </svg>`}static{this.styles=ne` #svg-icon { width: var(--re