@vtex/ads-stories 0.7.0 → 0.8.0
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/CHANGELOG.md +6 -0
- package/dist/cdn/vtex-ads-stories.js +8 -8
- package/dist/cdn/vtex-ads-stories.js.map +1 -1
- package/dist/cjs/index.cjs +25 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/react.cjs.map +1 -1
- package/dist/cjs/react.d.cts +7 -3
- package/dist/cjs/{story-DAiAN9v-.d.cts → story-Ba9J0rbL.d.cts} +18 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +25 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react.d.ts +7 -3
- package/dist/esm/{story-DAiAN9v-.d.ts → story-Ba9J0rbL.d.ts} +18 -2
- package/package.json +1 -1
- package/src/locales/index.ts +6 -0
- package/src/react.ts +6 -2
- package/src/story/story.ts +30 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @vtex/ads-stories
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8184763: `label-unavailable` and `label-sold-out` replace the disabled button's text for a product that can't be bought and the sold out text shown with its price (and read by screen readers), as `label-add-to-cart` and `label-view-product` already do for their buttons. Missing or blank, each keeps the default in the element's language. They are also the `labelUnavailable` and `labelSoldOut` properties.
|
|
8
|
+
|
|
3
9
|
## 0.7.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";var VtexAdsStories=(()=>{var Le=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var so=Object.prototype.hasOwnProperty;var no=(o,e)=>{for(var t in e)Le(o,t,{get:e[t],enumerable:!0})},ao=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of io(e))!so.call(o,i)&&i!==t&&Le(o,i,{get:()=>e[i],enumerable:!(r=oo(e,i))||r.enumerable});return o};var lo=o=>ao(Le({},"__esModule",{value:!0}),o);var ji={};no(ji,{TAG_NAME:()=>x,VtexAdsStoryCarouselElement:()=>D,defineVtexAdsStoryCarousel:()=>ye});var ve=globalThis,ge=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,De=Symbol(),ft=new WeakMap,te=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==De)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ge&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ft.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ft.set(t,e))}return e}toString(){return this.cssText}},mt=o=>new te(typeof o=="string"?o:o+"",void 0,De),g=(o,...e)=>{let t=o.length===1?o[0]:e.reduce((r,i,s)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new te(t,o,De)},yt=(o,e)=>{if(ge)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=ve.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,o.appendChild(r)}},Ve=ge?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return mt(t)})(o):o;var{is:co,defineProperty:po,getOwnPropertyDescriptor:uo,getOwnPropertyNames:ho,getOwnPropertySymbols:fo,getPrototypeOf:mo}=Object,M=globalThis,vt=M.trustedTypes,yo=vt?vt.emptyScript:"",Ne=M.reactiveElementPolyfillSupport,re=(o,e)=>o,He={toAttribute(o,e){switch(e){case Boolean:o=o?yo:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch(r){t=null}}return t}},$t=(o,e)=>!co(o,e),gt={attribute:!0,type:String,converter:He,reflect:!1,useDefault:!1,hasChanged:$t},bt,xt;(bt=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(xt=M.litPropertyMetadata)!=null||(M.litPropertyMetadata=new WeakMap);var E=class extends HTMLElement{static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=gt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&po(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){var n;let{get:i,set:s}=(n=uo(this.prototype,e))!=null?n:{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){let d=i==null?void 0:i.call(this);s==null||s.call(this,a),this.requestUpdate(e,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var t;return(t=this.elementProperties.get(e))!=null?t:gt}static _$Ei(){if(this.hasOwnProperty(re("elementProperties")))return;let e=mo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(re("properties"))){let t=this.properties,r=[...ho(t),...fo(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(Ve(i))}else e!==void 0&&t.push(Ve(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$EO)!=null?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var t;let e=(t=this.shadowRoot)!=null?t:this.attachShadow(this.constructor.shadowRootOptions);return yt(e,this.constructor.elementStyles),e}connectedCallback(){var e,t;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var s;let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let n=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:He).toAttribute(t,r.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){var s,n,a;let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let d=r.getPropertyOptions(i),l=typeof d.converter=="function"?{fromAttribute:d.converter}:((s=d.converter)==null?void 0:s.fromAttribute)!==void 0?d.converter:He;this._$Em=i;let p=l.fromAttribute(t,d.type);this[i]=(a=p!=null?p:(n=this._$Ej)==null?void 0:n.get(i))!=null?a:p,this._$Em=null}}requestUpdate(e,t,r,i=!1,s){var n,a;if(e!==void 0){let d=this.constructor;if(i===!1&&(s=this[e]),r!=null||(r=d.getPropertyOptions(e)),!(((n=r.hasChanged)!=null?n:$t)(s,t)||r.useDefault&&r.reflect&&s===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(d._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},n){var a,d,l;r&&!((a=this._$Ej)!=null?a:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(d=n!=null?n:t)!=null?d:this[e]),s!==!0||n!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&((l=this._$Eq)!=null?l:this._$Eq=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,a]of s){let{wrapped:d}=a,l=this[n];d!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,a,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}},wt;E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[re("elementProperties")]=new Map,E[re("finalized")]=new Map,Ne==null||Ne({ReactiveElement:E}),((wt=M.reactiveElementVersions)!=null?wt:M.reactiveElementVersions=[]).push("2.1.2");var ie=globalThis,St=o=>o,be=ie.trustedTypes,At=be?be.createPolicy("lit-html",{createHTML:o=>o}):void 0,Be="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,qe="?"+T,vo=`<${qe}>`,U=document,se=()=>U.createComment(""),ne=o=>o===null||typeof o!="object"&&typeof o!="function",ze=Array.isArray,Mt=o=>ze(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Ue=`[
|
|
2
2
|
\f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_t=/-->/g,Ct=/>/g,N=RegExp(`>|${Ue}(?:([^\\s"'>=/]+)(${Ue}*=${Ue}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,We=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),f=We(1),Yi=We(2),Ji=We(3),w=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Pt=new WeakMap,H=U.createTreeWalker(U,129);function Ot(o,e){if(!ze(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return At!==void 0?At.createHTML(e):e}var It=(o,e)=>{let t=o.length-1,r=[],i,s=e===2?"<svg>":e===3?"<math>":"",n=oe;for(let a=0;a<t;a++){let d=o[a],l,p,c=-1,h=0;for(;h<d.length&&(n.lastIndex=h,p=n.exec(d),p!==null);)h=n.lastIndex,n===oe?p[1]==="!--"?n=_t:p[1]!==void 0?n=Ct:p[2]!==void 0?(Rt.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=N):p[3]!==void 0&&(n=N):n===N?p[0]===">"?(n=i!=null?i:oe,c=-1):p[1]===void 0?c=-2:(c=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?N:p[3]==='"'?Tt:Et):n===Tt||n===Et?n=N:n===_t||n===Ct?n=oe:(n=N,i=void 0);let m=n===N&&o[a+1].startsWith("/>")?" ":"";s+=n===oe?d+vo:c>=0?(r.push(l),d.slice(0,c)+Be+d.slice(c)+T+m):d+T+(c===-2?a:m)}return[Ot(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ae=class o{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,n=0,a=e.length-1,d=this.parts,[l,p]=It(e,t);if(this.el=o.createElement(l,r),H.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=H.nextNode())!==null&&d.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(Be)){let h=p[n++],m=i.getAttribute(c).split(T),y=/([.?@])?(.*)/.exec(h);d.push({type:1,index:s,name:y[2],strings:m,ctor:y[1]==="."?we:y[1]==="?"?$e:y[1]==="@"?Se:B}),i.removeAttribute(c)}else c.startsWith(T)&&(d.push({type:6,index:s}),i.removeAttribute(c));if(Rt.test(i.tagName)){let c=i.textContent.split(T),h=c.length-1;if(h>0){i.textContent=be?be.emptyScript:"";for(let m=0;m<h;m++)i.append(c[m],se()),H.nextNode(),d.push({type:2,index:++s});i.append(c[h],se())}}}else if(i.nodeType===8)if(i.data===qe)d.push({type:2,index:s});else{let c=-1;for(;(c=i.data.indexOf(T,c+1))!==-1;)d.push({type:7,index:s}),c+=T.length-1}s++}}static createElement(e,t){let r=U.createElement("template");return r.innerHTML=e,r}};function F(o,e,t=o,r){var n,a,d;if(e===w)return e;let i=r!==void 0?(n=t._$Co)==null?void 0:n[r]:t._$Cl,s=ne(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,t,r)),r!==void 0?((d=t._$Co)!=null?d:t._$Co=[])[r]=i:t._$Cl=i),i!==void 0&&(e=F(o,i._$AS(o,e.values),i,r)),e}var xe=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 l;let{el:{content:t},parts:r}=this._$AD,i=((l=e==null?void 0:e.creationScope)!=null?l:U).importNode(t,!0);H.currentNode=i;let s=H.nextNode(),n=0,a=0,d=r[0];for(;d!==void 0;){if(n===d.index){let p;d.type===2?p=new j(s,s.nextSibling,this,e):d.type===1?p=new d.ctor(s,d.name,d.strings,this,e):d.type===6&&(p=new Ae(s,this,e)),this._$AV.push(p),d=r[++a]}n!==(d==null?void 0:d.index)&&(s=H.nextNode(),n++)}return H.currentNode=U,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},j=class o{get _$AU(){var e,t;return(t=(e=this._$AM)==null?void 0:e._$AU)!=null?t:this._$Cv}constructor(e,t,r,i){var s;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(s=i==null?void 0:i.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=F(this,e,t),ne(e)?e===u||e==null||e===""?(this._$AH!==u&&this._$AR(),this._$AH=u):e!==this._$AH&&e!==w&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(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!==u&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){var s;let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ae.createElement(Ot(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{let n=new xe(i,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(e){let t=Pt.get(e.strings);return t===void 0&&Pt.set(e.strings,t=new ae(e)),t}k(e){ze(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let s of e)i===t.length?t.push(r=new o(this.O(se()),this.O(se()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let i=St(e).nextSibling;St(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},B=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=u,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(e,t=this,r,i){let s=this.strings,n=!1;if(s===void 0)e=F(this,e,t,0),n=!ne(e)||e!==this._$AH&&e!==w,n&&(this._$AH=e);else{let a=e,d,l;for(e=s[0],d=0;d<s.length-1;d++)l=F(this,a[r+d],t,d),l===w&&(l=this._$AH[d]),n||(n=!ne(l)||l!==this._$AH[d]),l===u?e=u:e!==u&&(e+=(l!=null?l:"")+s[d+1]),this._$AH[d]=l}n&&!i&&this.j(e)}j(e){e===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},we=class extends B{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===u?void 0:e}},$e=class extends B{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==u)}},Se=class extends B{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){var n;if((e=(n=F(this,e,t,0))!=null?n:u)===w)return;let r=this._$AH,i=e===u&&r!==u||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==u&&(r===u||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)==null?void 0:t.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},Ae=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){F(this,e)}},Lt={M:Be,P:T,A:qe,C:1,L:It,R:xe,D:Mt,V:F,I:j,H:B,N:$e,U:Se,B:we,F:Ae},Fe=ie.litHtmlPolyfillSupport,kt;Fe==null||Fe(ae,j),((kt=ie.litHtmlVersions)!=null?kt:ie.litHtmlVersions=[]).push("3.3.3");var Dt=(o,e,t)=>{var s,n;let r=(s=t==null?void 0:t.renderBefore)!=null?s:e,i=r._$litPart$;if(i===void 0){let a=(n=t==null?void 0:t.renderBefore)!=null?n:null;r._$litPart$=i=new j(e.insertBefore(se(),a),a,void 0,t!=null?t:{})}return i._$AI(o),i};var q=globalThis,R=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let e=super.createRenderRoot();return(r=(t=this.renderOptions).renderBefore)!=null||(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return w}},Vt;R._$litElement$=!0,R.finalized=!0,(Vt=q.litElementHydrateSupport)==null||Vt.call(q,{LitElement:R});var je=q.litElementPolyfillSupport;je==null||je({LitElement:R});var Nt;((Nt=q.litElementVersions)!=null?Nt:q.litElementVersions=[]).push("4.2.2");var{I:go}=Lt,Ht=o=>o;var Ft=o=>o.strings===void 0,Ut=()=>document.createComment(""),G=(o,e,t)=>{var s;let r=o._$AA.parentNode,i=e===void 0?o._$AB:e._$AA;if(t===void 0){let n=r.insertBefore(Ut(),i),a=r.insertBefore(Ut(),i);t=new go(n,a,o,o.options)}else{let n=t._$AB.nextSibling,a=t._$AM,d=a!==o;if(d){let l;(s=t._$AQ)==null||s.call(t,o),t._$AM=o,t._$AP!==void 0&&(l=o._$AU)!==a._$AU&&t._$AP(l)}if(n!==i||d){let l=t._$AA;for(;l!==n;){let p=Ht(l).nextSibling;Ht(r).insertBefore(l,i),l=p}}}return t},O=(o,e,t=o)=>(o._$AI(e,t),o),bo={},Bt=(o,e=bo)=>o._$AH=e,qt=o=>o._$AH,_e=o=>{o._$AR(),o._$AA.remove()};var I={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},P=o=>(...e)=>({_$litDirective$:o,values:e}),_=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var de=(o,e)=>{var r;let t=o._$AN;if(t===void 0)return!1;for(let i of t)(r=i._$AO)==null||r.call(i,e,!1),de(i,e);return!0},Ce=o=>{let e,t;do{if((e=o._$AM)===void 0)break;t=e._$AN,t.delete(o),o=e}while((t==null?void 0:t.size)===0)},zt=o=>{for(let e;e=o._$AM;o=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(o))break;t.add(o),$o(e)}};function xo(o){this._$AN!==void 0?(Ce(this),this._$AM=o,zt(this)):this._$AM=o}function wo(o,e=!1,t=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)de(r[s],!1),Ce(r[s]);else r!=null&&(de(r,!1),Ce(r));else de(this,o)}var $o=o=>{var e,t;o.type==I.CHILD&&((e=o._$AP)!=null||(o._$AP=wo),(t=o._$AQ)!=null||(o._$AQ=xo))},Ee=class extends _{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),zt(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(de(this,e),Ce(this))}setValue(e){if(Ft(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var k=()=>new Ze,Ze=class{},Ge=new WeakMap,$=P(class extends Ee{render(o){return u}update(o,[e]){var r;let t=e!==this.G;return t&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=o.options)==null?void 0:r.host,this.rt(this.ct=o.element)),u}rt(o){var e;if(this.G!==void 0)if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=(e=this.ht)!=null?e:globalThis,r=Ge.get(t);r===void 0&&(r=new WeakMap,Ge.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){var o,e,t;return typeof this.G=="function"?(e=Ge.get((o=this.ht)!=null?o:globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var le=class extends _{constructor(e){if(super(e),this.it=u,e.type!==I.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===u||e==null)return this._t=void 0,this.it=e;if(e===w)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};le.directiveName="unsafeHTML",le.resultType=1;var Wt=P(le);var jt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"/></svg>
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Ot=/^(?:script|style|textarea|title)$/i,We=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),f=We(1),Yi=We(2),Ji=We(3),w=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Pt=new WeakMap,H=U.createTreeWalker(U,129);function Rt(o,e){if(!ze(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return At!==void 0?At.createHTML(e):e}var It=(o,e)=>{let t=o.length-1,r=[],i,s=e===2?"<svg>":e===3?"<math>":"",n=oe;for(let a=0;a<t;a++){let d=o[a],l,p,c=-1,h=0;for(;h<d.length&&(n.lastIndex=h,p=n.exec(d),p!==null);)h=n.lastIndex,n===oe?p[1]==="!--"?n=_t:p[1]!==void 0?n=Ct:p[2]!==void 0?(Ot.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=N):p[3]!==void 0&&(n=N):n===N?p[0]===">"?(n=i!=null?i:oe,c=-1):p[1]===void 0?c=-2:(c=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?N:p[3]==='"'?Tt:Et):n===Tt||n===Et?n=N:n===_t||n===Ct?n=oe:(n=N,i=void 0);let m=n===N&&o[a+1].startsWith("/>")?" ":"";s+=n===oe?d+vo:c>=0?(r.push(l),d.slice(0,c)+Be+d.slice(c)+T+m):d+T+(c===-2?a:m)}return[Rt(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ae=class o{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,n=0,a=e.length-1,d=this.parts,[l,p]=It(e,t);if(this.el=o.createElement(l,r),H.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=H.nextNode())!==null&&d.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(Be)){let h=p[n++],m=i.getAttribute(c).split(T),y=/([.?@])?(.*)/.exec(h);d.push({type:1,index:s,name:y[2],strings:m,ctor:y[1]==="."?we:y[1]==="?"?$e:y[1]==="@"?Se:B}),i.removeAttribute(c)}else c.startsWith(T)&&(d.push({type:6,index:s}),i.removeAttribute(c));if(Ot.test(i.tagName)){let c=i.textContent.split(T),h=c.length-1;if(h>0){i.textContent=be?be.emptyScript:"";for(let m=0;m<h;m++)i.append(c[m],se()),H.nextNode(),d.push({type:2,index:++s});i.append(c[h],se())}}}else if(i.nodeType===8)if(i.data===qe)d.push({type:2,index:s});else{let c=-1;for(;(c=i.data.indexOf(T,c+1))!==-1;)d.push({type:7,index:s}),c+=T.length-1}s++}}static createElement(e,t){let r=U.createElement("template");return r.innerHTML=e,r}};function F(o,e,t=o,r){var n,a,d;if(e===w)return e;let i=r!==void 0?(n=t._$Co)==null?void 0:n[r]:t._$Cl,s=ne(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,t,r)),r!==void 0?((d=t._$Co)!=null?d:t._$Co=[])[r]=i:t._$Cl=i),i!==void 0&&(e=F(o,i._$AS(o,e.values),i,r)),e}var xe=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 l;let{el:{content:t},parts:r}=this._$AD,i=((l=e==null?void 0:e.creationScope)!=null?l:U).importNode(t,!0);H.currentNode=i;let s=H.nextNode(),n=0,a=0,d=r[0];for(;d!==void 0;){if(n===d.index){let p;d.type===2?p=new j(s,s.nextSibling,this,e):d.type===1?p=new d.ctor(s,d.name,d.strings,this,e):d.type===6&&(p=new Ae(s,this,e)),this._$AV.push(p),d=r[++a]}n!==(d==null?void 0:d.index)&&(s=H.nextNode(),n++)}return H.currentNode=U,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},j=class o{get _$AU(){var e,t;return(t=(e=this._$AM)==null?void 0:e._$AU)!=null?t:this._$Cv}constructor(e,t,r,i){var s;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(s=i==null?void 0:i.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=F(this,e,t),ne(e)?e===u||e==null||e===""?(this._$AH!==u&&this._$AR(),this._$AH=u):e!==this._$AH&&e!==w&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(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!==u&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){var s;let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ae.createElement(Rt(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{let n=new xe(i,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(e){let t=Pt.get(e.strings);return t===void 0&&Pt.set(e.strings,t=new ae(e)),t}k(e){ze(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let s of e)i===t.length?t.push(r=new o(this.O(se()),this.O(se()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let i=St(e).nextSibling;St(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},B=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=u,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(e,t=this,r,i){let s=this.strings,n=!1;if(s===void 0)e=F(this,e,t,0),n=!ne(e)||e!==this._$AH&&e!==w,n&&(this._$AH=e);else{let a=e,d,l;for(e=s[0],d=0;d<s.length-1;d++)l=F(this,a[r+d],t,d),l===w&&(l=this._$AH[d]),n||(n=!ne(l)||l!==this._$AH[d]),l===u?e=u:e!==u&&(e+=(l!=null?l:"")+s[d+1]),this._$AH[d]=l}n&&!i&&this.j(e)}j(e){e===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},we=class extends B{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===u?void 0:e}},$e=class extends B{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==u)}},Se=class extends B{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){var n;if((e=(n=F(this,e,t,0))!=null?n:u)===w)return;let r=this._$AH,i=e===u&&r!==u||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==u&&(r===u||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)==null?void 0:t.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},Ae=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){F(this,e)}},Lt={M:Be,P:T,A:qe,C:1,L:It,R:xe,D:Mt,V:F,I:j,H:B,N:$e,U:Se,B:we,F:Ae},Fe=ie.litHtmlPolyfillSupport,kt;Fe==null||Fe(ae,j),((kt=ie.litHtmlVersions)!=null?kt:ie.litHtmlVersions=[]).push("3.3.3");var Dt=(o,e,t)=>{var s,n;let r=(s=t==null?void 0:t.renderBefore)!=null?s:e,i=r._$litPart$;if(i===void 0){let a=(n=t==null?void 0:t.renderBefore)!=null?n:null;r._$litPart$=i=new j(e.insertBefore(se(),a),a,void 0,t!=null?t:{})}return i._$AI(o),i};var q=globalThis,O=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let e=super.createRenderRoot();return(r=(t=this.renderOptions).renderBefore)!=null||(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return w}},Vt;O._$litElement$=!0,O.finalized=!0,(Vt=q.litElementHydrateSupport)==null||Vt.call(q,{LitElement:O});var je=q.litElementPolyfillSupport;je==null||je({LitElement:O});var Nt;((Nt=q.litElementVersions)!=null?Nt:q.litElementVersions=[]).push("4.2.2");var{I:go}=Lt,Ht=o=>o;var Ft=o=>o.strings===void 0,Ut=()=>document.createComment(""),G=(o,e,t)=>{var s;let r=o._$AA.parentNode,i=e===void 0?o._$AB:e._$AA;if(t===void 0){let n=r.insertBefore(Ut(),i),a=r.insertBefore(Ut(),i);t=new go(n,a,o,o.options)}else{let n=t._$AB.nextSibling,a=t._$AM,d=a!==o;if(d){let l;(s=t._$AQ)==null||s.call(t,o),t._$AM=o,t._$AP!==void 0&&(l=o._$AU)!==a._$AU&&t._$AP(l)}if(n!==i||d){let l=t._$AA;for(;l!==n;){let p=Ht(l).nextSibling;Ht(r).insertBefore(l,i),l=p}}}return t},R=(o,e,t=o)=>(o._$AI(e,t),o),bo={},Bt=(o,e=bo)=>o._$AH=e,qt=o=>o._$AH,_e=o=>{o._$AR(),o._$AA.remove()};var I={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},P=o=>(...e)=>({_$litDirective$:o,values:e}),_=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var de=(o,e)=>{var r;let t=o._$AN;if(t===void 0)return!1;for(let i of t)(r=i._$AO)==null||r.call(i,e,!1),de(i,e);return!0},Ce=o=>{let e,t;do{if((e=o._$AM)===void 0)break;t=e._$AN,t.delete(o),o=e}while((t==null?void 0:t.size)===0)},zt=o=>{for(let e;e=o._$AM;o=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(o))break;t.add(o),$o(e)}};function xo(o){this._$AN!==void 0?(Ce(this),this._$AM=o,zt(this)):this._$AM=o}function wo(o,e=!1,t=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)de(r[s],!1),Ce(r[s]);else r!=null&&(de(r,!1),Ce(r));else de(this,o)}var $o=o=>{var e,t;o.type==I.CHILD&&((e=o._$AP)!=null||(o._$AP=wo),(t=o._$AQ)!=null||(o._$AQ=xo))},Ee=class extends _{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),zt(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(de(this,e),Ce(this))}setValue(e){if(Ft(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var k=()=>new Ze,Ze=class{},Ge=new WeakMap,$=P(class extends Ee{render(o){return u}update(o,[e]){var r;let t=e!==this.G;return t&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=o.options)==null?void 0:r.host,this.rt(this.ct=o.element)),u}rt(o){var e;if(this.G!==void 0)if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=(e=this.ht)!=null?e:globalThis,r=Ge.get(t);r===void 0&&(r=new WeakMap,Ge.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){var o,e,t;return typeof this.G=="function"?(e=Ge.get((o=this.ht)!=null?o:globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var le=class extends _{constructor(e){if(super(e),this.it=u,e.type!==I.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===u||e==null)return this._t=void 0,this.it=e;if(e===w)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};le.directiveName="unsafeHTML",le.resultType=1;var Wt=P(le);var jt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"/></svg>
|
|
4
4
|
`;var Gt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"/></svg>
|
|
5
5
|
`;var Zt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>
|
|
6
6
|
`;var Qt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"/></svg>';var Kt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z"/></svg>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`;var tr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>';var rr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M245.66,146.34a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm97.15-54.15a8,8,0,0,0-10-.16l-65.57,51A4,4,0,0,0,80,79.84v96.32a4,4,0,0,0,1.55,3.15l65.57,51a8,8,0,0,0,9,.56,8.29,8.29,0,0,0,3.91-7.18V32.25A8.27,8.27,0,0,0,157.12,25.85Z"/></svg>
|
|
11
11
|
`;var or=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M160,32.25V223.69a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.57-51A4,4,0,0,1,80,176.16V79.84a4,4,0,0,1,1.55-3.15l65.57-51a8,8,0,0,1,10,.16A8.27,8.27,0,0,1,160,32.25ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm126.77,20.84a8,8,0,0,0-.72,11.3,24,24,0,0,1,0,31.72,8,8,0,1,0,12,10.58,40,40,0,0,0,0-52.88A8,8,0,0,0,186.74,100.84Zm40.89-26.17a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66Z"/></svg>
|
|
12
12
|
`;var ir='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>';var sr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"/></svg>
|
|
13
|
-
`;var Vo={caretUp:Qt,close:Zt,collapse:Kt,expand:Xt,minus:Yt,next:Gt,pause:Jt,play:er,plus:tr,previous:jt,soundOff:rr,soundOn:or,trash:ir,warning:sr},No=Object.fromEntries(Object.entries(Vo).map(([o,e])=>[o,e.replace("<svg",'<svg class="icon" aria-hidden="true" focusable="false"')]));function v(o){return Wt(No[o])}var nr={watch:"Watch video",show:"Show video",carousel:"Videos",carouselRole:"carousel",previous:"Previous video",next:"Next video",player:"Video",expand:"Expand video",collapse:"Collapse video",close:"Close video",play:"Play video",pause:"Pause video",soundOn:"Turn sound on",soundOff:"Turn sound off",addToCart:"Add to cart",cartQuantity:"Quantity in cart",decreaseQuantity:"Decrease quantity",removeFromCart:"Remove from cart",increaseQuantity:"Increase quantity",unavailable:"Product unavailable",soldOut:"Sold out",viewProduct:"View product",videoUnavailable:"Video unavailable",videoFailed:"Couldn't load the video",retry:"Try again",videoLoading:"Loading video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, was ${t}, now ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} of ${t}`:o};var ar={watch:"Ver video",show:"Mostrar video",carousel:"Videos",carouselRole:"carrusel",previous:"Video anterior",next:"Video siguiente",player:"Video",expand:"Ampliar video",collapse:"Reducir video",close:"Cerrar video",play:"Reproducir video",pause:"Pausar video",soundOn:"Activar sonido",soundOff:"Desactivar sonido",addToCart:"Agregar al carrito",cartQuantity:"Cantidad en el carrito",decreaseQuantity:"Disminuir cantidad",removeFromCart:"Quitar del carrito",increaseQuantity:"Aumentar cantidad",unavailable:"Producto no disponible",soldOut:"Agotado",viewProduct:"Ver producto",videoUnavailable:"Video no disponible",videoFailed:"No se pudo cargar el video",retry:"Intentar de nuevo",videoLoading:"Cargando video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, antes ${t}, ahora ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Z={watch:"Assistir v\xEDdeo",show:"Mostrar v\xEDdeo",carousel:"V\xEDdeos",carouselRole:"carrossel",previous:"V\xEDdeo anterior",next:"Pr\xF3ximo v\xEDdeo",player:"V\xEDdeo",expand:"Expandir v\xEDdeo",collapse:"Reduzir v\xEDdeo",close:"Fechar v\xEDdeo",play:"Reproduzir v\xEDdeo",pause:"Pausar v\xEDdeo",soundOn:"Ativar som",soundOff:"Desativar som",addToCart:"Adicionar ao carrinho",cartQuantity:"Quantidade no carrinho",decreaseQuantity:"Diminuir quantidade",removeFromCart:"Remover do carrinho",increaseQuantity:"Aumentar quantidade",unavailable:"Produto indispon\xEDvel",soldOut:"Esgotado",viewProduct:"Ver produto",videoUnavailable:"V\xEDdeo indispon\xEDvel",videoFailed:"N\xE3o foi poss\xEDvel carregar o v\xEDdeo",retry:"Tentar de novo",videoLoading:"Carregando v\xEDdeo",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, de ${t} por ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Ho=new Map([["pt",Z],["es",ar],["en",nr]]);function dr(o,e={}){var
|
|
13
|
+
`;var Vo={caretUp:Qt,close:Zt,collapse:Kt,expand:Xt,minus:Yt,next:Gt,pause:Jt,play:er,plus:tr,previous:jt,soundOff:rr,soundOn:or,trash:ir,warning:sr},No=Object.fromEntries(Object.entries(Vo).map(([o,e])=>[o,e.replace("<svg",'<svg class="icon" aria-hidden="true" focusable="false"')]));function v(o){return Wt(No[o])}var nr={watch:"Watch video",show:"Show video",carousel:"Videos",carouselRole:"carousel",previous:"Previous video",next:"Next video",player:"Video",expand:"Expand video",collapse:"Collapse video",close:"Close video",play:"Play video",pause:"Pause video",soundOn:"Turn sound on",soundOff:"Turn sound off",addToCart:"Add to cart",cartQuantity:"Quantity in cart",decreaseQuantity:"Decrease quantity",removeFromCart:"Remove from cart",increaseQuantity:"Increase quantity",unavailable:"Product unavailable",soldOut:"Sold out",viewProduct:"View product",videoUnavailable:"Video unavailable",videoFailed:"Couldn't load the video",retry:"Try again",videoLoading:"Loading video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, was ${t}, now ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} of ${t}`:o};var ar={watch:"Ver video",show:"Mostrar video",carousel:"Videos",carouselRole:"carrusel",previous:"Video anterior",next:"Video siguiente",player:"Video",expand:"Ampliar video",collapse:"Reducir video",close:"Cerrar video",play:"Reproducir video",pause:"Pausar video",soundOn:"Activar sonido",soundOff:"Desactivar sonido",addToCart:"Agregar al carrito",cartQuantity:"Cantidad en el carrito",decreaseQuantity:"Disminuir cantidad",removeFromCart:"Quitar del carrito",increaseQuantity:"Aumentar cantidad",unavailable:"Producto no disponible",soldOut:"Agotado",viewProduct:"Ver producto",videoUnavailable:"Video no disponible",videoFailed:"No se pudo cargar el video",retry:"Intentar de nuevo",videoLoading:"Cargando video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, antes ${t}, ahora ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Z={watch:"Assistir v\xEDdeo",show:"Mostrar v\xEDdeo",carousel:"V\xEDdeos",carouselRole:"carrossel",previous:"V\xEDdeo anterior",next:"Pr\xF3ximo v\xEDdeo",player:"V\xEDdeo",expand:"Expandir v\xEDdeo",collapse:"Reduzir v\xEDdeo",close:"Fechar v\xEDdeo",play:"Reproduzir v\xEDdeo",pause:"Pausar v\xEDdeo",soundOn:"Ativar som",soundOff:"Desativar som",addToCart:"Adicionar ao carrinho",cartQuantity:"Quantidade no carrinho",decreaseQuantity:"Diminuir quantidade",removeFromCart:"Remover do carrinho",increaseQuantity:"Aumentar quantidade",unavailable:"Produto indispon\xEDvel",soldOut:"Esgotado",viewProduct:"Ver produto",videoUnavailable:"V\xEDdeo indispon\xEDvel",videoFailed:"N\xE3o foi poss\xEDvel carregar o v\xEDdeo",retry:"Tentar de novo",videoLoading:"Carregando v\xEDdeo",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, de ${t} por ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Ho=new Map([["pt",Z],["es",ar],["en",nr]]);function dr(o,e={}){var d,l,p,c,h;let t=o.split("-")[0].toLowerCase(),r=(d=Ho.get(t))!=null?d:Z,i=(l=e.addToCart)==null?void 0:l.trim(),s=(p=e.viewProduct)==null?void 0:p.trim(),n=(c=e.unavailable)==null?void 0:c.trim(),a=(h=e.soldOut)==null?void 0:h.trim();return{...r,...i&&{addToCart:i},...s&&{viewProduct:s},...n&&{unavailable:n},...a&&{soldOut:a}}}function b(o){if(!o)return null;try{let{protocol:e}=new URL(o);return e==="https:"||e==="http:"?o:null}catch(e){return null}}var lr="https://store.invalid";function Uo(o){try{let e=new URL(o,lr);return e.origin!==lr||e.pathname.startsWith("//")?null:`${e.pathname}${e.search}${e.hash}`}catch(e){return null}}function Te(o){return o?o.startsWith("/")?Uo(o):b(o):null}var cr="(prefers-reduced-motion: reduce)";function Q(){var o,e;return(e=(o=globalThis.matchMedia)==null?void 0:o.call(globalThis,cr).matches)!=null?e:!1}function K(o,e){return!e.failed&&!e.retrying&&b(o.media_url)!==null}function Fo(o,e){let t=r=>{r.stopPropagation(),e==null||e()};return f`
|
|
14
14
|
<div class="media-status" ?data-retry=${!!e}>
|
|
15
15
|
<span class="media-status-text">
|
|
16
16
|
${v("warning")}
|
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
${t.product?et(t.product,(s=t.onProductSelect)!=null?s:t.onSelect):u}
|
|
842
842
|
${t.cta?pe(t.cta,t.onCtaSelect):u}
|
|
843
843
|
</div>
|
|
844
|
-
`}var mr=(o,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(o[i],i);return r},Me=P(class extends _{constructor(o){if(super(o),o.type!==I.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],s=[],n=0;for(let a of o)i[n]=r?r(a,n):n,s[n]=t(a,n),n++;return{values:s,keys:i}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,r]){var A;let i=qt(o),{values:s,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,s;let a=(A=this.ut)!=null?A:this.ut=[],d=[],l,p,c=0,h=i.length-1,m=0,y=s.length-1;for(;c<=h&&m<=y;)if(i[c]===null)c++;else if(i[h]===null)h--;else if(a[c]===n[m])d[m]=
|
|
844
|
+
`}var mr=(o,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(o[i],i);return r},Me=P(class extends _{constructor(o){if(super(o),o.type!==I.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],s=[],n=0;for(let a of o)i[n]=r?r(a,n):n,s[n]=t(a,n),n++;return{values:s,keys:i}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,r]){var A;let i=qt(o),{values:s,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,s;let a=(A=this.ut)!=null?A:this.ut=[],d=[],l,p,c=0,h=i.length-1,m=0,y=s.length-1;for(;c<=h&&m<=y;)if(i[c]===null)c++;else if(i[h]===null)h--;else if(a[c]===n[m])d[m]=R(i[c],s[m]),c++,m++;else if(a[h]===n[y])d[y]=R(i[h],s[y]),h--,y--;else if(a[c]===n[y])d[y]=R(i[c],s[y]),G(o,d[y+1],i[c]),c++,y--;else if(a[h]===n[m])d[m]=R(i[h],s[m]),G(o,i[c],i[h]),h--,m++;else if(l===void 0&&(l=mr(n,m,y),p=mr(a,c,h)),l.has(a[c]))if(l.has(a[h])){let S=p.get(n[m]),W=S!==void 0?i[S]:null;if(W===null){let V=G(o,i[c]);R(V,s[m]),d[m]=V}else d[m]=R(W,s[m]),G(o,i[c],W),i[S]=null;m++}else _e(i[h]),h--;else _e(i[c]),c++;for(;m<=y;){let S=G(o,d[y+1]);R(S,s[m]),d[m++]=S}for(;c<=h;){let S=i[c++];S!==null&&_e(S)}return this.ut=n,Bt(o,d),w}});var yr="important",ei=" !"+yr,L=P(class extends _{constructor(o){var e;if(super(o),o.type!==I.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{let r=o[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(o,[e]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(let r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in e){let i=e[r];if(i!=null){this.ft.add(r);let s=typeof i=="string"&&i.endsWith(ei);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?yr:""):t[r]=i}}return w}});var C=g`500px`,vr=g`24px`,xr=5e3,wr=2e3,$r=12e4,Sr=o=>o===void 0||!Number.isFinite(o)||o<0?xr:o===0?0:Math.min(Math.max(o,wr),$r),Ar=40,nt=g`(max-width: 576px)`,Y=2,ue=Y+3,at=g`
|
|
845
845
|
.carousel {
|
|
846
846
|
position: relative;
|
|
847
847
|
box-sizing: border-box;
|
|
@@ -1137,7 +1137,7 @@
|
|
|
1137
1137
|
</div>
|
|
1138
1138
|
`)}
|
|
1139
1139
|
</div>
|
|
1140
|
-
`}var x="vtex-ads-story-carousel";var _r="text/plain;charset=utf-8";function Cr(o,{sessionId:e,userId:t}){var s,n;let r=b(o);if(!r||globalThis.window===void 0)return!1;let i=JSON.stringify(t?{session_id:e,user_id:t}:{session_id:e});try{if((n=(s=globalThis.navigator)==null?void 0:s.sendBeacon)==null?void 0:n.call(s,r,new Blob([i],{type:_r})))return!0}catch(a){}return typeof globalThis.fetch!="function"?!1:(globalThis.fetch(r,{method:"POST",headers:{"Content-Type":_r},body:i,keepalive:!0,credentials:"omit"}).catch(a=>{console.error(`[${x}] Event request failed`,{url:r,error:a})}),!0)}var ct=.5,Er=2e3,ti={impression:"impression_url",view:"view_url",click:"click_url"},fe=class{constructor(e,t){this.host=e;this.options=t;this.sent={impression:new Set,view:new Set,click:new Set};this.pendingImpressions=[];this.connected=!1;this.watched=new Map;this.onIntersect=e=>{for(let t of e){let r=this.watched.get(t.target);r&&(r.visible=t.isIntersecting&&t.intersectionRatio>=ct,r.visible?this.startTimer(r):this.stopTimer(r))}};this.onVisibilityChange=()=>{for(let e of this.watched.values())document.hidden?this.stopTimer(e):e.visible&&this.startTimer(e)};e.addController(this)}hostConnected(){var e;this.connected=!0,typeof IntersectionObserver=="function"&&(this.observer=new IntersectionObserver(this.onIntersect,{threshold:ct})),(e=globalThis.document)==null||e.addEventListener("visibilitychange",this.onVisibilityChange),this.host.updateComplete.then(()=>{this.connected&&(this.sendImpressions(),this.syncViewTargets())})}hostDisconnected(){var e,t;this.connected=!1,(e=globalThis.document)==null||e.removeEventListener("visibilitychange",this.onVisibilityChange),(t=this.observer)==null||t.disconnect(),this.observer=void 0;for(let r of this.watched.values())clearTimeout(r.timer);this.watched.clear()}hostUpdated(){this.connected&&(this.sendImpressions(),this.syncViewTargets())}impress(e){this.pendingImpressions=e}sendImpressions(){let e=this.pendingImpressions;if(!(!e.length||!this.options.identity().sessionId)){this.pendingImpressions=[];for(let t of e)this.send("impression",t)}}click(e){this.send("click",e)}key(e,t){return`${e}|${t.ad_id}`}wasSent(e,t){let{sessionId:r}=this.options.identity();return!!r&&this.sent[e].has(this.key(r,t))}send(e,t){let{sessionId:r,userId:i}=this.options.identity();if(!r||this.wasSent(e,t))return;Cr(t[ti[e]],{sessionId:r,userId:i})&&this.sent[e].add(this.key(r,t))}syncViewTargets(){let{observer:e}=this;if(!e)return;let t=new Map;for(let[r,i]of this.options.viewTargets())this.wasSent("view",i)||t.set(r,i);for(let[r,i]of this.watched)t.get(r)!==i.story&&this.unwatch(r,i);for(let[r,i]of t)this.watched.has(r)||(this.watched.set(r,{story:i,visible:!1}),e.observe(r))}startTimer(e){var t;e.timer||(t=globalThis.document)!=null&&t.hidden||(e.timer=setTimeout(()=>{e.timer=void 0,this.send("view",e.story),this.wasSent("view",e.story)&&this.unwatchStory(e.story)},Er))}stopTimer(e){clearTimeout(e.timer),e.timer=void 0}unwatch(e,t){var r;this.stopTimer(t),(r=this.observer)==null||r.unobserve(e),this.watched.delete(e)}unwatchStory(e){for(let[t,r]of this.watched)r.story.ad_id===e.ad_id&&this.unwatch(t,r)}};var
|
|
1140
|
+
`}var x="vtex-ads-story-carousel";var _r="text/plain;charset=utf-8";function Cr(o,{sessionId:e,userId:t}){var s,n;let r=b(o);if(!r||globalThis.window===void 0)return!1;let i=JSON.stringify(t?{session_id:e,user_id:t}:{session_id:e});try{if((n=(s=globalThis.navigator)==null?void 0:s.sendBeacon)==null?void 0:n.call(s,r,new Blob([i],{type:_r})))return!0}catch(a){}return typeof globalThis.fetch!="function"?!1:(globalThis.fetch(r,{method:"POST",headers:{"Content-Type":_r},body:i,keepalive:!0,credentials:"omit"}).catch(a=>{console.error(`[${x}] Event request failed`,{url:r,error:a})}),!0)}var ct=.5,Er=2e3,ti={impression:"impression_url",view:"view_url",click:"click_url"},fe=class{constructor(e,t){this.host=e;this.options=t;this.sent={impression:new Set,view:new Set,click:new Set};this.pendingImpressions=[];this.connected=!1;this.watched=new Map;this.onIntersect=e=>{for(let t of e){let r=this.watched.get(t.target);r&&(r.visible=t.isIntersecting&&t.intersectionRatio>=ct,r.visible?this.startTimer(r):this.stopTimer(r))}};this.onVisibilityChange=()=>{for(let e of this.watched.values())document.hidden?this.stopTimer(e):e.visible&&this.startTimer(e)};e.addController(this)}hostConnected(){var e;this.connected=!0,typeof IntersectionObserver=="function"&&(this.observer=new IntersectionObserver(this.onIntersect,{threshold:ct})),(e=globalThis.document)==null||e.addEventListener("visibilitychange",this.onVisibilityChange),this.host.updateComplete.then(()=>{this.connected&&(this.sendImpressions(),this.syncViewTargets())})}hostDisconnected(){var e,t;this.connected=!1,(e=globalThis.document)==null||e.removeEventListener("visibilitychange",this.onVisibilityChange),(t=this.observer)==null||t.disconnect(),this.observer=void 0;for(let r of this.watched.values())clearTimeout(r.timer);this.watched.clear()}hostUpdated(){this.connected&&(this.sendImpressions(),this.syncViewTargets())}impress(e){this.pendingImpressions=e}sendImpressions(){let e=this.pendingImpressions;if(!(!e.length||!this.options.identity().sessionId)){this.pendingImpressions=[];for(let t of e)this.send("impression",t)}}click(e){this.send("click",e)}key(e,t){return`${e}|${t.ad_id}`}wasSent(e,t){let{sessionId:r}=this.options.identity();return!!r&&this.sent[e].has(this.key(r,t))}send(e,t){let{sessionId:r,userId:i}=this.options.identity();if(!r||this.wasSent(e,t))return;Cr(t[ti[e]],{sessionId:r,userId:i})&&this.sent[e].add(this.key(r,t))}syncViewTargets(){let{observer:e}=this;if(!e)return;let t=new Map;for(let[r,i]of this.options.viewTargets())this.wasSent("view",i)||t.set(r,i);for(let[r,i]of this.watched)t.get(r)!==i.story&&this.unwatch(r,i);for(let[r,i]of t)this.watched.has(r)||(this.watched.set(r,{story:i,visible:!1}),e.observe(r))}startTimer(e){var t;e.timer||(t=globalThis.document)!=null&&t.hidden||(e.timer=setTimeout(()=>{e.timer=void 0,this.send("view",e.story),this.wasSent("view",e.story)&&this.unwatchStory(e.story)},Er))}stopTimer(e){clearTimeout(e.timer),e.timer=void 0}unwatch(e,t){var r;this.stopTimer(t),(r=this.observer)==null||r.unobserve(e),this.watched.delete(e)}unwatchStory(e){for(let[t,r]of this.watched)r.story.ad_id===e.ad_id&&this.unwatch(t,r)}};var Oe=72,Pr=48,pt=g`
|
|
1141
1141
|
.player {
|
|
1142
1142
|
position: fixed;
|
|
1143
1143
|
inset: auto 16px 16px auto;
|
|
@@ -1335,7 +1335,7 @@
|
|
|
1335
1335
|
--side-height: min(38vh, 320px);
|
|
1336
1336
|
--side-width: calc(var(--side-height) * 9 / 16);
|
|
1337
1337
|
--center-half: calc(var(--center-height) * 9 / 32);
|
|
1338
|
-
--near-gap: ${
|
|
1338
|
+
--near-gap: ${Oe}px;
|
|
1339
1339
|
--far-gap: ${Pr}px;
|
|
1340
1340
|
--near: calc(var(--center-half) + var(--near-gap) + var(--side-width) / 2);
|
|
1341
1341
|
--pitch: calc(var(--side-width) + var(--far-gap));
|
|
@@ -1514,7 +1514,7 @@
|
|
|
1514
1514
|
animation: none;
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
|
-
`;function ut(o,e){if(o<2)return[];if(o===2)return[e===0?1:-1];let t=[],r=new Set([0]);for(let i of[-1,1,-2,2]){let s=(i%o+o)%o;r.has(s)||(r.add(s),t.push(i))}return t}var J={duration:560,easing:"cubic-bezier(0.32, 0.72, 0, 1)"},
|
|
1517
|
+
`;function ut(o,e){if(o<2)return[];if(o===2)return[e===0?1:-1];let t=[],r=new Set([0]);for(let i of[-1,1,-2,2]){let s=(i%o+o)%o;r.has(s)||(r.add(s),t.push(i))}return t}var J={duration:560,easing:"cubic-bezier(0.32, 0.72, 0, 1)"},Re=(o,e=1)=>`translate(-50%, -50%) translateX(${o}px) scale(${e})`,kr=o=>o.animate([{opacity:0},{opacity:1}],{...J,pseudoElement:"::after"});function ri(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>{if(d===0)return 0;let l=Math.sign(d),p=r/2+Oe+i/2;return l*p+(d-l)*(i+Pr)},n=i/r,a=[o.animate([{transform:`translateX(${s(e)}px) scale(${n})`},{transform:"none"}],J)];for(let{element:d,offset:l,from:p}of t){let c=p===0;a.push(d.animate([{transform:Re(s(p),c?1/n:1)},{transform:Re(s(l))}],J)),c&&a.push(kr(d))}return a}function oi(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>d*(Oe+i)/2,n=d=>-d*(r+Oe)/2,a=i/r;return[o.animate([{transform:`translateX(${n(-t)}px) scale(${a})`},{transform:`translateX(${s(t)}px)`}],J),e.animate([{transform:Re(s(-t),1/a)},{transform:Re(n(t))}],J),kr(e)]}var ii={ArrowLeft:-1,ArrowRight:1},si=o=>!o.defaultPrevented&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey;function Tr(o){return typeof o.showPopover=="function"}var me=class{constructor(e,t){this.host=e;this.options=t;this.isOpen=!1;this.expanded=!1;this.productOpen=!1;this.switched=!1;this.shown=!1;this.dialog=k();this.expandButton=k();this.closeButton=k();this.stage=k();this.stageCardRef=k();this.dim=k();this.neighborElements=new Map;this.neighborRefs=new Map;this.navigation=!1;this.pairDirection=0;this.animations=[];this.toggleExpanded=async()=>{var t;let e=this.dialog.value;e&&(this.cancelAnimations(),this.hide(e),this.expanded=!this.expanded,this.switched=!0,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.show(e),(t=this.expandButton.value)==null||t.focus()))};this.onKeyDown=e=>{e.key==="Escape"&&this.options.onClose()};this.onPlayerKeyDown=e=>{var r,i;let t=ii[e.key];!t||!this.navigation||!si(e)||(e.preventDefault(),(i=(r=this.options).onStep)==null||i.call(r,t))};this.onDialogClick=e=>{this.expanded&&e.target===e.currentTarget&&this.options.onClose()};this.onCancel=e=>{e.preventDefault(),this.options.onClose()};this.toggleProduct=()=>{this.productOpen=!this.productOpen,this.host.requestUpdate()};this.retryVideo=()=>{var e;(e=this.dialog.value)==null||e.focus(),this.video.retry().then(t=>{t&&this.video.playWithSound()})};this.onVideoClick=()=>{this.productOpen?this.toggleProduct():this.video.togglePlayback()};e.addController(this),this.video=new z(e)}get isExpanded(){return this.isOpen&&this.expanded}get stageCard(){return this.isOpen?this.stageCardRef.value:void 0}hostDisconnected(){this.close()}async open({productOpen:e=!1}={}){var r;if(this.isOpen)return;document.addEventListener("keydown",this.onKeyDown),this.isOpen=!0,this.expanded=!1,this.productOpen=e,this.switched=!1,this.rendered=void 0,this.beforeStep=void 0,this.video.reset(),this.host.requestUpdate(),await this.host.updateComplete;let t=this.dialog.value;!this.isOpen||!t||(this.show(t),this.video.playWithSound(),(r=this.closeButton.value)==null||r.focus())}close(){if(!this.isOpen)return;document.removeEventListener("keydown",this.onKeyDown),this.cancelAnimations();let e=this.dialog.value;e&&this.hide(e),this.isOpen=!1,this.host.requestUpdate()}async showNext(e=0){if(!this.isOpen)return;let t=!this.video.muted;this.video.clearFailure(),this.productOpen=!1,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.video.restart({withSound:t}),this.animateStep(e))}cancelAnimations(){for(let e of this.animations)e.cancel();this.animations=[]}animateStep(e){var l,p;if(!this.expanded||e===0||Q())return;let t=this.stage.value,r=this.dim.value;if(!t||!r||typeof t.animate!="function")return;let{rendered:i,beforeStep:s}=this,n=(c,h)=>{var y;if(!c||!s)return h;if(c===s.story)return 0;let m=s.neighbors.find(A=>A.story===c);return(y=m==null?void 0:m.offset)!=null?y:h},a=[...this.neighborElements].map(([c,h])=>{var m;return{offset:c,element:h,from:n((m=i==null?void 0:i.neighbors.find(y=>y.offset===c))==null?void 0:m.story,c+e)}}),d={frameWidth:t.offsetWidth,sideWidth:(p=(l=a[0])==null?void 0:l.element.offsetWidth)!=null?p:0};!d.frameWidth||!d.sideWidth||(this.cancelAnimations(),this.animations=[r.animate([{opacity:1},{opacity:0}],J),...this.pairDirection?oi(t,a[0].element,this.pairDirection,d):ri(t,n(i==null?void 0:i.story,e),a,d)])}neighborRef(e){let t=this.neighborRefs.get(e);return t||(t=r=>{r?this.neighborElements.set(e,r):this.neighborElements.delete(e)},this.neighborRefs.set(e,t)),t}show(e){this.shown||(this.expanded?e.showModal():Tr(e)?e.showPopover():e.show(),this.shown=!0)}hide(e){this.shown&&(!this.expanded&&Tr(e)?e.hidePopover():e.close(),this.shown=!1)}renderDestination({product:e,cta:t,labels:r,productActions:i}){let s;if(e)s=rt(e,{...i,labels:r,open:this.productOpen,onToggle:this.toggleProduct,panelId:"player-product-panel"});else if(t)s=pe(t);else return u;return f`
|
|
1518
1518
|
<div
|
|
1519
1519
|
class="player-destination"
|
|
1520
1520
|
@click=${n=>n.stopPropagation()}
|
|
@@ -1625,7 +1625,7 @@
|
|
|
1625
1625
|
</div>
|
|
1626
1626
|
</div>
|
|
1627
1627
|
</dialog>
|
|
1628
|
-
`}};var Mr=(o,e)=>globalThis.fetch(o,e);var ni=()=>{let o=async(s,n,a,d,l)=>{let p=new URL(n,s).toString(),c=d?{"content-type":"application/json"}:void 0;return Mr(p,{body:d?JSON.stringify(d):void 0,method:a,signal:l==null?void 0:l.signal,headers:{accept:"application/json",...c}}).then(h=>{if(!h.ok)throw console.error({description:"HTTP error",response:h}),new Error(`HTTP error! status: ${h.status}`);return h.json()})};return{get:async(s,n,a)=>o(s,n,"GET",void 0,a),post:async(s,n,a,d)=>o(s,n,"POST",a,d),put:async(s,n,a)=>o(s,n,"PUT",a),delete:async(s,n)=>o(s,n,"DELETE")}},ht=ni(),ai="https://newtail-media.newtail.com.br/v1/rma/",di=async(o,e,t)=>ht.post(ai,o,e,{signal:t==null?void 0:t.signal}).then(r=>{if(r.validations&&r.validations.length>0)throw console.error(JSON.stringify({description:"Ads validation error",response:r},null,2)),new Error("Ads validation error");return r}),li=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"product_sku"in r)]).filter(([e,t])=>t.length>0),ci=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"type"in r&&r.type==="story")]).filter(([e,t])=>t.length>0),Dr=o=>{var e;return{skuId:o.product_sku,sellerId:(e=o.seller_id)!=null?e:"1",productId:o.product_metadata.productId}},Vr=o=>{var e,t,r;let{product:i}=o;if(!i)return;let s=(e=i.product_metadata)==null?void 0:e.productId;return{skuId:i.product_sku,sellerId:(r=(t=i.seller_id)!=null?t:o.seller_id)!=null?r:"1",productId:typeof s=="string"?s:""}},Rr=o=>{let e={};for(let[t,r]of o)e[t]=r;return e},pi=(o,e)=>{let t={};for(let[r,i]of Object.entries(o))t[r]=i.map(s=>e(s));return t},ui=(o,e)=>e?new Promise((t,r)=>{let i=()=>r(e.reason);if(e.aborted){i();return}e.addEventListener("abort",i,{once:!0}),o.then(t,r).finally(()=>e.removeEventListener("abort",i))}):o,Nr=(o,e)=>({eventUrls:{click:o.click_url,impression:o.impression_url,view:o.view_url},eventParameters:btoa(o.impression_url),sponsoredBySellerId:e}),hi=(o,e,t)=>({product:o,advertisement:Nr(e,t.sellerId)}),fi=(o,e)=>{var t;let r=Vr(o);return{story:o,product:e(r),offer:r,advertisement:Nr(o,(t=r==null?void 0:r.sellerId)!=null?t:o.seller_id)}},Or=(o,e)=>Object.values(o).flatMap(t=>t.map(r=>e(r))).filter(t=>t!==void 0),mi=(o,e)=>t=>t&&o.find(r=>e(r,t)),yi=(o,e)=>{var t;let r={},i=[];for(let[s,n]of Object.entries(o))for(let a of n){let d=Dr(a),l=e(d);l?((t=r[s])!=null||(r[s]=[]),r[s].push(hi(l,a,d))):i.push(a)}return{byPlacement:r,failed:i}},Hr=async({sponsoredProducts:o={},stories:e={}},t,r,i,s)=>{let n=[...Or(o,Dr),...Or(e,Vr)],a=n.length>0?await ui(t(n,i,{signal:s==null?void 0:s.signal}),s==null?void 0:s.signal):[],d=mi(a,r);return{sponsoredProducts:yi(o,d),stories:pi(e,l=>fi(l,d))}},Ur=(o,e)=>o.items.some(t=>t.itemId===e.skuId&&t.sellers.some(r=>r.sellerId===e.sellerId)),Fr=o=>`https://${o}.vtexcommercestable.com.br/api/intelligent-search/`,Br="product_search",vi=async(o,e,t)=>{let r=Fr(o),i=`product:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},gi=24,bi=async(o,e,t)=>{let r=Fr(o),i=`sku:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},xi=o=>{let e=new Map;for(let{skuId:t,sellerId:r}of o){let i=e.get(t);i?i.push(r):e.set(t,[r])}return e},wi=(o,e)=>o.map(t=>{let r=e.get(t.itemId);if(!r)return null;let i=t.sellers.filter(s=>r.includes(s.sellerId));return i.length===0?null:{...t,sellers:i}}).filter(t=>t!==null),$i=(o,e)=>{let t=xi(e);return o.map(r=>{let i=wi(r.items,t);return i.length===0?null:{...r,items:i}}).filter(r=>r!==null)},Si=(o,e)=>{let t=[];for(let r=0;r<o.length;r+=e)t.push(o.slice(r,r+e));return t},Ir=(o,e,t,r)=>Si(t,gi).map(i=>o(e,i,r)),Ai=o=>[...new Map(o.map(e=>[e.productId,e])).values()],qr=async(o,{accountName:e},t)=>{let r=new Set,i=new Set;for(let{productId:d,skuId:l}of o)d?r.add(d):i.add(l);let s={signal:t==null?void 0:t.signal},n=await Promise.all([...Ir(vi,e,[...r],s),...Ir(bi,e,[...i],s)]),a=Ai(n.flatMap(d=>d.products));return $i(a,o)},zr=(o,{skuId:e,sellerId:t})=>{var r,i;return(i=(r=o.items.find(s=>s.itemId===e))==null?void 0:r.sellers.find(s=>s.sellerId===t))==null?void 0:i.commertialOffer},Lr=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,Wr=(o,e)=>{let t=zr(o,e),r=Lr(t==null?void 0:t.Price);if(r===void 0)return;let i=Lr(t==null?void 0:t.ListPrice);return i!==void 0&&i>r?{price:r,listPrice:i}:{price:r}},jr=(o,e)=>{var t;let r=(t=zr(o,e))==null?void 0:t.AvailableQuantity;return typeof r=="number"&&!Number.isNaN(r)?r>0:void 0},Ie=({selectedFacets:o,attributeSynonyms:e,attributePrefix:t})=>{if(!(o!=null&&o.length))return;let r=e==null?void 0:e.map(n=>n.toLowerCase()),i=t==null?void 0:t.toLowerCase(),s=o.filter(n=>{let a=n.key.toLowerCase();return(r==null?void 0:r.includes(a))||i&&a.startsWith(i)});if(s.length>0)return s},_i=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["categoria","c"],attributePrefix:"category"}))==null?void 0:e.map(t=>t.value).join(" > ")},Ci=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["brand","b"]}))==null?void 0:e.map(t=>t.value)[0]},Ei=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["productClusterIds","productClusterNames"]}))==null?void 0:e.map(t=>`product_cluster/${t.value}`)},Ti=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["sellerName","seller"]}))==null?void 0:e.map(t=>t.value)[0]},Pi=o=>({category:_i(o),brand:Ci(o),tags:Ei(o),seller:Ti(o)}),ki=({term:o,category:e,brand:t,skuId:r})=>o?"search":e?"category":t?"brand_page":r?"product_page":"home",Mi=o=>{var e;let{category:t,brand:r,tags:i,seller:s}=Pi(o.search.selectedFacets),n=(e=o.search.term)!=null?e:!t&&!r?s:void 0,a=ki({term:n,category:t,brand:r,skuId:o.search.skuId});return{brand_name:r,category_name:t,tags:i,context:a,placements:o.placements,channel:o.identity.channel,term:n,session_id:o.identity.sessionId,user_id:o.identity.userId,product_sku:o.search.skuId}},Gr=async(o,e)=>{let t=Mi(o),r=await di(o.identity.publisherId,t,e);return{sponsoredProducts:Rr(li(r)),stories:Rr(ci(r)),banners:void 0,sponsoredBrands:void 0}};var ee=(o,e,t)=>{let r=o!==void 0&&Number.isFinite(o)&&o>0?o:e,i=new AbortController,s=setTimeout(()=>i.abort(new DOMException(`Timed out after ${r} ms`,"TimeoutError")),r),n=()=>i.abort(t==null?void 0:t.reason);return t!=null&&t.aborted?n():t==null||t.addEventListener("abort",n,{once:!0}),{signal:i.signal,clear:()=>{clearTimeout(s),t==null||t.removeEventListener("abort",n)}}};var Ri=5e3,Zr={fetcher:qr,matcher:Ur,price:Wr,available:jr};function Oi(o){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>=0;if(!e(o==null?void 0:o.price))return;let{price:t,listPrice:r}=o;return e(r)&&r>t?{price:t,listPrice:r}:{price:t}}async function Qr(o,e,t,r,{signal:i,timeout:s}={}){var d,l;let n=new Map,a=ee(s,Ri,i);try{let p=await Hr({stories:{[o]:e}},t.fetcher,(c,h)=>t.matcher(c,h),r,{signal:a.signal});for(let{story:c,product:h,offer:m}of(d=p.stories[o])!=null?d:[])if(!(!h||!m))try{let y=Oi(t.price(h,m)),A=(l=t.available)==null?void 0:l.call(t,h,m);n.set(c.ad_id,{...y&&{price:y},...A!==void 0&&{available:A}})}catch(y){console.error(`[${x}] Product details failed for ad ${c.ad_id}`,y)}}catch(p){a.signal.aborted||console.error(`[${x}] Product request failed`,p)}finally{a.clear()}return n}var Ii=2e3,Li=8,Di=o=>o!==void 0&&Number.isFinite(o)&&o>=1?Math.floor(o):Li;async function Kr({publisherId:o,sessionId:e,placement:t,userId:r,accountName:i,channel:s,quantity:n},{signal:a,timeout:d}={}){var h;if(globalThis.window===void 0||!o||!e||!t)return[];let p=ee(d,Ii,a),c=Di(n);try{let{stories:m}=await Gr({identity:{accountName:i!=null?i:"",publisherId:o,sessionId:e,userId:r,channel:s},search:{},placements:{[t]:{quantity:c,types:["story"]}}},{signal:p.signal});return((h=m[t])!=null?h:[]).slice(0,c)}catch(m){return p.signal.aborted||console.error(`[${x}] Story request failed`,{placement:t,publisherId:o,error:m}),[]}finally{p.clear()}}var Vi=3e3;function Xr(o){if(typeof Image=="undefined")return Promise.resolve(!0);let e=new Image;return e.src=o,e.decode?e.decode().then(()=>!0,()=>!1):Promise.resolve(!0)}function Yr(o,e){if(!o.length)return Promise.resolve();let t=ee(void 0,Vi,e);return new Promise(r=>{let i=()=>{t.clear(),r()};if(t.signal.aborted)return i();t.signal.addEventListener("abort",i,{once:!0});let s=0;for(let n of o)n.then(a=>{(a||++s===o.length)&&i()},()=>{++s===o.length&&i()})})}var Ni="vtex-ads-story:add-to-cart",Hi="vtex-ads-story:remove-from-cart";function Jr(o,{sku:e,seller:t},r){return new CustomEvent(o,{detail:{sku:e,...t&&{seller:t},quantity:r},bubbles:!0,composed:!0})}function eo(o,e=1){return Jr(Ni,o,e)}function to(o,e=1){return Jr(Hi,o,e)}var Ui=["publisherId","sessionId","placement","userId","accountName","channel","quantity","hydration"],Fi=new Set(["site","app"]),Bi=o=>Fi.has(o),qi={fromAttribute:o=>typeof o=="string"&&(o===""||o.toLowerCase()==="true")},zi={fromAttribute:o=>Bi(o)?o:void 0},Wi={fromAttribute:o=>o==="none"?"none":void 0},ro=({sku:o,seller:e})=>JSON.stringify([o,e!=null?e:""]),D=class extends R{constructor(){super();this.cartQuantities=new Map;this.cardVideos=new Map;this.soundPending=!1;this.carousel=new he(this,{onStep:(t,r)=>this.leaveHighlight(t,r),onLayoutChange:()=>{this.cardVideos.clear(),this.player.isOpen&&(this.afterRender=()=>{var t;return(t=this.activeVideo)==null?void 0:t.pause()})},locked:()=>this.player.isOpen||this.mediaLoading,slideDuration:()=>this.slideDuration,reducedMotion:Q});this.player=new me(this,{onStep:t=>this.stepInPlayer(t),onClose:()=>this.closePlayer()});this.events=new fe(this,{identity:()=>({sessionId:this.sessionId,userId:this.userId}),viewTargets:()=>this.viewTargets()});this.renderSlide=(t,{key:r,index:i,offset:s,active:n,hidden:a,cardRef:d,focusRef:l})=>st(t,this.videoFor(r),{label:this.labels.position(n?this.labels.watch:this.labels.show,i,this.stories.length),labels:this.labels,withVideo:n||this.inactiveAutoplay&&!a,autoplay:!this.mediaLoading,product:this.productOf(t),onSelect:n?()=>this.openPlayer():()=>this.carousel.step(s),onProductSelect:n?()=>this.openPlayer({productOpen:!0}):void 0,cta:ke(t),onCtaSelect:n?void 0:()=>this.carousel.step(s),onPress:()=>this.events.click(t),ref:d,openRef:l});this.inactiveAutoplay=!1,this.stories=[],this.requesting=!1,this.mediaLoading=!1}connectedCallback(){var t;super.connectedCallback();for(let r of this.cardVideos.values())r.resume();(t=this.request)!=null&&t.signal.aborted&&this.loadStory()}disconnectedCallback(){var t,r;super.disconnectedCallback(),(t=this.request)==null||t.abort(),(r=this.mediaWait)==null||r.abort()}willUpdate(t){Ui.some(r=>t.has(r))&&this.loadStory()}updated(){let t=this.afterRender;this.afterRender=void 0,t==null||t()}get activeHydration(){if(this.hydration!=="none")return this.hydration?this.hydration:this.accountName?Zr:void 0}async loadStory(){var n,a,d,l,p;(n=this.request)==null||n.abort();let t=new AbortController;if(this.request=t,this.player.close(),this.requesting=!1,this.showStories([]),!this.isConnected){t.abort();return}this.requesting=!!(this.publisherId&&this.sessionId&&this.placement);let r=await Kr(this,{signal:t.signal,timeout:this.timeout});if(t.signal.aborted)return;this.requesting=!1;let i=this.activeHydration;if(!i||!r.some(c=>c.product)){this.request=void 0,this.showStories(r);return}this.showStories(r,"loading");let s=await Qr((a=this.placement)!=null?a:"",r,i,{accountName:(d=this.accountName)!=null?d:"",publisherId:(l=this.publisherId)!=null?l:"",sessionId:(p=this.sessionId)!=null?p:"",userId:this.userId,channel:this.channel},{signal:t.signal,timeout:this.hydrationTimeout});t.signal.aborted||(this.request=void 0,this.products=s)}showStories(t,r){this.products=r,this.cardVideos.clear(),this.soundPending=!1,this.afterRender=void 0,this.carousel.reset(t.length),this.stories=t,this.waitForFirstMedia(t)}async waitForFirstMedia(t){var a,d,l;(a=this.mediaWait)==null||a.abort();let r=new AbortController;this.mediaWait=r;let i=b((d=t[0])==null?void 0:d.poster_url),s=b((l=t[0])==null?void 0:l.media_url),n=[];i&&n.push(Xr(i)),s&&n.push(this.videoFor(this.carousel.activeKey).ready),this.mediaLoading=n.length>0,await Yr(n,r.signal),this.mediaWait===r&&(this.mediaWait=void 0,this.mediaLoading=!1,this.events.impress(t),this.afterRender=()=>{if(this.isConnected)for(let p of this.cardVideos.values())p.resume()},this.requestUpdate())}*viewTargets(){var s;let{stories:t}=this;if(this.mediaLoading)return;if(!this.player.isExpanded)for(let[n,{key:a,index:d}]of this.carousel.visibleCards()){let l=t[d];l&&((s=this.cardVideos.get(a))!=null&&s.playing)&&(yield[n,l])}let r=this.player.stageCard,i=t[this.carousel.active];r&&i&&this.player.video.playing&&(yield[r,i])}videoFor(t){let r=this.cardVideos.get(t);return r||(r=new z(this),this.cardVideos.set(t,r)),r}get activeVideo(){return this.cardVideos.get(this.carousel.activeKey)}leaveHighlight(t,r){let i=this.cardVideos.get(t);this.soundPending||(this.soundPending=i!==void 0&&!i.muted),this.inactiveAutoplay?i==null||i.mute():i==null||i.reset(),this.player.isOpen?(this.soundPending=!1,this.afterRender=()=>this.videoFor(r).pause()):this.soundPending&&(this.afterRender=()=>{this.soundPending=!1,this.videoFor(r).playWithSound()});for(let s of this.cardVideos.keys())Math.abs(s-r)>ue&&this.cardVideos.delete(s)}stepInPlayer(t){this.carousel.step(t,{evenIfLocked:!0}),this.player.showNext(t)}openPlayer({productOpen:t=!1}={}){var r;this.player.isOpen||(this.cartQuantities.clear(),(r=this.activeVideo)==null||r.pause(),this.player.open({productOpen:t}))}closePlayer(){if(this.player.isOpen){this.player.close();for(let t of this.cardVideos.values())t.resume();this.carousel.focusActive()}}get locale(){var t,r;return(r=(t=this.closest('[lang]:not([lang=""])'))==null?void 0:t.lang)!=null?r:Pe}get labels(){var n;let{locale:t,labelAddToCart:r="",labelViewProduct:i=""}=this,s=JSON.stringify([t,r,i]);return((n=this.labelSet)==null?void 0:n.key)!==s&&(this.labelSet={key:s,labels:dr(t,{addToCart:r,viewProduct:i})}),this.labelSet.labels}get formatPrice(){var i,s;let{locale:t}=this,r=`${t}|${(i=this.currency)!=null?i:""}`;return((s=this.formatter)==null?void 0:s.key)!==r&&(this.formatter={key:r,format:Ye(t,this.currency)}),this.formatter.format}productOf(t){var i;let r=this.products==="loading"?"loading":(i=this.products)==null?void 0:i.get(t.ad_id);return Je(t,this.formatPrice,this.labels,r)}render(){let{stories:t}=this,r=this.carousel.active,i=t[r];if(!i&&!this.requesting)return u;let s=this.requesting||this.mediaLoading;return f`
|
|
1628
|
+
`}};var Mr=(o,e)=>globalThis.fetch(o,e);var ni=()=>{let o=async(s,n,a,d,l)=>{let p=new URL(n,s).toString(),c=d?{"content-type":"application/json"}:void 0;return Mr(p,{body:d?JSON.stringify(d):void 0,method:a,signal:l==null?void 0:l.signal,headers:{accept:"application/json",...c}}).then(h=>{if(!h.ok)throw console.error({description:"HTTP error",response:h}),new Error(`HTTP error! status: ${h.status}`);return h.json()})};return{get:async(s,n,a)=>o(s,n,"GET",void 0,a),post:async(s,n,a,d)=>o(s,n,"POST",a,d),put:async(s,n,a)=>o(s,n,"PUT",a),delete:async(s,n)=>o(s,n,"DELETE")}},ht=ni(),ai="https://newtail-media.newtail.com.br/v1/rma/",di=async(o,e,t)=>ht.post(ai,o,e,{signal:t==null?void 0:t.signal}).then(r=>{if(r.validations&&r.validations.length>0)throw console.error(JSON.stringify({description:"Ads validation error",response:r},null,2)),new Error("Ads validation error");return r}),li=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"product_sku"in r)]).filter(([e,t])=>t.length>0),ci=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"type"in r&&r.type==="story")]).filter(([e,t])=>t.length>0),Dr=o=>{var e;return{skuId:o.product_sku,sellerId:(e=o.seller_id)!=null?e:"1",productId:o.product_metadata.productId}},Vr=o=>{var e,t,r;let{product:i}=o;if(!i)return;let s=(e=i.product_metadata)==null?void 0:e.productId;return{skuId:i.product_sku,sellerId:(r=(t=i.seller_id)!=null?t:o.seller_id)!=null?r:"1",productId:typeof s=="string"?s:""}},Or=o=>{let e={};for(let[t,r]of o)e[t]=r;return e},pi=(o,e)=>{let t={};for(let[r,i]of Object.entries(o))t[r]=i.map(s=>e(s));return t},ui=(o,e)=>e?new Promise((t,r)=>{let i=()=>r(e.reason);if(e.aborted){i();return}e.addEventListener("abort",i,{once:!0}),o.then(t,r).finally(()=>e.removeEventListener("abort",i))}):o,Nr=(o,e)=>({eventUrls:{click:o.click_url,impression:o.impression_url,view:o.view_url},eventParameters:btoa(o.impression_url),sponsoredBySellerId:e}),hi=(o,e,t)=>({product:o,advertisement:Nr(e,t.sellerId)}),fi=(o,e)=>{var t;let r=Vr(o);return{story:o,product:e(r),offer:r,advertisement:Nr(o,(t=r==null?void 0:r.sellerId)!=null?t:o.seller_id)}},Rr=(o,e)=>Object.values(o).flatMap(t=>t.map(r=>e(r))).filter(t=>t!==void 0),mi=(o,e)=>t=>t&&o.find(r=>e(r,t)),yi=(o,e)=>{var t;let r={},i=[];for(let[s,n]of Object.entries(o))for(let a of n){let d=Dr(a),l=e(d);l?((t=r[s])!=null||(r[s]=[]),r[s].push(hi(l,a,d))):i.push(a)}return{byPlacement:r,failed:i}},Hr=async({sponsoredProducts:o={},stories:e={}},t,r,i,s)=>{let n=[...Rr(o,Dr),...Rr(e,Vr)],a=n.length>0?await ui(t(n,i,{signal:s==null?void 0:s.signal}),s==null?void 0:s.signal):[],d=mi(a,r);return{sponsoredProducts:yi(o,d),stories:pi(e,l=>fi(l,d))}},Ur=(o,e)=>o.items.some(t=>t.itemId===e.skuId&&t.sellers.some(r=>r.sellerId===e.sellerId)),Fr=o=>`https://${o}.vtexcommercestable.com.br/api/intelligent-search/`,Br="product_search",vi=async(o,e,t)=>{let r=Fr(o),i=`product:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},gi=24,bi=async(o,e,t)=>{let r=Fr(o),i=`sku:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},xi=o=>{let e=new Map;for(let{skuId:t,sellerId:r}of o){let i=e.get(t);i?i.push(r):e.set(t,[r])}return e},wi=(o,e)=>o.map(t=>{let r=e.get(t.itemId);if(!r)return null;let i=t.sellers.filter(s=>r.includes(s.sellerId));return i.length===0?null:{...t,sellers:i}}).filter(t=>t!==null),$i=(o,e)=>{let t=xi(e);return o.map(r=>{let i=wi(r.items,t);return i.length===0?null:{...r,items:i}}).filter(r=>r!==null)},Si=(o,e)=>{let t=[];for(let r=0;r<o.length;r+=e)t.push(o.slice(r,r+e));return t},Ir=(o,e,t,r)=>Si(t,gi).map(i=>o(e,i,r)),Ai=o=>[...new Map(o.map(e=>[e.productId,e])).values()],qr=async(o,{accountName:e},t)=>{let r=new Set,i=new Set;for(let{productId:d,skuId:l}of o)d?r.add(d):i.add(l);let s={signal:t==null?void 0:t.signal},n=await Promise.all([...Ir(vi,e,[...r],s),...Ir(bi,e,[...i],s)]),a=Ai(n.flatMap(d=>d.products));return $i(a,o)},zr=(o,{skuId:e,sellerId:t})=>{var r,i;return(i=(r=o.items.find(s=>s.itemId===e))==null?void 0:r.sellers.find(s=>s.sellerId===t))==null?void 0:i.commertialOffer},Lr=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,Wr=(o,e)=>{let t=zr(o,e),r=Lr(t==null?void 0:t.Price);if(r===void 0)return;let i=Lr(t==null?void 0:t.ListPrice);return i!==void 0&&i>r?{price:r,listPrice:i}:{price:r}},jr=(o,e)=>{var t;let r=(t=zr(o,e))==null?void 0:t.AvailableQuantity;return typeof r=="number"&&!Number.isNaN(r)?r>0:void 0},Ie=({selectedFacets:o,attributeSynonyms:e,attributePrefix:t})=>{if(!(o!=null&&o.length))return;let r=e==null?void 0:e.map(n=>n.toLowerCase()),i=t==null?void 0:t.toLowerCase(),s=o.filter(n=>{let a=n.key.toLowerCase();return(r==null?void 0:r.includes(a))||i&&a.startsWith(i)});if(s.length>0)return s},_i=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["categoria","c"],attributePrefix:"category"}))==null?void 0:e.map(t=>t.value).join(" > ")},Ci=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["brand","b"]}))==null?void 0:e.map(t=>t.value)[0]},Ei=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["productClusterIds","productClusterNames"]}))==null?void 0:e.map(t=>`product_cluster/${t.value}`)},Ti=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["sellerName","seller"]}))==null?void 0:e.map(t=>t.value)[0]},Pi=o=>({category:_i(o),brand:Ci(o),tags:Ei(o),seller:Ti(o)}),ki=({term:o,category:e,brand:t,skuId:r})=>o?"search":e?"category":t?"brand_page":r?"product_page":"home",Mi=o=>{var e;let{category:t,brand:r,tags:i,seller:s}=Pi(o.search.selectedFacets),n=(e=o.search.term)!=null?e:!t&&!r?s:void 0,a=ki({term:n,category:t,brand:r,skuId:o.search.skuId});return{brand_name:r,category_name:t,tags:i,context:a,placements:o.placements,channel:o.identity.channel,term:n,session_id:o.identity.sessionId,user_id:o.identity.userId,product_sku:o.search.skuId}},Gr=async(o,e)=>{let t=Mi(o),r=await di(o.identity.publisherId,t,e);return{sponsoredProducts:Or(li(r)),stories:Or(ci(r)),banners:void 0,sponsoredBrands:void 0}};var ee=(o,e,t)=>{let r=o!==void 0&&Number.isFinite(o)&&o>0?o:e,i=new AbortController,s=setTimeout(()=>i.abort(new DOMException(`Timed out after ${r} ms`,"TimeoutError")),r),n=()=>i.abort(t==null?void 0:t.reason);return t!=null&&t.aborted?n():t==null||t.addEventListener("abort",n,{once:!0}),{signal:i.signal,clear:()=>{clearTimeout(s),t==null||t.removeEventListener("abort",n)}}};var Oi=5e3,Zr={fetcher:qr,matcher:Ur,price:Wr,available:jr};function Ri(o){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>=0;if(!e(o==null?void 0:o.price))return;let{price:t,listPrice:r}=o;return e(r)&&r>t?{price:t,listPrice:r}:{price:t}}async function Qr(o,e,t,r,{signal:i,timeout:s}={}){var d,l;let n=new Map,a=ee(s,Oi,i);try{let p=await Hr({stories:{[o]:e}},t.fetcher,(c,h)=>t.matcher(c,h),r,{signal:a.signal});for(let{story:c,product:h,offer:m}of(d=p.stories[o])!=null?d:[])if(!(!h||!m))try{let y=Ri(t.price(h,m)),A=(l=t.available)==null?void 0:l.call(t,h,m);n.set(c.ad_id,{...y&&{price:y},...A!==void 0&&{available:A}})}catch(y){console.error(`[${x}] Product details failed for ad ${c.ad_id}`,y)}}catch(p){a.signal.aborted||console.error(`[${x}] Product request failed`,p)}finally{a.clear()}return n}var Ii=2e3,Li=8,Di=o=>o!==void 0&&Number.isFinite(o)&&o>=1?Math.floor(o):Li;async function Kr({publisherId:o,sessionId:e,placement:t,userId:r,accountName:i,channel:s,quantity:n},{signal:a,timeout:d}={}){var h;if(globalThis.window===void 0||!o||!e||!t)return[];let p=ee(d,Ii,a),c=Di(n);try{let{stories:m}=await Gr({identity:{accountName:i!=null?i:"",publisherId:o,sessionId:e,userId:r,channel:s},search:{},placements:{[t]:{quantity:c,types:["story"]}}},{signal:p.signal});return((h=m[t])!=null?h:[]).slice(0,c)}catch(m){return p.signal.aborted||console.error(`[${x}] Story request failed`,{placement:t,publisherId:o,error:m}),[]}finally{p.clear()}}var Vi=3e3;function Xr(o){if(typeof Image=="undefined")return Promise.resolve(!0);let e=new Image;return e.src=o,e.decode?e.decode().then(()=>!0,()=>!1):Promise.resolve(!0)}function Yr(o,e){if(!o.length)return Promise.resolve();let t=ee(void 0,Vi,e);return new Promise(r=>{let i=()=>{t.clear(),r()};if(t.signal.aborted)return i();t.signal.addEventListener("abort",i,{once:!0});let s=0;for(let n of o)n.then(a=>{(a||++s===o.length)&&i()},()=>{++s===o.length&&i()})})}var Ni="vtex-ads-story:add-to-cart",Hi="vtex-ads-story:remove-from-cart";function Jr(o,{sku:e,seller:t},r){return new CustomEvent(o,{detail:{sku:e,...t&&{seller:t},quantity:r},bubbles:!0,composed:!0})}function eo(o,e=1){return Jr(Ni,o,e)}function to(o,e=1){return Jr(Hi,o,e)}var Ui=["publisherId","sessionId","placement","userId","accountName","channel","quantity","hydration"],Fi=new Set(["site","app"]),Bi=o=>Fi.has(o),qi={fromAttribute:o=>typeof o=="string"&&(o===""||o.toLowerCase()==="true")},zi={fromAttribute:o=>Bi(o)?o:void 0},Wi={fromAttribute:o=>o==="none"?"none":void 0},ro=({sku:o,seller:e})=>JSON.stringify([o,e!=null?e:""]),D=class extends O{constructor(){super();this.cartQuantities=new Map;this.cardVideos=new Map;this.soundPending=!1;this.carousel=new he(this,{onStep:(t,r)=>this.leaveHighlight(t,r),onLayoutChange:()=>{this.cardVideos.clear(),this.player.isOpen&&(this.afterRender=()=>{var t;return(t=this.activeVideo)==null?void 0:t.pause()})},locked:()=>this.player.isOpen||this.mediaLoading,slideDuration:()=>this.slideDuration,reducedMotion:Q});this.player=new me(this,{onStep:t=>this.stepInPlayer(t),onClose:()=>this.closePlayer()});this.events=new fe(this,{identity:()=>({sessionId:this.sessionId,userId:this.userId}),viewTargets:()=>this.viewTargets()});this.renderSlide=(t,{key:r,index:i,offset:s,active:n,hidden:a,cardRef:d,focusRef:l})=>st(t,this.videoFor(r),{label:this.labels.position(n?this.labels.watch:this.labels.show,i,this.stories.length),labels:this.labels,withVideo:n||this.inactiveAutoplay&&!a,autoplay:!this.mediaLoading,product:this.productOf(t),onSelect:n?()=>this.openPlayer():()=>this.carousel.step(s),onProductSelect:n?()=>this.openPlayer({productOpen:!0}):void 0,cta:ke(t),onCtaSelect:n?void 0:()=>this.carousel.step(s),onPress:()=>this.events.click(t),ref:d,openRef:l});this.inactiveAutoplay=!1,this.stories=[],this.requesting=!1,this.mediaLoading=!1}connectedCallback(){var t;super.connectedCallback();for(let r of this.cardVideos.values())r.resume();(t=this.request)!=null&&t.signal.aborted&&this.loadStory()}disconnectedCallback(){var t,r;super.disconnectedCallback(),(t=this.request)==null||t.abort(),(r=this.mediaWait)==null||r.abort()}willUpdate(t){Ui.some(r=>t.has(r))&&this.loadStory()}updated(){let t=this.afterRender;this.afterRender=void 0,t==null||t()}get activeHydration(){if(this.hydration!=="none")return this.hydration?this.hydration:this.accountName?Zr:void 0}async loadStory(){var n,a,d,l,p;(n=this.request)==null||n.abort();let t=new AbortController;if(this.request=t,this.player.close(),this.requesting=!1,this.showStories([]),!this.isConnected){t.abort();return}this.requesting=!!(this.publisherId&&this.sessionId&&this.placement);let r=await Kr(this,{signal:t.signal,timeout:this.timeout});if(t.signal.aborted)return;this.requesting=!1;let i=this.activeHydration;if(!i||!r.some(c=>c.product)){this.request=void 0,this.showStories(r);return}this.showStories(r,"loading");let s=await Qr((a=this.placement)!=null?a:"",r,i,{accountName:(d=this.accountName)!=null?d:"",publisherId:(l=this.publisherId)!=null?l:"",sessionId:(p=this.sessionId)!=null?p:"",userId:this.userId,channel:this.channel},{signal:t.signal,timeout:this.hydrationTimeout});t.signal.aborted||(this.request=void 0,this.products=s)}showStories(t,r){this.products=r,this.cardVideos.clear(),this.soundPending=!1,this.afterRender=void 0,this.carousel.reset(t.length),this.stories=t,this.waitForFirstMedia(t)}async waitForFirstMedia(t){var a,d,l;(a=this.mediaWait)==null||a.abort();let r=new AbortController;this.mediaWait=r;let i=b((d=t[0])==null?void 0:d.poster_url),s=b((l=t[0])==null?void 0:l.media_url),n=[];i&&n.push(Xr(i)),s&&n.push(this.videoFor(this.carousel.activeKey).ready),this.mediaLoading=n.length>0,await Yr(n,r.signal),this.mediaWait===r&&(this.mediaWait=void 0,this.mediaLoading=!1,this.events.impress(t),this.afterRender=()=>{if(this.isConnected)for(let p of this.cardVideos.values())p.resume()},this.requestUpdate())}*viewTargets(){var s;let{stories:t}=this;if(this.mediaLoading)return;if(!this.player.isExpanded)for(let[n,{key:a,index:d}]of this.carousel.visibleCards()){let l=t[d];l&&((s=this.cardVideos.get(a))!=null&&s.playing)&&(yield[n,l])}let r=this.player.stageCard,i=t[this.carousel.active];r&&i&&this.player.video.playing&&(yield[r,i])}videoFor(t){let r=this.cardVideos.get(t);return r||(r=new z(this),this.cardVideos.set(t,r)),r}get activeVideo(){return this.cardVideos.get(this.carousel.activeKey)}leaveHighlight(t,r){let i=this.cardVideos.get(t);this.soundPending||(this.soundPending=i!==void 0&&!i.muted),this.inactiveAutoplay?i==null||i.mute():i==null||i.reset(),this.player.isOpen?(this.soundPending=!1,this.afterRender=()=>this.videoFor(r).pause()):this.soundPending&&(this.afterRender=()=>{this.soundPending=!1,this.videoFor(r).playWithSound()});for(let s of this.cardVideos.keys())Math.abs(s-r)>ue&&this.cardVideos.delete(s)}stepInPlayer(t){this.carousel.step(t,{evenIfLocked:!0}),this.player.showNext(t)}openPlayer({productOpen:t=!1}={}){var r;this.player.isOpen||(this.cartQuantities.clear(),(r=this.activeVideo)==null||r.pause(),this.player.open({productOpen:t}))}closePlayer(){if(this.player.isOpen){this.player.close();for(let t of this.cardVideos.values())t.resume();this.carousel.focusActive()}}get locale(){var t,r;return(r=(t=this.closest('[lang]:not([lang=""])'))==null?void 0:t.lang)!=null?r:Pe}get labels(){var d;let{locale:t,labelAddToCart:r="",labelViewProduct:i="",labelUnavailable:s="",labelSoldOut:n=""}=this,a=JSON.stringify([t,r,i,s,n]);return((d=this.labelSet)==null?void 0:d.key)!==a&&(this.labelSet={key:a,labels:dr(t,{addToCart:r,viewProduct:i,unavailable:s,soldOut:n})}),this.labelSet.labels}get formatPrice(){var i,s;let{locale:t}=this,r=`${t}|${(i=this.currency)!=null?i:""}`;return((s=this.formatter)==null?void 0:s.key)!==r&&(this.formatter={key:r,format:Ye(t,this.currency)}),this.formatter.format}productOf(t){var i;let r=this.products==="loading"?"loading":(i=this.products)==null?void 0:i.get(t.ad_id);return Je(t,this.formatPrice,this.labels,r)}render(){let{stories:t}=this,r=this.carousel.active,i=t[r];if(!i&&!this.requesting)return u;let s=this.requesting||this.mediaLoading;return f`
|
|
1629
1629
|
<div
|
|
1630
1630
|
class="root"
|
|
1631
1631
|
?data-loading=${s}
|
|
@@ -1635,7 +1635,7 @@
|
|
|
1635
1635
|
${lt({done:!s})}
|
|
1636
1636
|
</div>
|
|
1637
1637
|
${i?this.renderPlayer(i):u}
|
|
1638
|
-
`}renderPlayer(t){let{stories:r}=this,i=this.carousel.active,s=ut(r.length,i).map(a=>{let d=(i+a+r.length)%r.length;return{offset:a,story:r[d],label:this.labels.position(this.labels.show,d,r.length)}}),n=this.productOf(t);return this.player.render(t,{labels:this.labels,navigation:r.length>1,neighbors:s,product:n,cta:ke(t),productActions:this.cartActionsFor(n),onPress:()=>this.events.click(t)})}cartActionsFor(t){let r=t==null?void 0:t.sku;if(!r)return;let i={sku:r,seller:t.seller};return{cartQuantity:this.cartQuantities.get(ro(i)),onAddToCart:()=>this.changeCart(i,1),onRemoveFromCart:()=>this.changeCart(i,-1)}}changeCart(t,r){var l;let i=ro(t),s=(l=this.cartQuantities.get(i))!=null?l:0,n=Math.max(0,s+r);if(n===s)return;n>0?this.cartQuantities.set(i,n):this.cartQuantities.delete(i),this.requestUpdate(),this.dispatchEvent(r>0?eo(t):to(t));let a;if(s===0?a="stepper":n===0&&(a="add"),!a)return;let d=a;this.updateComplete.then(()=>this.shadowRoot&&tt(this.shadowRoot,d))}};D.properties={publisherId:{attribute:"publisher-id"},sessionId:{attribute:"session-id"},placement:{},userId:{attribute:"user-id"},accountName:{attribute:"account-name"},channel:{converter:zi},timeout:{type:Number},quantity:{type:Number},currency:{},labelAddToCart:{attribute:"label-add-to-cart"},labelViewProduct:{attribute:"label-view-product"},hydration:{converter:Wi},hydrationTimeout:{type:Number,attribute:"hydration-timeout"},slideDuration:{type:Number,attribute:"slide-duration"},inactiveAutoplay:{type:Boolean,attribute:"inactive-autoplay",converter:qi},stories:{state:!0},products:{state:!0},requesting:{state:!0},mediaLoading:{state:!0}},D.styles=[g`
|
|
1638
|
+
`}renderPlayer(t){let{stories:r}=this,i=this.carousel.active,s=ut(r.length,i).map(a=>{let d=(i+a+r.length)%r.length;return{offset:a,story:r[d],label:this.labels.position(this.labels.show,d,r.length)}}),n=this.productOf(t);return this.player.render(t,{labels:this.labels,navigation:r.length>1,neighbors:s,product:n,cta:ke(t),productActions:this.cartActionsFor(n),onPress:()=>this.events.click(t)})}cartActionsFor(t){let r=t==null?void 0:t.sku;if(!r)return;let i={sku:r,seller:t.seller};return{cartQuantity:this.cartQuantities.get(ro(i)),onAddToCart:()=>this.changeCart(i,1),onRemoveFromCart:()=>this.changeCart(i,-1)}}changeCart(t,r){var l;let i=ro(t),s=(l=this.cartQuantities.get(i))!=null?l:0,n=Math.max(0,s+r);if(n===s)return;n>0?this.cartQuantities.set(i,n):this.cartQuantities.delete(i),this.requestUpdate(),this.dispatchEvent(r>0?eo(t):to(t));let a;if(s===0?a="stepper":n===0&&(a="add"),!a)return;let d=a;this.updateComplete.then(()=>this.shadowRoot&&tt(this.shadowRoot,d))}};D.properties={publisherId:{attribute:"publisher-id"},sessionId:{attribute:"session-id"},placement:{},userId:{attribute:"user-id"},accountName:{attribute:"account-name"},channel:{converter:zi},timeout:{type:Number},quantity:{type:Number},currency:{},labelAddToCart:{attribute:"label-add-to-cart"},labelViewProduct:{attribute:"label-view-product"},labelUnavailable:{attribute:"label-unavailable"},labelSoldOut:{attribute:"label-sold-out"},hydration:{converter:Wi},hydrationTimeout:{type:Number,attribute:"hydration-timeout"},slideDuration:{type:Number,attribute:"slide-duration"},inactiveAutoplay:{type:Boolean,attribute:"inactive-autoplay",converter:qi},stories:{state:!0},products:{state:!0},requesting:{state:!0},mediaLoading:{state:!0}},D.styles=[g`
|
|
1639
1639
|
:host {
|
|
1640
1640
|
display: block;
|
|
1641
1641
|
font-family: var(--vtex-ads-story-font-family, inherit);
|