var __defProp=Object.defineProperty,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__publicField=(t,e,n)=>(__defNormalProp(t,"symbol"!=typeof e?e+"":e,n),n);!function(){"use strict";var t,e;(e=t||(t={})).FIRST_PARTY="firstParty",e.THIRD_PARTY="thirdParty";const n=Object.freeze({markWidgetLoaded:t=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:loaded`)},markWidgetStart:(t,e)=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:start`,{detail:e})},markWidgetEnd:(t,e)=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:end`,{detail:e})}}),i={};class o{constructor(t){this.getYotpoAnalytics(t)}async trackCustomWidgetAction(t,e,n,i){return this.trackWidgetEvent(t,e,n,i)}async trackClickedOn(t,e,n){return this.trackWidgetEvent("clicked_on",t,e,n)}async trackError(t,e,n){return this.trackWidgetEvent("error",t,e,n)}async trackFilterResults(t,e,n){return this.trackWidgetEvent("filter_results",t,e,n)}async trackHidden(t,e,n){return this.trackWidgetEvent("hidden",t,e,n)}async trackHook(t,e,n){return this.trackWidgetEvent("hook",t,e,n)}async trackHovered(t,e,n){return this.trackWidgetEvent("hovered",t,e,n)}async trackLoaded(t,e,n){return this.trackWidgetEvent("loaded",t,e,n)}async trackShown(t,e,n){return this.trackWidgetEvent("shown",t,e,n)}async trackWidgetLoaded(t,e,n){const i=await this.analyticsLoadingPromise;return i?i.trackWidgetLoaded(t,e,n):Promise.resolve(!1)}async getDomainUserId(){return this.analyticsLoadingPromise.then((t=>t?null==t?void 0:t.getDomainUserId():null))}async getHashFunction(){return this.analyticsLoadingPromise.then((t=>t?null==t?void 0:t.getHashFunction():()=>""))}createYotpoAnalyticsWithRetries(t,e,n){var i,o;t<=0?e(!1):void 0!==window.Yotpo&&(null===(i=null===window||void 0===window?void 0:window.yotpoWidgetsContainer)||void 0===i?void 0:i.Analytics)&&(null===(o=null===window||void 0===window?void 0:window.yotpoWidgetsContainer)||void 0===o?void 0:o.AnalyticsTools)?e(!0):setTimeout((()=>{t-=1,this.createYotpoAnalyticsWithRetries(t,e,n)}),50)}getYotpoAnalytics(t){return this.analyticsLoadingPromise||(this.analyticsLoadingPromise=new Promise(((t,e)=>{this.createYotpoAnalyticsWithRetries(10,t,e)})).then((e=>e?window.yotpoWidgetsContainer.AnalyticsTools.WidgetsAnalyticsFactory(t):null))),this.analyticsLoadingPromise}async trackWidgetEvent(t,e,n,i){const o=await this.analyticsLoadingPromise;return o?null==o?void 0:o.trackWidgetEvent(t,e,n,i):Promise.resolve(!1)}}class r{}function s(t){if(f(t)){const e={};for(let n=0;n{if(t){const n=t.split(l);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function u(t){let e="";if(b(t))e=t;else if(f(t))for(let n=0;nm(t,e)))}const h=Object.assign,g=Object.prototype.hasOwnProperty,y=(t,e)=>g.call(t,e),f=Array.isArray,v=t=>"[object Map]"===k(t),w=t=>"[object Date]"===k(t),b=t=>"string"==typeof t,S=t=>"symbol"==typeof t,_=t=>null!==t&&"object"==typeof t,T=Object.prototype.toString,k=t=>T.call(t),x=t=>b(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,L=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},R=/-(\w)/g,O=L((t=>t.replace(R,((t,e)=>e?e.toUpperCase():"")))),C=/\B([A-Z])/g,E=L((t=>t.replace(C,"-$1").toLowerCase())),A=t=>{const e=parseFloat(t);return isNaN(e)?t:e};function P(t,e=undefined){e&&e.active&&e.effects.push(t)}const F=t=>{const e=new Set(t);return e.w=0,e.n=0,e},B=t=>(t.w&M)>0,I=t=>(t.n&M)>0,j=new WeakMap;let D=0,M=1;let W;const $=Symbol(""),N=Symbol("");class H{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],this.parent=void 0,P(this,n)}run(){if(!this.active)return this.fn();let t=W,e=V;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=W,W=this,V=!0,M=1<<++D,D<=30?(({deps:t})=>{if(t.length)for(let e=0;e{const{deps:e}=t;if(e.length){let n=0;for(let i=0;i{("length"===n||n>=t)&&a.push(e)}))}else switch(void 0!==n&&a.push(s.get(n)),e){case"add":f(t)?x(n)&&a.push(s.get("length")):(a.push(s.get($)),v(t)&&a.push(s.get(N)));break;case"delete":f(t)||(a.push(s.get($)),v(t)&&a.push(s.get(N)));break;case"set":v(t)&&a.push(s.get($))}if(1===a.length)a[0]&&Z(a[0]);else{const t=[];for(const e of a)e&&t.push(...e);Z(F(t))}}function Z(t,e){const n=f(t)?t:[...t];for(const i of n)i.computed&&q(i);for(const i of n)i.computed||q(i)}function q(t,e){(t!==W||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const J=function(t,e){const n=Object.create(null),i=t.split(",");for(let o=0;o!!n[t.toLowerCase()]:t=>!!n[t]}("__proto__,__v_isRef,__isVue"),X=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(S)),Q=nt(),tt=nt(!0),et=function(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=pt(this);for(let e=0,o=this.length;e{t[e]=function(...t){Y.push(V),V=!1;const n=pt(this)[e].apply(this,t);return function(){const t=Y.pop();V=void 0===t||t}(),n}})),t}();function nt(t=!1,e=!1){return function(n,i,o){if("__v_isReactive"===i)return!t;if("__v_isReadonly"===i)return t;if("__v_isShallow"===i)return e;if("__v_raw"===i&&o===(t?e?lt:at:e?st:rt).get(n))return n;const r=f(n);if(!t&&r&&y(et,i))return Reflect.get(et,i,o);const s=Reflect.get(n,i,o);return(S(i)?X.has(i):J(i))||(t||G(n,0,i),e)?s:ht(s)?r&&x(i)?s:s.value:_(s)?t?function(t){return ut(t,!0,ot,null,at)}(s):dt(s):s}}const it={get:Q,set:function(t=!1){return function(e,n,i,o){let r=e[n];if(mt(r)&&ht(r)&&!ht(i))return!1;if(!t&&(!function(t){return!(!t||!t.__v_isShallow)}(i)&&!mt(i)&&(r=pt(r),i=pt(i)),!f(e)&&ht(r)&&!ht(i)))return r.value=i,!0;const s=f(e)&&x(n)?Number(n)!Object.is(t,e))(i,r)&&K(e,"set",n,i):K(e,"add",n,i)),a}}(),deleteProperty:function(t,e){const n=y(t,e);t[e];const i=Reflect.deleteProperty(t,e);return i&&n&&K(t,"delete",e,void 0),i},has:function(t,e){const n=Reflect.has(t,e);return(!S(e)||!X.has(e))&&G(t,0,e),n},ownKeys:function(t){return G(t,0,f(t)?"length":$),Reflect.ownKeys(t)}},ot={get:tt,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},rt=new WeakMap,st=new WeakMap,at=new WeakMap,lt=new WeakMap;function ct(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>k(t).slice(8,-1))(t))}function dt(t){return mt(t)?t:ut(t,!1,it,null,rt)}function ut(t,e,n,i,o){if(!_(t)||t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=o.get(t);if(r)return r;const s=ct(t);if(0===s)return t;const a=new Proxy(t,2===s?i:n);return o.set(t,a),a}function mt(t){return!(!t||!t.__v_isReadonly)}function pt(t){const e=t&&t.__v_raw;return e?pt(e):t}function ht(t){return!(!t||!0!==t.__v_isRef)}let gt=!1;const yt=[],ft=Promise.resolve(),vt=t=>ft.then(t),wt=t=>{yt.includes(t)||yt.push(t),gt||(gt=!0,vt(bt))},bt=()=>{for(const t of yt)t();yt.length=0,gt=!1},St=/^(spellcheck|draggable|form|list|type)$/,_t=({el:t,get:e,effect:n,arg:i,modifiers:o})=>{let r;"class"===i&&(t._class=t.className),n((()=>{let n=e();if(i)null!=o&&o.camel&&(i=O(i)),Tt(t,i,n,r);else{for(const e in n)Tt(t,e,n[e],r&&r[e]);for(const e in r)(!n||!(e in n))&&Tt(t,e,null)}r=n}))},Tt=(t,e,n,i)=>{if("class"===e)t.setAttribute("class",u(t._class?[t._class,n]:n)||"");else if("style"===e){n=s(n);const{style:e}=t;if(n)if(b(n))n!==i&&(e.cssText=n);else{for(const t in n)xt(e,t,n[t]);if(i&&!b(i))for(const t in i)null==n[t]&&xt(e,t,"")}else t.removeAttribute("style")}else t instanceof SVGElement||!(e in t)||St.test(e)?"true-value"===e?t._trueValue=n:"false-value"===e?t._falseValue=n:null!=n?t.setAttribute(e,n):t.removeAttribute(e):(t[e]=n,"value"===e&&(t._value=n))},kt=/\s*!important$/,xt=(t,e,n)=>{f(n)?n.forEach((n=>xt(t,e,n))):e.startsWith("--")?t.setProperty(e,n):kt.test(n)?t.setProperty(E(e),n.replace(kt,""),"important"):t[e]=n},Lt=(t,e)=>{const n=t.getAttribute(e);return null!=n&&t.removeAttribute(e),n},Rt=(t,e,n,i)=>{t.addEventListener(e,n,i)},Ot=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ct=["ctrl","shift","alt","meta"],Et={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>Ct.some((n=>t[`${n}Key`]&&!e[n]))},At=({el:t,get:e,exp:n,arg:i,modifiers:o})=>{if(!i)return;let r=Ot.test(n)?e(`(e => ${n}(e))`):e(`($event => { ${n} })`);if("vue:mounted"!==i){if("vue:unmounted"===i)return()=>r();if(o){"click"===i&&(o.right&&(i="contextmenu"),o.middle&&(i="mouseup"));const t=r;r=e=>{if(!("key"in e)||E(e.key)in o){for(const t in o){const n=Et[t];if(n&&n(e,o))return}return t(e)}}}Rt(t,i,r,o)}else vt(r)},Pt=({el:t,get:e,effect:n})=>{n((()=>{t.textContent=Ft(e())}))},Ft=t=>null==t?"":_(t)?JSON.stringify(t,null,2):String(t),Bt=t=>"_value"in t?t._value:t.value,It=(t,e)=>{const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e},jt=t=>{t.target.composing=!0},Dt=t=>{const e=t.target;e.composing&&(e.composing=!1,Mt(e,"input"))},Mt=(t,e)=>{const n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)},Wt=Object.create(null),$t=(t,e,n)=>Nt(t,`return(${e})`,n),Nt=(t,e,n)=>{const i=Wt[e]||(Wt[e]=Ht(e));try{return i(t,n)}catch(o){}},Ht=t=>{try{return new Function("$data","$el",`with($data){${t}}`)}catch(e){return()=>{}}},Ut={bind:_t,on:At,show:({el:t,get:e,effect:n})=>{const i=t.style.display;n((()=>{t.style.display=e()?i:"none"}))},text:Pt,html:({el:t,get:e,effect:n})=>{n((()=>{t.innerHTML=e()}))},model:({el:t,exp:e,get:n,effect:i,modifiers:o})=>{const r=t.type,s=n(`(val) => { ${e} = val }`),{trim:a,number:l="number"===r}=o||{};if("SELECT"===t.tagName){const e=t;Rt(t,"change",(()=>{const t=Array.prototype.filter.call(e.options,(t=>t.selected)).map((t=>l?A(Bt(t)):Bt(t)));s(e.multiple?t:t[0])})),i((()=>{const t=n(),i=e.multiple;for(let n=0,o=e.options.length;n-1:o.selected=t.has(r);else if(m(Bt(o),t))return void(e.selectedIndex!==n&&(e.selectedIndex=n))}!i&&-1!==e.selectedIndex&&(e.selectedIndex=-1)}))}else if("checkbox"===r){let e;Rt(t,"change",(()=>{const e=n(),i=t.checked;if(f(e)){const n=Bt(t),o=p(e,n),r=-1!==o;if(i&&!r)s(e.concat(n));else if(!i&&r){const t=[...e];t.splice(o,1),s(t)}}else s(It(t,i))})),i((()=>{const i=n();f(i)?t.checked=p(i,Bt(t))>-1:i!==e&&(t.checked=m(i,It(t,!0))),e=i}))}else if("radio"===r){let e;Rt(t,"change",(()=>{s(Bt(t))})),i((()=>{const i=n();i!==e&&(t.checked=m(i,Bt(t)))}))}else{const e=t=>a?t.trim():l?A(t):t;Rt(t,"compositionstart",jt),Rt(t,"compositionend",Dt),Rt(t,null!=o&&o.lazy?"change":"input",(()=>{t.composing||s(e(t.value))})),a&&Rt(t,"change",(()=>{t.value=t.value.trim()})),i((()=>{if(t.composing)return;const i=t.value,o=n();document.activeElement===t&&e(i)===o||i!==o&&(t.value=o)}))}},effect:({el:t,ctx:e,exp:n,effect:i})=>{vt((()=>i((()=>Nt(e.scope,n,t)))))}},zt=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Vt=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Yt=/^\(|\)$/g,Gt=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,Kt=(t,e,n)=>{const i=e.match(zt);if(!i)return;const o=t.nextSibling,r=t.parentElement,s=new Text("");r.insertBefore(s,t),r.removeChild(t);const a=i[2].trim();let l,c,d,u,m=i[1].trim().replace(Yt,"").trim(),p=!1,h="key",g=t.getAttribute(h)||t.getAttribute(h=":key")||t.getAttribute(h="v-bind:key");g&&(t.removeAttribute(h),"key"===h&&(g=JSON.stringify(g))),(u=m.match(Vt))&&(m=m.replace(Vt,"").trim(),c=u[1].trim(),u[2]&&(d=u[2].trim())),(u=m.match(Gt))&&(l=u[1].split(",").map((t=>t.trim())),p="["===m[0]);let y,v,w,b=!1;const S=(t,e,i,o)=>{const r={};l?l.forEach(((t,n)=>r[t]=e[p?n:t])):r[m]=e,o?(c&&(r[c]=o),d&&(r[d]=i)):c&&(r[c]=i);const s=re(n,r),a=g?$t(s.scope,g):i;return t.set(a,i),s.key=a,s},T=(e,n)=>{const i=new ae(t,e);return i.key=e.key,i.insert(r,n),i};return n.effect((()=>{const t=$t(n.scope,a),e=w;if([v,w]=(t=>{const e=new Map,n=[];if(f(t))for(let i=0;iT(t,s))),b=!0})),o},Zt=({el:t,ctx:{scope:{$refs:e}},get:n,effect:i})=>{let o;return i((()=>{const i=n();e[i]=t,o&&i!==o&&delete e[o],o=i})),()=>{o&&delete e[o]}},qt=/^(?:v-|:|@)/,Jt=/\.([\w-]+)/g;let Xt=!1;const Qt=(t,e)=>{const n=t.nodeType;if(1===n){const n=t;if(n.hasAttribute("v-pre"))return;let i;if(Lt(n,"v-cloak"),i=Lt(n,"v-if"))return((t,e,n)=>{const i=t.parentElement,o=new Comment("v-if");i.insertBefore(o,t);const r=[{exp:e,el:t}];let s,a;for(;(s=t.nextElementSibling)&&(a=null,""===Lt(s,"v-else")||(a=Lt(s,"v-else-if")));)i.removeChild(s),r.push({exp:a,el:s});const l=t.nextSibling;i.removeChild(t);let c,d=-1;const u=()=>{c&&(i.insertBefore(o,c.el),c.remove(),c=void 0)};return n.effect((()=>{for(let t=0;t{let n=t.firstChild;for(;n;)n=Qt(n,e)||n.nextSibling},ee=(t,e,n,i)=>{let o,r,s;if(":"===(e=e.replace(Jt,((t,e)=>((s||(s={}))[e]=!0,""))))[0])o=_t,r=e.slice(1);else if("@"===e[0])o=At,r=e.slice(1);else{const t=e.indexOf(":"),n=t>0?e.slice(2,t):e.slice(2);o=Ut[n]||i.dirs[n],r=t>0?e.slice(t+1):void 0}o&&(o===_t&&"ref"===r&&(o=Zt),ne(t,o,n,i,r,s),t.removeAttribute(e))},ne=(t,e,n,i,o,r)=>{const s=e({el:t,get:(e=n)=>$t(i.scope,e,t),effect:i.effect,ctx:i,exp:n,arg:o,modifiers:r});s&&i.cleanups.push(s)},ie=(t,e)=>{if("#"!==e[0])t.innerHTML=e;else{const n=document.querySelector(e);t.appendChild(n.content.cloneNode(!0))}},oe=t=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...t,scope:t?t.scope:dt({}),dirs:t?t.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Xt)return wt(t),t;const n=function(t,e){t.effect&&(t=t.effect.fn);const n=new H(t);e&&(h(n,e),e.scope&&P(n,e.scope)),(!e||!e.lazy)&&n.run();const i=n.run.bind(n);return i.effect=n,i}(t,{scheduler:()=>wt(n)});return e.effects.push(n),n}};return e},re=(t,e={})=>{const n=t.scope,i=Object.create(n);Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)),i.$refs=Object.create(n.$refs);const o=dt(new Proxy(i,{set:(t,e,i,r)=>r!==o||t.hasOwnProperty(e)?Reflect.set(t,e,i,r):Reflect.set(n,e,i)}));return se(o),{...t,scope:o}},se=t=>{for(const e of Object.keys(t))"function"==typeof t[e]&&(t[e]=t[e].bind(t))};class ae{get el(){return this.start||this.template}constructor(t,e,n=!1){this.isFragment=t instanceof HTMLTemplateElement,n?this.template=t:this.isFragment?this.template=t.content.cloneNode(!0):this.template=t.cloneNode(!0),n?this.ctx=e:(this.parentCtx=e,e.blocks.push(this),this.ctx=oe(e)),Qt(this.template,this.ctx)}insert(t,e=null){if(this.isFragment)if(this.start){let n,i=this.start;for(;i&&(n=i.nextSibling,t.insertBefore(i,e),i!==this.end);)i=n}else this.start=new Text(""),this.end=new Text(""),t.insertBefore(this.end,e),t.insertBefore(this.start,this.end),t.insertBefore(this.template,this.end);else t.insertBefore(this.template,e)}remove(){if(this.parentCtx&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(this.parentCtx.blocks,this),this.start){const t=this.start.parentNode;let e,n=this.start;for(;n&&(e=n.nextSibling,t.removeChild(n),n!==this.end);)n=e}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach((t=>{t.teardown()})),this.ctx.effects.forEach(z),this.ctx.cleanups.forEach((t=>t()))}}const le=t=>t.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),ce=t=>{const e=oe();if(t&&(e.scope=dt(t),se(e.scope),t.$delimiters)){const[n,i]=e.delimiters=t.$delimiters;e.delimitersRE=new RegExp(le(n)+"([^]+?)"+le(i),"g")}let n;return e.scope.$s=Ft,e.scope.$nextTick=vt,e.scope.$refs=Object.create(null),{directive(t,n){return n?(e.dirs[t]=n,this):e.dirs[t]},mount(t){if("string"==typeof t&&!(t=document.querySelector(t)))return;let i;return i=(t=t||document.documentElement).hasAttribute("v-scope")?[t]:[...t.querySelectorAll("[v-scope]")].filter((t=>!t.matches("[v-scope] [v-scope]"))),i.length||(i=[t]),n=i.map((t=>new ae(t,e,!0))),this},unmount(){n.forEach((t=>t.teardown()))}}},de=document.currentScript;de&&de.hasAttribute("init")&&ce().mount();var ue=(t=>(t.PRODUCT="product",t.CATEGORY="collection",t.HOME="index",t.CART="cart",t.PRODUCT_GRID="product-grid",t))(ue||{}),me=(t=>(t.SUMMARY="summary",t.REVIEWS="reviews",t))(me||{});const pe=(t,e)=>{if(void 0!==t&&""!==t)switch(typeof t){case"string":return["true","false"].includes(t)?"true"===t:t;case"boolean":return t}return e},he=t=>{const e=t["data-yotpo-section-id"];return e.includes(ue.CATEGORY)||e.includes(ue.HOME)||e.includes(ue.CART)||e.includes(ue.PRODUCT_GRID)},ge=["view-alignment","bottom-line-enable","bottom-line-text","view-text-color","rating-score-enable"],ye=t=>null==t,fe=t=>"true"===t||"false"===t?"true"===t:t,ve=(t,e)=>t.hasOwnProperty("getter")?t.getter(e):e,we=(t,e,n)=>t.hasOwnProperty("getter")?t.getter(e,n):n,be=(t,e)=>{if(!t.hasOwnProperty("getIdAttribute"))throw new Error(`No getIdAttribute method was specified for regex item "${t}"`);const n=[],i=new RegExp(t.regex);for(const o in e)if(o.match(i)){let i=fe(e[o]);i=we(t,o,e[o]);const{id:r,attribute:s}=t.getIdAttribute(o)||{};if(!ye(r)&&s){const e=n.find((t=>t.id===r));e?e[s]=i:n.push({...t.defaults,id:r,[s]:i})}}return n};class Se{static mapValuesToKeys(t,e,n=!0){const i={};for(const o in t){let r;const s=t[o];if(s.key){const t=s.key.toLowerCase();r=s.default,e[t]&&(r=fe(e[t])),r=ve(s,r)}else if("regex"===s.type)r=be(s,e);else{if(""===s.key&&n)throw new Error(`No key was specified for "${o}"`);r=!s.hasOwnProperty("key")&&s.hasOwnProperty("default")?s.default:Se.mapValuesToKeys(s,e)}i[o]=r}return i}static defaults(t){return Se.mapValuesToKeys(t,{})}static getCustomizationKeys(t){const e={};for(const n in t){let i;const o=t[n];i=o.key?o.key.toLowerCase():Se.getCustomizationKeys(o),e[n]=i}return e}}const _e={MOBILE:"S",TABLET:"SM",LAPTOP:"M",DESKTOP:"L"},Te="transparent",ke="rgba(0,0,0,0)",xe="#2e4f7c",Le="#e7721b",Re="#555555",Oe="#2C2C2C",Ce="#FFFFFF",Ee="#ededed";const Ae=new class{calcDisplayType(t){return _e[t]}};class Pe{getDeviceType(){return Pe.isMobileDevice()?"MOBILE":Pe.deviceTypeByWidth()}static isMobileDevice(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/\bAndroid(?:.+)Mobile\b/i)||navigator.userAgent.match(/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i)||navigator.userAgent.match(/\bokhttp\b/i)||navigator.userAgent.match(/\bWindows(?:.+)ARM\b/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/BB10/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/\b(CriOS|Chrome)(?:.+)Mobile/i)||navigator.userAgent.match(/Mobile(?:.+)Firefox\b/i)||navigator.userAgent.match(/Windows Phone/i))}static deviceTypeByWidth(){return window.innerWidth<480?"MOBILE":window.innerWidth<1440?"LAPTOP":"DESKTOP"}}const Fe=new Pe;var Be={},Ie={},je={};Object.defineProperty(je,"__esModule",{value:!0}),je.emptyFont=void 0;je.emptyFont={url:"",family:"",weight:"",style:""},Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.FontService=void 0;var De=je;function Me(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function We(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"#";return this.getFontParts(t,e).family}},{key:"getFontUrl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return this.getFontParts(t,e).url}},{key:"getFontWeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return this.getFontParts(t,e).weight}},{key:"getFontStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return this.getFontParts(t,e).style}},{key:"getPixelFontSize",value:function(t){return t?"px"===(t=t.toString()).slice(-2)?t:t+"px":""}},{key:"loadFont",value:function(t,e){var n=document.createElement("style"),i="";t.url.includes("fonts.googleapis.com/css")?i="@import url('".concat(t.url,"');"):t.url&&(i='\n @font-face {\n font-family: "'.concat(t.family,"\";\n src: url('").concat(t.url,"');\n }")),n.innerHTML=i,e.appendChild(n)}},{key:"calulcateMobileFontSize",value:function(t){var e=.8*parseInt(t,10);return e<=14?14:e}},{key:"getFontParts",value:function(e,n){if(!e)return De.emptyFont;n||(n=2===e.split("#").length?"#":"|");var i=e.split(n);if(1==i.length)return We(We({},De.emptyFont),{},{family:i[0]});var o=i[1];return We(We({},t.getFontStyleParts(i[0])),{},{url:o})}},{key:"getFontStyleParts",value:function(t){var e=t.split("@");if(1==e.length)return{family:t,style:"",weight:""};var n=e[0],i=e[1],o=null!==i.match(/i$/);return{weight:o?i.substring(0,i.length-1):i,style:o?"italic":"normal",family:n}}}],(n=null)&&Ne(e.prototype,n),i&&Ne(e,i),t}();Ie.FontService=He,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ie;Object.keys(e).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}));var n=je;Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}))}(Be);var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});var ze=Ue.ObjectUtils=void 0;function Ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Ye(t){for(var e=1;e{if(!t)return e;return t.includes("#")?t:Qe(t,e)},Qe=(t,e)=>{if(!t)return e;const n=t.match(/\d+/g)||[];let[i,o,r,s]=n;return i=i.toString(16),o=o.toString(16),r=r.toString(16),s=Math.round(255*s).toString(16),1==i.length&&(i="0"+i),1==o.length&&(o="0"+o),1==r.length&&(r="0"+r),1==s.length&&(s="0"+s),`#${i}${o}${r}${s}`},tn=t=>{const e={isMobileOverride:{default:!1,key:"is-mobile"},primaryColor:{default:xe,key:"view-primary-color"},starsColor:{default:Le,key:"view-stars-color"},textColor:{default:Re,key:"view-text-color"},alignment:{default:"left",key:"view-alignment"},primaryFont:{font:{family:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Be.FontService.getFontFamily(t,"|")},url:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Be.FontService.getFontUrl(t,"|")},weight:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Be.FontService.getFontWeight(t)},style:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Be.FontService.getFontStyle(t)}}},previewHtmlContainer:{key:"view-preview-html-container",default:""}},n=ze.removeEmptyFields(t),i={deviceType:"DESKTOP",displayType:"L",primaryColor:Xe(n["view-primary-color"],xe),starsColor:Xe(n["view-stars-color"],Le),emptyStarsColor:Ce,textColor:Xe(n["view-text-color"],Re),alignment:pe(t["view-alignment"],"left"),primaryFont:{font:{family:"'Nunito Sans'",url:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",weight:"400",style:"normal",size:"14"}},previewHtmlContainer:pe(n["view-preview-html-container"],"")},o=Se.mapValuesToKeys(e,n);return null!=!n["is-mobile"]?(o.deviceType=Fe.getDeviceType(),o.displayType=Ae.calcDisplayType(o.deviceType)):n["is-mobile"].toLowerCase()&&(o.deviceType="MOBILE",o.displayType="S"),{...i,...o}};let en;const nn=new Uint8Array(16);function on(){if(!en&&(en="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!en))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return en(nn)}const rn=[];for(let Fn=0;Fn<256;++Fn)rn.push((Fn+256).toString(16).slice(1));const sn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function an(t,e,n){if(sn.randomUUID&&!e&&!t)return sn.randomUUID();const i=(t=t||{}).random||(t.rng||on)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return function(t,e=0){return rn[t[e+0]]+rn[t[e+1]]+rn[t[e+2]]+rn[t[e+3]]+"-"+rn[t[e+4]]+rn[t[e+5]]+"-"+rn[t[e+6]]+rn[t[e+7]]+"-"+rn[t[e+8]]+rn[t[e+9]]+"-"+rn[t[e+10]]+rn[t[e+11]]+rn[t[e+12]]+rn[t[e+13]]+rn[t[e+14]]+rn[t[e+15]]}(i)}const ln="enabled";var cn=(t=>(t.CONTENT_OFFLOAD="feature_use_content_offload",t.BOTTOM_LINE_SYNDICATION="feature_reviews_bottom_line_syndication",t.BOTTOM_LINE_SYNDICATION_SETTINGS_TEXT="feature_reviews_ugc_widgets_reviews_bottom_line_syndication_settings_bottom_line_syndication_text",t.REVIEWS_SUMMARY="feature_reviews_summary",t.HIGHLY_RATED_TOPICS="feature_reviews_highly_rated_topics",t))(cn||{});class dn{constructor(t,e,n={},i={},o={},r="",s="",a="",l="",c={},d=!1){__publicField(this,"store"),__publicField(this,"config"),__publicField(this,"actions"),this.createStore(t,e,n,i,o,r,s,a,l,c,d)}awaitSummaryButtonAppear(){let t,e=1;const n=setInterval((()=>{t=document.querySelector("#yotpo-summary"),(t||e>=7)&&(clearInterval(n),this.store.mainWidgetSummaryButtonLoaded=!!t),e++}),250*e)}async awaitInitComplete(){let t=1;for(;!this.store&&t<=3;)await new Promise((e=>setTimeout(e,3e3*t))),t++;return Promise.resolve()}getStore(){return{store:this.store,config:this.config,actions:this.actions}}getConfig(){return{config:this.config,actions:this.actions}}createConfig(t,e,n={},i={},o={},r="",s="",a="",l="",c={},d=!1){const u=[`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`];return i={...i,...o},{element:t,productId:s||"4713994911841",sectionId:n["data-yotpo-section-id"],storeId:r,sessionId:an(),instanceId:a,instanceVersionId:l,startLoadDate:c.startLoadDate||new Date,widgetUuid:e,showBottomLine:pe(n["bottom-line-enable"],!0),showText:pe(n["bottom-line-enable"],!0),showRatingScore:pe(n["rating-score-enable"],!1),enableEmptyState:pe(n["empty-state-enable"],!0),bottomLineText:n["bottom-line-text"]||"{{reviews_count}} Reviews",bottomLineClickEnableSummaryFeatureOn:pe(n["bottom-line-click-enable-summary-feature-on"],!0),bottomLineClickEnableSummaryFeatureOff:pe(n["bottom-line-click-enable-summary-feature-off"],!0),bottomLineClickScrollTo:pe(n["bottom-line-click-scroll-to"],me.SUMMARY),enableAddReview:pe(n["add-review-enable"],!1),buttonText:pe(n["write-a-review-text"],"Write a review"),isReadOnly:pe(n["mode-read-only"],!1),isPreview:pe(n["mode-preview"],!1),isEmptyState:pe(n["mode-empty-state"],!1),isLoading:pe(n["mode-is-loading"],!1),isCategoryPage:he(n),rtl:pe(n.rtl,!1),showSummaryLink:!he(n)&&pe(n["star-rating-reviews-summary-toggle-enable"],!0),summaryButtonText:pe(n["summary-link-text"],"See reviews summary"),showSummaryButtonIcon:pe(n["summary-show-link-icon"],!1),staticContent:i,starsIds:u,showHighlyRatedTopics:this.isInHighlyRatedTopicsABTestingGroup(pe(n["star-rating-highly-rated-topics-toggle-enable"],!0),d),highlyRatedTopicsBackgroundColor:pe(n["star-rating-highly-rated-topics-background-color"],Ee),highlyRatedTopicsTopicColor:pe(n["star-rating-highly-rated-topics-topic-color"],Oe),reviewsSummaryTextColor:pe(n["star-rating-reviews-summary-text-color"],Oe),highlyRatedTopicsText:pe(n["star-rating-highly-rated-topics-text"],"Highly rated by customers for:"),...tn(n)}}isInHighlyRatedTopicsABTestingGroup(t,e){return t&&e}createActions(){const t=this.config.isPreview||this.config.isReadOnly,e={widget_instance_id:this.config.instanceId,instance_version_id:this.config.instanceVersionId,product_id:this.config.productId,device_type:this.config.deviceType,widget_location:un(this.config.sectionId)},s=(t=>{const e=(t=>{const{guid:e,category:n}=t;return`${e}_${n}`})(t);return i[e]||(i[e]=new o(t)),i[e]})({guid:this.config.storeId,defaultContext:e,widgetUuid:this.config.widgetUuid,category:r.category,preventEvents:t});this.actions=(t=this)=>({showEmptyState:()=>t.config.enableEmptyState&&(0===t.store.totalReviews||t.config.isEmptyState)&&t.store.bottomlineLoaded,getBottomLineText:()=>t.config.bottomLineText.replace("{{reviews_count}}",t.store.totalReviews.toString()).replace("Reviews",""+(1==t.store.totalReviews?"Review":"Reviews")),getBottomLineSyndicationText:()=>(t.config.staticContent[cn.BOTTOM_LINE_SYNDICATION_SETTINGS_TEXT]||"({{syndicated_reviews_count}} in other languages)").replace("{{syndicated_reviews_count}}",t.store.totalSyndicatedReviews.toString()),showBottomLineSyndication:()=>!t.config.isCategoryPage&&t.config.showBottomLine&&t.config.staticContent[cn.BOTTOM_LINE_SYNDICATION]===ln&&t.store?.totalSyndicatedReviews>0,isReviewsSummaryShown:()=>!!document.getElementById("yotpo-star-rating-reviews-summary"),isHighlyRatedTopicsShown:()=>!!document.getElementById("yotpo-star-rating-highly-rated-topics"),isRTL:()=>t.config.rtl,trackAppShown(t){s.trackShown("app",void 0,{app_load_duration:t.appLoadDuration,bottom_line_syndication:t.showBottomLineSyndication})},trackReviewsSummaryShown(t){s.trackShown("reviews summary",void 0,{reviews_summary:t.isReviewsSummaryShown,highly_rated_topics:t.isHighlyRatedTopicsShown})},trackError(t){s.trackError(t.label,void 0,{error_message:t.errorMessage})},trackClicked(t){s.trackClickedOn(t.label,t.property,t.context||{})},async trackWidgetLoaded(e){if(!t.config.enableEmptyState&&0===t.store.totalReviews)return;const i={...e.context,status:"ok",empty_state:t.config.enableEmptyState&&0===t.store.totalReviews};n.markWidgetEnd(r.category,t.config.widgetUuid),s.trackWidgetLoaded("widget","widget",i)},async trackLoaded(e){if(!t.config.enableEmptyState&&0===t.store.totalReviews)return;const n={...e.context,status:"ok"};s.trackLoaded("reviews_summary_topics_loaded","summary_topics",n)}})}async createStore(t,e,n={},i={},o={},r="",s="",a="",l="",c={},d=!1){this.config=this.createConfig(t,e,n,i,o,r,s,a,l,c,d),this.store=dt(this.getReactiveState()),this.createActions()}getReactiveState(){return{sequence:0,analyticsLoaded:!1,bottomlineLoaded:!1,reviewsSummaryTopicsLoaded:!1,mainWidgetSummaryButtonLoaded:!1,averageScore:0,totalReviews:0,totalSyndicatedReviews:0,reviewsSummaryTopics:[],commit(t,e){switch(t){case"loaded":this.bottomlineLoaded=e;break;case"totalReviews":this.totalReviews=e;break;case"totalSyndicatedReviews":this.totalSyndicatedReviews=e;break;case"mainWidgetSummaryButtonLoaded":this.mainWidgetSummaryButtonLoaded=e;break;case"averageScore":this.averageScore=parseFloat(e.toFixed(1));break;case"reviewsSummaryTopics":this.reviewsSummaryTopics=e;break;case"reviewsSummaryTopicsLoaded":this.reviewsSummaryTopicsLoaded=e;break;case"sequence":this.sequence=e}},storeLoaded:!0}}}function un(t){switch(t){case ue.PRODUCT:return"PRODUCT";case ue.CART:return"CART";case ue.CATEGORY:return"CATEGORY";case ue.HOME:return"HOMEPAGE";default:return"OTHER"}}var mn={};function pn(t){return(pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(mn,"__esModule",{value:!0});mn.HttpService=void 0;function hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function gn(t){for(var e=1;eSn.get(t,e)};const Tn=new class{getBottomLineData(t,e){const n=`/v3/storefront/store/${t}/product/${e}/ratings`;return _n.get(n)}getReviewsSummaryTopics(t,e){const n=`/v3/storefront/stores/${t}/products/${e}/productData?include=reviewsSummary`;return _n.get(n)}};const kn=new class{async fetchBottomLineData(t,e,n){const i=n();t.commit("loaded",!1),t.commit("reviewsSummaryTopicsLoaded",!1);const o=pe(e.isReadOnly,!1),r=pe(e.isPreview,!1),s=pe(e.isEmptyState,!1);if(o||r){const e=s?0:25,n=s?0:4.5,i=s?0:10,o=s?[]:["Sleep","Support","Customer service"];return t.commit("totalReviews",e),t.commit("averageScore",n),t.commit("totalSyndicatedReviews",i),t.commit("reviewsSummaryTopics",o),t.commit("loaded",!0),void t.commit("reviewsSummaryTopicsLoaded",!0)}const a=e.storeId??"",l=e.productId??"";Tn.getBottomLineData(a,l).then((e=>{t.commit("totalReviews",e.data.bottomline.totalReviews),t.commit("averageScore",e.data.bottomline.averageScore),t.commit("totalSyndicatedReviews",e.data.bottomline.totalReviews-e.data.bottomline.totalOrganicReviews),i.trackWidgetLoaded({context:{bottom_lines_api:e.config.yometadata.duration,bottom_line_syndication:i.showBottomLineSyndication()}})})).catch((t=>{const e=t.response?.data?.status?.message??"Failed to fetch bottom lines";i.trackError({label:"get_bottom_lines_error",errorMessage:e}),i.trackWidgetLoaded({context:{bottom_lines_api:0}})})).finally((()=>{t.commit("loaded",!0)}));const c=pe(e.showHighlyRatedTopics,!1);e.staticContent[cn.REVIEWS_SUMMARY]==ln&&c&&Tn.getReviewsSummaryTopics(a,l).then((e=>{const n=function(t){if(!t||0===t.length)return[];return function(t){return t.sort(((t,e)=>{const n=parseFloat(t.coverage),i=parseFloat(e.coverage);return n>i?-1:n(t.avgSentiment??0)>=.7)).slice(0,3).map((t=>t.topic??""))}(e.data?.response?.summaryTopics);t.commit("reviewsSummaryTopics",n),i.trackLoaded({context:{topics:n}})})).catch((t=>{const e=t.response?.data?.status?.message??"Failed to fetch reviews summary topics";i.trackError({label:"get_reviews_summary_topics_error",errorMessage:e})})).finally((()=>{t.commit("reviewsSummaryTopicsLoaded",!0)}))}},xn=t=>{t.effect((()=>{const e=t.get().callback,n=new IntersectionObserver((t=>{t.find((t=>t.isIntersecting||t.intersectionRatio>0))&&(e(),n.disconnect())}),{threshold:[0]}),i=t.el?t.el:null;i&&n.observe(i)}))},Ln='\n
\n\t
\n\t\t
\n
\n
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n \t
\n \t \n \t
\n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n \n \n {{ config.highlyRatedTopicsText }}\n \n \n \n {{ topic }}\n \n \n \n
\n
\n
\n
\n',Rn=t=>!(!t||"object"!=typeof t)&&("bottomline"in t&&"object"==typeof t.bottomline);class On{constructor(t,e){this.init(t,e)}async init(t,e){const{store:n,config:i,actions:o}=t.getStore(),r=i.isReadOnly?document.getElementsByClassName("widget-placeholder-container"):i.element,s=o(),a=(t=>{if(!t?.length)return null;try{const e=JSON.parse(t);return Rn(e)?e:null}catch{return null}})(e);a&&i.staticContent[cn.CONTENT_OFFLOAD]===ln?(n.commit("totalReviews",a.bottomline.totalReviews),n.commit("averageScore",a.bottomline.averageScore),n.commit("loaded",!0),s.trackWidgetLoaded({context:{bottom_lines_api:0}})):await kn.fetchBottomLineData(n,i,o);const l=document.head||document.getElementsByTagName("head")[0],c=l.getElementsByClassName("yotpo-reviews-star-ratings-widget-css");if(!c||0==c.length){const t=document.createElement("style");t.setAttribute("class","yotpo-reviews-star-ratings-widget-css"),l.appendChild(t),t.appendChild(document.createTextNode("\n.yotpo-reviews-star-ratings-widget {\ndisplay: flex;\n a:empty, article:empty, div:empty, dl:empty, h1:empty, h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, p:empty, section:empty, ul:empty {\n display: block;\n }\n}\n[v-cloak] {\n\tdisplay: none;\n}\n\n.yotpo-star-rating-reviews-summary-text:hover {\n cursor: pointer;\n}\n\n.yotpo-highly-rated-topics-content {\n display: inline-flex;\n gap: 0; /* Ensures no space between elements */\n cursor: pointer !important;\n}\n\n.yotpo-topic-underline {\n text-decoration: underline !important;\n cursor: pointer !important;\n}\n\n.yotpo-topic-comma {\n text-decoration: none;\n cursor: pointer !important;\n}\n\n.yotpo-widget-clear {\n animation: none;\n animation-delay: 0;\n animation-direction: normal;\n animation-duration: 0;\n animation-fill-mode: none;\n animation-iteration-count: 1;\n animation-name: none;\n animation-play-state: running;\n animation-timing-function: ease;\n backface-visibility: visible;\n background: 0;\n background-attachment: scroll;\n background-clip: border-box;\n background-color: transparent;\n background-image: none;\n background-origin: padding-box;\n background-position: 0 0;\n background-position-x: 0;\n background-position-y: 0;\n background-repeat: repeat;\n background-size: auto auto;\n border: 0;\n border-style: none;\n border-width: medium;\n border-color: inherit;\n border-bottom: 0;\n border-bottom-color: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-style: none;\n border-bottom-width: medium;\n border-collapse: separate;\n border-image: none;\n border-left: 0;\n border-left-color: inherit;\n border-left-style: none;\n border-left-width: medium;\n border-radius: 0;\n border-right: 0;\n border-right-color: inherit;\n border-right-style: none;\n border-right-width: medium;\n border-spacing: 0;\n border-top: 0;\n border-top-color: inherit;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-top-style: none;\n border-top-width: medium;\n bottom: auto;\n box-shadow: none;\n box-sizing: content-box;\n caption-side: top;\n clear: none;\n clip: auto;\n color: inherit;\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-rule-color: currentColor;\n column-rule-style: none;\n column-rule-width: none;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n cursor: auto;\n direction: ltr;\n display: inline;\n empty-cells: show;\n float: none;\n font: normal;\n font-family: var(--primary-font-family);\n font-style: var(--primary-font-style);\n font-weight: var(--primary-font-weight);\n font-size: medium;\n font-variant: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n line-height: normal;\n list-style: none;\n list-style-image: none;\n list-style-position: outside;\n list-style-type: disc;\n margin: 0;\n margin-bottom: 0;\n margin-left: 0;\n margin-right: 0;\n margin-top: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 0;\n outline: 0;\n outline-color: invert;\n outline-style: none;\n outline-width: medium;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n padding-bottom: 0;\n padding-left: 0;\n padding-right: 0;\n padding-top: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: inherit;\n text-align-last: auto;\n text-decoration: none;\n text-decoration-color: inherit;\n text-decoration-line: none;\n text-decoration-style: solid;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-style: flat;\n transition: none;\n transition-delay: 0s;\n transition-duration: 0s;\n transition-property: none;\n transition-timing-function: ease;\n unicode-bidi: normal;\n vertical-align: baseline;\n visibility: visible;\n white-space: normal;\n word-break: normal;\n widows: 0;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n}\n"))}if(r.length&&i.isReadOnly)for(let u=0;us.showBottomLineSyndication(),isReviewsSummaryShown:()=>s.isReviewsSummaryShown(),isHighlyRatedTopicsShown:()=>s.isHighlyRatedTopicsShown(),enableAddReview(){const t=this.config.enableAddReview;return!0===t||"true"===t},isScrollOnClick(){const t=this.isReviewsSummaryFeatureOn()?this.config.bottomLineClickEnableSummaryFeatureOn:this.config.bottomLineClickEnableSummaryFeatureOff;return!0===t||"true"===t},showAverageScore(){return this.showRatingScore()&&!this.methods.showEmptyState()},averageScoreColor(){return this.config.starsColor},textColor(){return this.config.textColor},primaryFontFamily(){return this.config.primaryFont.font.family},primaryFontStyle(){return this.config.primaryFont.font.style},alignment(){return this.config.alignment},primaryFontWeight(){return this.config.primaryFont.font.weight},getAverageScoreLabel(){return`${this.store.averageScore} out of 5 star rating`},getAverageScoreLabelWithReviews(){return`${this.getAverageScoreLabel()}. ${this.methods.getBottomLineText()}`},getAdaSpanId(){return`${this.config.productId}-ada-star-ratings-text`},showVerticalReviewsNumberBorder(){const t=this.showBottomLine(),e=this.showRatingScore(),n=this.methods.showEmptyState(),i=this.shouldBreakTextLine();return t&&e&&!n&&!i},showAddReview(){return this.methods.showEmptyState()&&this.enableAddReview()},showNewReviewBtnBorder(){return this.showAddReview()&&!this.shouldBreakTextLine()},showReviewsSummary(){return this.isReviewsSummaryFeatureOn()&&this.config.showSummaryLink&&this.store?.totalReviews&&(this.store.mainWidgetSummaryButtonLoaded||this.config.isPreview||this.config.isReadOnly)},showSummaryLink(){return this.showReviewsSummary()&&!this.showHighlyRatedTopics()},showHighlyRatedTopics(){return this.showReviewsSummary()&&this.isHighlyRatedTopicsFeatureOn()&&this.config.showHighlyRatedTopics&&this.reviewsSummaryTopicsLoaded()&&this.store.reviewsSummaryTopics&&this.store.reviewsSummaryTopics.length>0},showSummaryIcon(){return this.config.showSummaryButtonIcon},gradientId(t){return this.config.starsIds[t-1]},gradientUrl(t){return`url('#${this.gradientId(t)}')`},fillPercent(t){return`${100*this.fill(t)}%`},starDimensions(){return"MOBILE"===this.config.deviceType?14:15},summaryStarDimensions(){return"MOBILE"===this.config.deviceType?16:17},fill(t){return t<=this.store.averageScore+.25?1:t<=this.store.averageScore+.75?.51:0},getStarContainerClass(t){const e=this.fill(t);return`star-container ${1===e?"yotpo-sr-star-full":.51===e?"yotpo-sr-star-half":"yotpo-sr-star-empty"}`},getStarRatingsClass(){const t=`yotpo-display-${this.config.displayType.toLowerCase()}`;return["yotpo-star-ratings-widget-override-css",`yotpo-device-${this.config.deviceType.toLowerCase()}`,t]},getBreakBottomlineAlignment(){switch(this.alignment()){case"left":default:return"flex-start";case"center":return"center";case"right":return"flex-end"}},shouldBreakTextLine(){return(this.methods.getBottomLineText().length>5||"MOBILE"===this.config.deviceType)&&"product"!==this.config.sectionId},getScrollPanelStyle(){const t={display:"flex","align-items":this.getBreakBottomlineAlignment(),"flex-flow":"row wrap","flex-direction":!this.showAddReview()&&this.config.showHighlyRatedTopics?"column":"row"};return this.shouldBreakTextLine()?Object.assign(t,{"flex-direction":"column",gap:"4px"}):t},isRTL(){return this.config.rtl},getSummaryStyle(){return t=this.shouldBreakTextLine(),e=this.getBreakBottomlineAlignment(),n=this.showAverageScore(),i=this.isRTL(),o=this.isScrollOnClick(),t?{display:"flex","flex-direction":"column","align-items":e,gap:n?"6px":"4px","margin-right":"0px",direction:i?"rtl":"ltr",cursor:o?"pointer":"initial"}:{display:"flex","flex-direction":"row","align-items":e,direction:i?"rtl":"ltr",cursor:o?"pointer":"initial"};var t,e,n,i,o},getReviewsSummaryStyle(){return{display:"flex","flex-direction":"row","font-family":this.config.primaryFont.font.family,"font-style":this.config.primaryFont.font.style,"font-weight":this.config.primaryFont.font.weight,"font-size":"16px","line-height":"28px",gap:"5px","text-decoration":"underline",cursor:"pointer",height:"28px","align-items":"center",color:this.config.reviewsSummaryTextColor}},getHighlyRatedTopicsStyle(){return{display:"flex","flex-direction":"row",width:"auto","font-family":this.config.primaryFont.font.family,"font-style":this.config.primaryFont.font.style,"font-weight":this.config.primaryFont.font.weight,gap:"10px",cursor:"pointer","align-items":"start",padding:this.config.highlyRatedTopicsBackgroundColor.toLowerCase()==Te||this.config.highlyRatedTopicsBackgroundColor.toLowerCase()==ke?"8px 8px 8px 0px":"8px","border-radius":"2px",background:this.config.highlyRatedTopicsBackgroundColor}},getHighlyRatedTopicsTitleStyle(){return{color:this.config.reviewsSummaryTextColor,cursor:"pointer"}},getHighlyRatedTopicsContentStyle(){return{cursor:"pointer",color:this.config.highlyRatedTopicsTopicColor}},getReviewsSummaryIconStyle:()=>({"align-items":"center",display:"flex",cursor:"pointer"}),getReviewsSummaryTextStyle:()=>({"padding-top":"3px"}),getVerticalBorderStyle(){return{display:"flex","align-self":"center","justify-self":"center",height:"11px","border-right":"1px solid black","margin-right":(t=this.isRTL())?"0":"12px","margin-left":t?"12px":"0"};var t},getYotpoBottomlineStyle:()=>({display:"flex"}),getYotpoBottomlineTextStyle(){const t={"white-space":"nowrap","font-size":"16px","text-align":"start","font-family":this.primaryFontFamily(),"font-style":this.primaryFontStyle(),"font-weight":this.primaryFontWeight(),color:this.textColor(),"padding-top":"2px","line-height":"28px"};return this.showSummaryLink()&&Object.assign(t,{"padding-right":"10px"}),t},getBottomLineLeftPanelStyle(){return t=this.averageScoreColor(),e=this.primaryFontFamily(),n=this.primaryFontStyle(),i=this.primaryFontWeight(),o=this.isRTL(),r=this.showVerticalReviewsNumberBorder(),{display:"flex","align-self":"center",color:t,"font-family":e,"font-style":n,"font-weight":i,"font-size":"16px","margin-left":o?"0":"8px","margin-right":o?"8px":"0","margin-bottom":"1px","padding-top":r?"3px":"2px"};var t,e,n,i,o,r},getStarsStyle(){return t=this.shouldBreakTextLine(),e=this.isRTL(),t?{display:"flex","flex-direction":"row","align-items":"center","margin-left":"0",height:"28px"}:{display:"flex","flex-direction":"row","margin-left":e?"10px":"0","margin-right":e?"0":"10px","align-items":"center",height:"28px"};var t,e},getBottomLineNewReview(){return t=this.primaryFontFamily(),e=this.primaryFontStyle(),n=this.primaryFontWeight(),i=this.textColor(),{"white-space":"nowrap","font-size":"16px","line-height":"18px","text-align":"start","font-family":t,"font-style":e,"font-weight":n,color:i,"margin-left":"10px","border-left":"1px solid","padding-left":"10px",cursor:"pointer","margin-top":"7px"};var t,e,n,i},getStarContainerStyle(t){const e={display:"flex","flex-direction":"row"};if(5!==t){e[this.isRTL()?"margin-left":"margin-right"]="3.5px"}return this.isRTL()&&(e.transform="scaleX(-1)"),e},starRatingClick(){if(this.isScrollOnClick())if(this.config.bottomLineClickScrollTo==me.SUMMARY&&(this.isReviewsSummaryShown()||this.isHighlyRatedTopicsShown()))this.clickOnReviewsSummary();else{const t=document.querySelector("#yotpo-reviews-main-widget");null!=t&&(this.methods.trackClicked({label:"widget",property:"reviews"}),t.scrollIntoView({behavior:"smooth"}),t.focus())}},clickOnPostNewReview(){const t=document.querySelector(".yotpo-new-review-btn");null!=t&&(t.click(),this.methods.trackClicked({label:"widget",property:"write_review_button"}))},clickOnReviewsSummary(){const t=document.querySelector("#yotpo-summary");null!=t&&(t.click(),this.methods.trackClicked({label:"reviews_summary",property:"reviews"}))},triggerShownEvent(){if(!this.store.bottomlineLoaded||0===this.store.totalReviews&&!this.config.enableEmptyState)return;const t=(new Date).getTime()-this.config.startLoadDate.getTime();this.methods.trackAppShown({appLoadDuration:t,showBottomLineSyndication:this.showBottomLineSyndication(),isReviewsSummaryShown:this.isReviewsSummaryShown(),isHighlyRatedTopicsShown:this.isHighlyRatedTopicsShown()})},triggerReviewsSummaryShownEvent(){this.methods.trackReviewsSummaryShown({isReviewsSummaryShown:this.isReviewsSummaryShown(),isHighlyRatedTopicsShown:this.isHighlyRatedTopicsShown()})},setIntersection(){return{callback:this.triggerShownEvent}},setReviewsSummaryIntersection(){return{callback:this.triggerReviewsSummaryShownEvent}},setStyle(){return{display:"flex","justify-content":this.alignment(),"flex-direction":"row","margin-bottom":"5px"}},isReviewsSummaryFeatureOn(){return this.config.staticContent[cn.REVIEWS_SUMMARY]==ln},isHighlyRatedTopicsFeatureOn(){return this.config.staticContent[cn.HIGHLY_RATED_TOPICS]==ln}});if(d.directive("intersection",xn),r.length&&i.isReadOnly)for(let u=0;u{if(e.url&&(e.url.endsWith(".css")||Cn.some((t=>e.url.includes(t))))){const n=t.createElement("style");n.classList.add(En);let i="";i=`@import url('${e.url}');`,n.innerHTML=i,t.head.appendChild(n)}else{if(!e.url)return;((t,e,n)=>{const i=t.createElement("style");i.innerHTML=`\n @font-face {\n font-family: "${e.family}";\n src: url('${e.url}');\n font-display: swap;\n }`,i.classList.add(En),n?n.appendChild(i):t.head.appendChild(i)})(t,e,n)}};class Pn{constructor(){__publicField(this,"element"),__publicField(this,"instanceId"),__publicField(this,"productId"),__publicField(this,"merchantData"),__publicField(this,"staticContent"),__publicField(this,"guidStaticContent"),__publicField(this,"overridenCustomizations"),__publicField(this,"instaceVersionId"),__publicField(this,"startLoadDate"),__publicField(this,"areFontsLoaded"),__publicField(this,"widgetUuid"),__publicField(this,"preloadedBottomline"),__publicField(this,"removedExistingWidget",!1),__publicField(this,"firstLoad",!0),__publicField(this,"shouldABTest",!1),__publicField(this,"isInTestingGroup",!0)}init(t){if(this.staticContent=t.metadata.staticContent,this.setUuid(),n.markWidgetStart(r.category,this.widgetUuid),this.startLoadDate=new Date,!t.element.classList.contains("yotpo-widget-instance"))return;{this.element=t.element,this.firstLoad=!this.element.getAttribute("data-yotpo-widget-uuid");const e=this.element.querySelector(".yotpo-reviews-star-ratings-widget");e&&(this.element.removeChild(e),this.removedExistingWidget=!0)}this.instanceId=this.element.getAttribute("data-yotpo-instance-id")||"",this.productId=this.element.getAttribute("data-yotpo-product-id")||this.element.getAttribute("data-yotpo-cart-product-id")||"",this.preloadedBottomline=yotpoWidgetsContainer.guids?.[t.merchantData.guid]?.data?.[this.productId]?.preloadedBottomline||"",this.instaceVersionId=t.metadata.instanceVersionId||"",this.merchantData=t.merchantData;this.guidStaticContent=t.guidStaticContent&&t.guidStaticContent.ugc?t.guidStaticContent.ugc:{},this.areFontsLoaded=t.areFontsLoaded;const e=this.getLowerCaseKeysMap(t.metadata.customizations);this.overridenCustomizations=this.getCustomizations(e)}setUuid(){this.shouldABTest=this.staticContent&&this.staticContent[cn.HIGHLY_RATED_TOPICS]==ln,this.shouldABTest&&yotpoWidgetsContainer&&yotpoWidgetsContainer.testingGroupData?this.initWidgetTestingData(yotpoWidgetsContainer.testingGroupData):this.widgetUuid=an()}initWidgetTestingData(t){this.widgetUuid=t?.analyticsId}run(){if(void 0===this.element||null===this.element||!this.firstLoad&&!this.removedExistingWidget)return;if(this.element.setAttribute("data-yotpo-widget-uuid",this.widgetUuid),this.overridenCustomizations["mode-read-only"]){const t=document.createElement("div"),e=document.createElement("style");pe(this.overridenCustomizations["product-page-preview"],!0)&&!pe(this.overridenCustomizations["other-pages-preview"],!1)?(t.innerHTML=this.overridenCustomizations["view-preview-html-container"]||'
',e.innerHTML=this.overridenCustomizations["view-preview-style"]):(t.innerHTML=this.overridenCustomizations["view-preview-catalog-page-html-container"]||'
',e.innerHTML=this.overridenCustomizations["view-preview-catalog-page-style"]),document.getElementsByTagName("head")[0].appendChild(e),this.element.parentNode&&this.element.parentNode.appendChild(t)}const t=new dn(this.element,this.widgetUuid,this.overridenCustomizations,this.staticContent,this.guidStaticContent,this.merchantData.guid,this.productId,this.instanceId,this.instaceVersionId,{startLoadDate:this.startLoadDate},this.isInTestingGroup);t.awaitInitComplete().then((()=>{const{config:e}=t.getConfig();if(!this.areFontsLoaded){const t={family:e.primaryFont.font.family,url:e.primaryFont.font.url};n=document,i=this.element.parentElement,(o=[t])&&o.forEach((t=>An(n,t,i)))}var n,i,o;this.element.parentNode&&this.overridenCustomizations["mode-read-only"]&&this.element.parentNode.removeChild(this.element),t.awaitSummaryButtonAppear(),new On(t,this.preloadedBottomline)}))}getLowerCaseKeysMap(t){const e={};return Object.keys(t).forEach((n=>{e[n.toLowerCase()]=t[n]})),e}getCustomizations(t){const e=this.getQueryParams(),n=this.getElementAttributes();(t={...t,...n,...e})["mode-read-only"]&&(pe(t["product-page-preview"],!0)&&!pe(t["other-pages-preview"],!1)?t["data-yotpo-section-id"]=ue.PRODUCT:t["data-yotpo-section-id"]=ue.CATEGORY);return this.overrideCustomizationsBySection(t)}getElementAttributes(){const t={};for(let e=0,n=this.element.attributes,i=n.length;e{if(!t.includes(e)){const t=e.split("="),i=decodeURIComponent(t[0]).toLowerCase(),o=decodeURIComponent(t.length>1?t[1]:"");n[i]=o}})),n}overrideCustomizationsBySection(t){const e={};return t["data-yotpo-section-id"]||=ue.PRODUCT,ge.forEach((n=>{he(t)?e[n]=t[`${n}-category`]:e[n]=t[`${n}-product`],delete t[`${n}-product`],delete t[`${n}-category`],e[n]||=t[n]})),he(t)&&(e["add-review-enable"]=!1,e["bottom-line-click-enable-summary-feature-on"]=!1,e["bottom-line-click-enable-summary-feature-off"]=!1),{...t,...e}}}"undefined"!=typeof yotpoWidgetsContainer&&(n.markWidgetLoaded(r.category),yotpoWidgetsContainer.ReviewsStarRatingsWidget=()=>new Pn)}();