PageSourceSearch

https://pillowpia.com/cdn/shop/t/37/assets/shine-trust-v4-product-badge.js?v=154519296968280918501768582937

js pillowpia.com collected 2026-10-08 09:43:39 UTC 23,224 bytes, 1 lines download raw bytes

1!function(e){"use strict";const t=setInterval((()=>{window.ST_GLOBALS&&(clearInterval(t),h().then((()=>console.info("ST Product Badge loaded"))))}));class i{constructor(t){this.editor=t,this.badgeElement=e.createElement("div"),this.badgeItemElement=e.createElement("div"),this.imageBadgeElement=null}render(){const{id:t,name:i,status:n,property:{positions:s=[],size:l,animation:o},badgeType:d,displayPosition:r,positionImage:c,hasDynamicData:p,badgeEditData:{labelLink:u=""}}=this.editor;this.badgeElement.style.display="none",this.badgeElement.classList.add("shine-trust-icon-wrap"),this.badgeElement.classList.add(`item-${t}`);const m=s.length?s[0]:null;let g="";switch(window.ST_GLOBALS.pageType){case"index":g="in-home";break;case"product":g="in-single-product";break;case"cart":g="in-cart";break;case"list-collections":g="in-list-collections";break;case"collection":g="in-collection";break;case"search":g="in-search"}if(g&&this.badgeElement.classList.add(g),this.badgeItemElement.classList.add("badgeItem"),this.badgeItemElement.classList.add(o),m){const e=m?.preset||"top-left";if("%"===(m?.unit||"%"))this.badgeItemElement.style.left=`${m.axisX}%`,this.badgeItemElement.style.top=`${m.axisY}%`;else switch(e){case"top-left":default:this.badgeItemElement.style.left=`${m.axisX}px`,this.badgeItemElement.style.top=`${m.axisY}px`;break;case"top-right":this.badgeItemElement.style.right=`${m.axisX}px`,this.badgeItemElement.style.top=`${m.axisY}px`;break;case"bottom-left":this.badgeItemElement.style.left=`${m.axisX}px`,this.badgeItemElement.style.bottom=`${m.axisY}px`;break;case"bottom-right":this.badgeItemElement.style.right=`${m.axisX}px`,this.badgeItemElement.style.bottom=`${m.axisY}px`}}if("image-badge"===d){if(this.imageBadgeElement=e.createElement("img"),this.editor?.patternBadgeCSSRender){const i=this.editor.patternBadgeCSSRender,a=`.item-${t.toString()}`,n=i.replaceAll(/{{REPLATE_ID_BADGE}}/g,a),s=e.createElement("style");s.type="text/css";const l=`${n}`;s.appendChild(e.createTextNode(l)),e.head.appendChild(s)}else window.ST_META_DATA.resizeBadge?(this.badgeItemElement.style.width=`${window.ST_META_DATA.resizeBadge}%`,this.badgeItemElement.style.maxWidth=`${l}px`):this.badgeItemElement.style.width=`${l}px`;this.badgeItemElement.style.height="auto";const i=m.imageURL,n=i.lastIndexOf("/");if(this.imageBadgeElement.setAttribute("src",a+"/assets/"+i.substring(n+1)),this.imageBadgeElement.setAttribute("alt",t),this.imageBadgeElement.setAttribute("data-src",i),this.imageBadgeElement.style.width="100%",this.imageBadgeElement.setAttribute("style","height : auto !important"),this.imageBadgeElement.style.objectFit="unset",m){"%"===(m?.unit||"%")?(this.imageBadgeElement.style.transform=`translate(${-1*m.axisX}%, ${-1*m.axisY}%)`,this.imageBadgeElement.style.WebkitTransform=`translate(${-1*m.axisX}%, ${-1*m.axisY}%)`):(this.imageBadgeElement.style.transform="translate(0)",this.imageBadgeElement.style.WebkitTransform="translate(0)")}if(""!==u){const t=e.createElement("a");t.href=u,t.target="_blank",t.style.display="inline-flex",t.style.lineHeight="1",t.style.textDecoration="none",t.appendChild(this.imageBadgeElement),this.badgeItemElement.appendChild(t)}else this.badgeItemElement.appendChild(this.imageBadgeElement)}else if("text-badge"===d){const{patternID:t,patternBadgeData:{badgeHtml:i,badgeCss:a,badgeName:n},badgeEditData:{labelText:s,fontFamily:l},patternBadgeCSSRender:o,hasDynamicData:d}=this.editor;if(this.imageBadgeElement=e.createElement("div"),this.imageBadgeElement.classList.add("patternBadgeItem"),m){"%"===(m?.unit||"%")?(this.imageBadgeElement.style.transform=`translate(${-1*m.axisX}%, ${-1*m.axisY}%)`,this.imageBadgeElement.style.WebkitTransform=`translate(${-1*m.axisX}%, ${-1*m.axisY}%)`):(this.imageBadgeElement.style.transform="translate(0)",this.imageBadgeElement.style.WebkitTransform="translate(0)")}let r=i;if(!d){const e=window.ST_GLOBALS.translate(s);r=r.replace("{{TEXT_BADGE}}",e)}""!==u&&(r=`<a href="${u}" target="_blank" style="display: inline-flex; line-height: 1; text-decoration: none">${r}</a>`),this.imageBadgeElement.innerHTML=r,this.badgeItemElement.classList.add("badgeItemPattern"),this.badgeItemElement.appendChild(this.imageBadgeElement),this.badgeElement.classList.add(t.substring(1))}return this.badgeElement.appendChild(this.badgeItemElement),{id:t,badgeEl:this.badgeElement,badgeType:d,displayPosition:r,hasDynamicData:p,positionImage:c,labelText:this.editor?.badgeEditData?.labelText,patternName:this.editor?.patternBadgeData?.badgeName,patternCss:this.editor?.patternBadgeData?.badgeCss,badgeCss:"text-badge"===d?this.editor?.patternBadgeCSSRender:"",filters:window.ST_GLOBALS.convertFilters(this.editor?.productFilters,this.editor?.selectedProducts),fontFamily:this.editor?.badgeEditData?.fontFamily}}}let a=null,n=!1,s="",l=null,o=!1,d=!1,r="",c=null;const p=["absolute","fixed","sticky"];let u="";const m={},g={default:null,custom:null,customPosition:null},h=async function(){if(!window.ST_PLAN||"ACTIVE"!==window.ST_PLAN?.status)return;const t=await window.ST_GLOBALS.getCountryCode();let p=[...window.ST_PRODUCT_BADGES,...window.ST_AUTOMATION_BADGES]||[];if(0===p.length)return;"Free"===window.ST_PLAN?.name&&(p=p.splice(0,2)),a=window.ST_GLOBALS.getBaseCDN(),n=window.ST_META_DATA.fixMultiLanguage||!1,o=window.ST_META_DATA.prefixLanguageCode||!1,d=window.ST_META_DATA.useUrlLocate||!1,s=window.ST_META_DATA.mainLanguageCode||"",r=window.ST_META_DATA.findByTitle||"",l=window.ST_GLOBALS.currentLanguage,u=window.ST_META_DATA?.excludedLinks||'a[href*="/products/"]:not(.sp-link):not(.stBadgeLo
1aded),[data-href]:not(.sp-link):not(.stBadgeLoaded)',g.default=P(),g.custom=O(),g.customPosition=x();const h=[],b={},T={};if(p.map((e=>{const{status:a=!1,property:{startDateStatus:n,endDateStatus:s,startDate:l,endDate:o},badgeEditData:d}=e,{targeting:{locationFilter:r="include",locationShow:c=["all"]}}=d;let p=!1;if("include"===r&&(c.includes("all")||c.includes(t.toLowerCase()))?p=!0:"exclude"!==r||c.includes("all")||c.includes(t.toLowerCase())||(p=!0),a&&p){let t=!1;if(n||s){const e=window.ST_GLOBALS.dateWithTimeZone(new Date,window.ST_META_DATA.timeZone),i=window.ST_GLOBALS.dateWithTimeZone(l,window.ST_META_DATA.timeZone),a=window.ST_GLOBALS.dateWithTimeZone(o,window.ST_META_DATA.timeZone);(!n&&s&&a.getTime()>=e.getTime()||n&&!s&&i.getTime()<=e.getTime()||n&&s&&i.getTime()<=e.getTime()&&a.getTime()>=e.getTime())&&(t=!0)}else t=!0;if(t){const{targeting:t={}}=d;if($(window.ST_GLOBALS.pageType,t?.pageShow,t?.collections)){const t=new i(e).render();m[t.id]=t;const a=t.fontFamily;if("object"==typeof a&&a?.fontFamily){0===h.filter((e=>e.fontFamily===a.fontFamily&&parseInt(e.fontWeight)===parseInt(a.fontWeight))).length&&h.push(a)}t?.patternCss&&!b.hasOwnProperty(t.patternName)&&(b[t.patternName]=t.patternCss),t?.badgeCss&&(T[t.id]=t.badgeCss)}}}})),h.length&&h.map((e=>{window.ST_LOADED_FONTS.includes(e.fontFamily)||window.ST_GLOBALS.loadFont(e)})),Object.keys(b).length){let e="";for(const t in b)e+=b[t];window.ST_GLOBALS.addStyle(e)}if(Object.keys(T).length){let e="";for(const t in T)e+=T[t];window.ST_GLOBALS.addStyle(e)}let S=e.URL;const _=new URL(S);c=_.searchParams.get("variant")||null,e.addEventListener("change",(function(t){const i=e.URL,a=new URL(i);c=a.searchParams.get("variant")||null,c&&S!==i&&(S=i);const n=e.body.querySelectorAll(".single-product-badge.has-dynamic-data");for(let e=0;e<n.length;e++)try{const t=n[e],i=JSON.parse(t.dataset.badge_id).id,a=JSON.parse(t.dataset.variants);if(a&&a.hasOwnProperty(c)&&m.hasOwnProperty(i)){t.classList.remove("none-variant");const e=t.querySelector(".st-label-text"),n=a[c];let{labelText:s}=m[i],l=window.ST_GLOBALS.translate(s);B(l,n)||t.classList.add("none-variant"),l=A(l,n),e.innerHTML=l}}catch(e){console.log(e)}}));const L=e.querySelector('[data-app="shine-trust-app"]'),E=e.querySelector('[data-app="shine-trust-app-single"]');L&&w(),E&&(e.body.classList.add("st-single-loaded"),f(E)),y(),setInterval((()=>{L&&w(),y()}),500)},f=async function(e){for(const t in m){const i=m[t],{filters:a}=i;if(e)try{const{product:t=""}=e.dataset,n=JSON.parse(Base64.decode(t));T(a,n,i,[null])}catch(e){console.log(e)}}},w=async function(){const e=k('.sp-product-card a[href*="/products/"]:not(.stBadgeLo
1aded)');for(const t in m){const i=m[t],{filters:a}=i;for(let t=0;t<e.length;t++){const n=e[t],s=n.getAttribute("href")||n.getAttribute("data-href");I(s);n.classList.add("stBadgeLoaded");const l=n.closest(".sp-product-card").querySelector('[data-app="shine-trust-app"]');if(l)try{const{product:e=""}=l.dataset,t=JSON.parse(Base64.decode(e));T(a,t,i,[n])}catch(e){console.log(e)}}}},y=async function(){const t=k();let i=[];const a={};for(let e=0;e<t.length;e++){const n=t[e],s=n.getAttribute("href")||n.getAttribute("data-href"),l=I(s);a.hasOwnProperty(l)?a[l].push(n):a[l]=[n],i.push(l),n.classList.add("stBadgeLoaded")}if("product"===window.ST_GLOBALS.pageType&&window.ST_GLOBALS.productHandle&&!e.body.classList.contains("st-single-loaded")&&(a.hasOwnProperty(window.ST_GLOBALS.productHandle)?a[window.ST_GLOBALS.productHandle].push(null):a[window.ST_GLOBALS.productHandle]=[null],i.push(window.ST_GLOBALS.productHandle),e.body.classList.add("st-single-loaded")),i=[...new Set(i)],i.length)if(r){G().map((e=>{let t="";t=n&&l!==s?o?`${d?window.ST_GLOBALS.shopUrlLocate:window.ST_GLOBALS.shopUrl}/search.js?q=${e}&view=shinetrust.product-handles`:`${d?window.ST_GLOBALS.shopUrlLocate:`${window.ST_GLOBALS.shopUrl}/${l}`}/search.js?q=${e}&view=shinetrust.product-handles`:`${d?window.ST_GLOBALS.shopUrlLocate:window.ST_GLOBALS.shopUrl}/search.js?q=${e}&view=shinetrust.product-handles`,b(t,a).then((()=>!0))}))}else{const e=i.length,t=50;for(let r=0;r<e;r+=t){const e=i.slice(r,r+t),c=e.length;let p="";e.map(((e,t)=>{p+=n&&l!==s&&!d?`${e}${t<c-1?" OR ":""}`:`handle:"${e}"${t<c-1?" OR ":""}`}));let u="";u=n&&l!==s?o?`${d?window.ST_GLOBALS.shopUrlLocate:window.ST_GLOBALS.shopUrl}/search.js?q=${p}&view=shinetrust.product-handles`:`${d?window.ST_GLOBALS.shopUrlLocate:`${window.ST_GLOBALS.shopUrl}/${l}`}/search.js?q=${p}&view=shinetrust.product-handles`:`${d?window.ST_GLOBALS.shopUrlLocate:window.ST_GLOBALS.shopUrl}/search.js?q=${p}&view=shinetrust.product-handles`,u&&b(u,a).then((()=>!0))}}},b=async function(e,t){try{const i=await fetch(e,{mode:"no-cors"}),a=await i.json();for(const e in m){const i=m[e],{filters:n}=i;a.map((e=>{let{handle:a}=e;t.hasOwnProperty(a)&&T(n,e,i,t[a])}))}}catch(e){console.log(e)}},T=function(e,t,i,a){let{published_at:n,created_at:s,on_sale:l,inventory:o,collections:d,tags:r,title:c,id:p,featured_image:u,available:m,price_min:g,price_max:h,vendor:f,type:w,variant:y,variants:b}=t;if(g=window.ST_GLOBALS.fixPrice(g),h=window.ST_GLOBALS.fixPrice(h),e.type)if("new-arrival"===e.type){let t=window.ST_GLOBALS.dateWithTimeZone(new Date(parseInt(n)),window.ST_META_DATA.timeZone);window.ST_META_DATA?.newArrivalByCreatedAt&&(t=window.ST_GLOBALS.dateWithTimeZone(new Date(parseInt(s)),window.ST_META_DATA.timeZone));const l=window.ST_GLOBALS.dateWithTimeZone(new Date(e.date),window.ST_META_DATA.timeZone);t.getTime()>=l.getTime()&&S(a,i,{variant:y,variants:b,inventory:o,badge_id:{id:i.id}},{title:c,featured_image:u})}else"on-sale"===e.type&&l||"low-stock"===e.type&&o>0&&o<=e.quantity?S(a,i,{variant:y,variants:b,inventory:o,badge_id:{id:i.id}},{title:c,featured_image:u}):"out-stock"!==e.type||m||S(a,i,{variant:y,variants:b,inventory:o,badge_id:{id:i.id}},{title:c,featured_image:u});else if("all"===e?.mode)S(a,i,{variant:y,variants:b,badge_id:{id:i.id},inventory:o},{title:c,featured_image:u});else if("manual"===e?.mode&&e.products.size)e.products.has(p)&&S(a,i,{variant:y,variants:b,inventory:o,badge_id:{id:i.id}},{title:c,featured_image:u});else if("condition"===e?.mode){let t=0,n=Object.keys(e.filters).length;if(e.collection.length){n+=1;const i=d.some((t=>e.collection.includes(t.toString())));(e.collection.includes("all")||i)&&(t+=1)}if(e.collectionExclude.length){n+=1;d.some((t=>e.collectionExclude.includes(t.toString())))||(t+=1)}for(const i in e.filters)"_s"===i&&c.toString().toLowerCase().includes(e.filters[i])&&(t+=1),"price"===i&&!isNaN(g)&&!isNaN(h)&&g>=e.filters[i].min&&h<=e.filters[i].max&&(t+=1),"tag"===i&&r.includes(`${e.filters.tag}`)&&(t+=1),"tagExclude"!==i||r.includes(`${e.filters.tagExclude}`)||(t+=1),"vendor"===i&&f===e.filters.vendor&&(t+=1),"type"===i&&w===e.filters.type&&(t+=1),"inventory"===i&&("instock"===e.filters.inventory.type&&m&&(t+=1),"outstock"!==e.filters.inventory.type||m||(t+=1),"less-than"===e.filters.inventory.type&&m&&!isNaN(o)&&-1!==o&&o<=e.filters.inventory.lte&&(t+=1),"great-than"===e.filters.inventory.type&&m&&!isNaN(o)&&(-1===o||o>
1=e.filters.inventory.gte)&&(t+=1));t===n&&S(a,i,{variant:y,variants:b,inventory:o,badge_id:{id:i.id}},{title:c,featured_image:u})}},S=function(t,i,a={},n={}){const{badgeType:s,displayPosition:l,positionImage:o,id:d,badgeEl:r,hasDynamicData:c,labelText:u,labelLink:m=""}=i;if(g.default)for(let e=0;e<t.length;e++){const i=t[e];if(null===i){if("product_image"===l)if(g.customPosition&&g.customPosition.hasOwnProperty(d)&&g.customPosition[d].single){const{parent:e,child:t,await:n}=g.customPosition[d].single;_({linkEl:i,parent:e,child:t,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,attrs:a,_await:n})}else{let e=[];g.custom?e=g.custom?.single.thumbnail:g.default&&(e=g.default?.single.thumbnail),e.map((e=>{const{parent:t,child:n,await:o=!1}=e;_({linkEl:i,parent:t,child:n,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,attrs:a,_await:o})}))}else if("product_information"===l){let e="below";if(o.includes("above")&&(e="above"),g.customPosition&&g.customPosition.hasOwnProperty(d)&&g.customPosition[d].single){const{parent:t,child:n,await:o}=g.customPosition[d].single;_({linkEl:i,parent:t,child:n,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,position:e,attrs:a,_await:o})}else{let t=[],n=[];g.default&&(t=g.default?.single.title,n=g.default?.single.price),g.custom&&(t=g.custom?.single.title,n=g.custom?.single.price);let p=t;"below_price"!==o&&"above_price"!==o||(p=n),p.map((t=>{const{parent:n,child:o,await:p=!1}=t;_({linkEl:i,parent:n,child:o,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,position:e,attrs:a,_await:p})}))}}}else if("product_image"===l)if(g.customPosition&&g.customPosition.hasOwnProperty(d)&&g.customPosition[d].loop){const{parent:e,child:t,await:n}=g.customPosition[d].loop;_({linkEl:i,parent:e,child:t,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,attrs:a,_await:n})}else{let e=[];g.custom?e=g.custom?.loop.thumbnail:g.default&&(e=g.default?.loop.thumbnail),e.map((e=>{const{parent:t,child:n,await:o=!1}=e;_({linkEl:i,parent:t,child:n,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,attrs:a,_await:o})}))}else if("product_information"===l){let e="below";if(o.includes("above")&&(e="above"),g.customPosition&&g.customPosition.hasOwnProperty(d)&&g.customPosition[d].loop){const{parent:t,child:n,await:o}=g.customPosition[d].loop;_({linkEl:i,parent:t,child:n,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,position:e,attrs:a,_await:o})}else{let t=[],n=[];g.default&&(t=g.default?.loop.title,n=g.default?.loop.price),g.custom&&(t=g.custom?.loop.title,n=g.custom?.loop.price);let p=t;"below_price"!==o&&"above_price"!==o||(p=n),p.map((t=>{const{parent:n,child:o,await:p=!1}=t;_({linkEl:i,parent:n,child:o,badgeEl:r,id:d,badgeType:s,hasDynamicData:c,displayPosition:l,labelText:u,position:e,attrs:a,_await:p})}))}}}else if("product_image"===l){let{featured_image:t}=n;if(!t)return;t=t.split("?")[0];const i=e.body.querySelectorAll('div[data-bg*="'+t+'"], div[data-bgset*="'+t+'"],img[src*="'+t+'"], img[srcset*="'+t+'"]');for(let e=0;e<i.length;e++){const t=i[e].parentElement;if(t&&!t.classList.contains(`item-${d}`)){const e=getComputedStyle(t);p.includes(e.position)||(t.style.position="relative");const i=D(r);if(Object.keys(a).length)for(const e in a)i.dataset[e]=JSON.stringify(a[e]);"text-badge"===s&&L(c,i,u),c&&i.classList.add("has-dynamic-data"),t.appendChild(i),i.classList.add("loaded"),t.classList.add(`item-${d}`)}}}else if("product_information"===l){const{title:e}=n;let t="below";o.includes("above")&&(t="above");const i=v(e);for(let e=0;e<i.length;e++){const n=i[e].parentNode;if(n&&!n.classList.contains(`item-${d}`)){const l=D(r);if(Object.keys(a).length)for(const e in a)l.dataset[e]=JSON.stringify(a[e]);if("text-badge"===s&&L(c,l,u),"below"===t){const t=i[e].nextSibling;null===t?n.appendChild(l):n.insertBefore(l,t)}"above"===t&&n.insertBefore(l,i[e]),c&&l.classList.add("has-dynamic-data"),l.classList.add("in-product-information"),l.classList.add("loaded"),n.classList.add(`item-${d}`)}}}},_=async function(t){const{linkEl:i,parent:a,child:n,badgeEl:s,id:l,badgeType:
1o,hasDynamicData:d,displayPosition:r="product_image",labelText:c,attrs:u={},position:m=null,_await:g=!1}=t,h=null===i;let f;if(f=a?i?i.closest(a):e.body.querySelector(a):e.body,f&&!f.classList.contains(`item-${l}`)){let e=f.querySelectorAll(n);if(0===e.length&&g){let t=0;for(;t<=10;)e=f.querySelectorAll(n),0===e.length?(await new Promise((e=>setTimeout(e,300))),t++):t=11}for(let t=0;t<e.length;t++){const a=e[t],n=getComputedStyle(a);"product_image"!==r||p.includes(n.position)||(a.style.position="relative");const g=D(s);if(Object.keys(u).length)for(const e in u)g.dataset[e]=JSON.stringify(u[e]);if("text-badge"===o&&L(d,g,c,h),m){const e=a.parentNode;if("below"===m){const t=a.nextSibling;null===t?e.appendChild(g):e.insertBefore(g,t)}else"above"===m&&e.insertBefore(g,a)}else a.appendChild(g);m&&g.classList.add("in-product-information"),i||g.classList.add("single-product-badge"),d&&g.classList.add("has-dynamic-data"),g.classList.add("loaded"),f.classList.add(`item-${l}`)}}},L=function(e,t,i,a=!1){const n=t.querySelector(".st-label-text");let s=window.ST_GLOBALS.translate(i);if(e)try{let e=JSON.parse(t.dataset.variant);if(!a&&window.ST_META_DATA?.inventoryByTotal&&(e.inventory_quantity=t.dataset.inventory),c){const i=JSON.parse(t.dataset.variants);i.hasOwnProperty(c)&&(e=i[c])}e&&(t.classList.remove("none-variant"),B(s,e)||t.classList.add("none-variant"),s=A(s,e,t),n.innerHTML=s)}catch(e){console.log(e)}},A=function(e,t,i=void 0){return e=e.replace(/{{sale_amount}}|{{sale_percent}}|{{inventory}}|{{mtf\.(.*)}}/g,(function(e){return E(e,t,i)}))},E=function(e,t,i=void 0){const{sale_amount:a,sale_percent:n,inventory_quantity:s,id:l}=t;switch(e){case"{{sale_amount}}":return a;case"{{sale_percent}}":return`${n}%`;case"{{inventory}}":return s;default:if(/{{mtf\.(.*)}}/.test(e)){const t=e.match(/{{mtf\.(.*)}}/)[1],a=window.ST_DATA_METAFIELDS;if(!a.hasOwnProperty(l))return i.classList.add("none-variant"),"";if(""!==a[l][t]&&null!==a[l][t]&&void 0!==a[l][t])return a[l][t];i.classList.add("none-variant")}return""}},B=function(e,t){let{price:i,compare_at_price:a,inventory_quantity:n,inventory_management:s}=t;i=parseFloat(i),a=parseFloat(a),n=parseInt(n),s=""===s?null:s;const l=e.match(/{{sale_amount}}|{{sale_percent}}|{{inventory}}|{{mtf\.(.*)}}/gm);if(null===l)return!1;if(l.includes("{{sale_amount}}")||l.includes("{{sale_percent}}"))return a>i;if(l.includes("{{inventory}}"))return null!==s&&-1!==n&&n>0;for(let e of l)if(/{{mtf\.(.*)}}/.test(e))return!0;return!1},v=function(t,i=null){const a=[],n=null===i?e:i;for(const e of n.querySelectorAll("div, h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a"))e.textContent.trim()===t&&0===e.children.length&&a.push(e);return a},D=function(e){const t=e.cloneNode(!0),i=t.querySelector("img");return null!==i&&(i.onerror=function(){return this.onerror="",this.src=this.getAttribute("data-src"),!0}),t},x=function(){if(window.ST_META_DATA.customBadgePosition){const e=window.ST_META_DATA.customBadgePosition.replace(/[\n\r\t]+/g,"").split(","),t={};return e.map((e=>{const i=e.split("||");i.length>=4&&(t.hasOwnProperty(i[0])||(t[i[0]]={single:null,loop:null}),t[i[0]][i[1]]={parent:i[2],child:i[3],await:!(void 0===i[4]||"1"!==i[4])})})),t}return null},O=function(){if(window.ST_META_DATA.customCompatibleTheme){const e=window.ST_META_DATA.customCompatibleTheme.replace(/[\n\r\t]+/g,"").trim().split(";;"),t={loop:{thumbnail:[{parent:".sp-product-card",child:".sp-product-card-media",await:!1}],title:[{parent:".sp-product-card",child:".sp-product-card-heading",await:!1}],price:[{parent:".sp-product-card",child:".sp-product-card-price",await:!1}]},single:{thumbnail:[],title:[],price:[]}};return e.map((e=>{if(""!==e){const i=e.split(":");if(2===i.length){i[1].split(",").map((e=>{const a=e.split("||"),n={parent:a[0],child:a[1],await:3===a.length};switch(i[0]){case"image":t.loop.thumbnail.push(n);break;case"title":t.loop.title.push(n);break;case"price":t.loop.price.push(n);break;case"imageSingle":t.single.thumbnail.push(n);break;case"titleSingle":t.single.title.push(n);break;case"priceSingle":t.single.price.push(n)}}))}}})),t}return null},P=function(){if(window.ST_META_DATA.compatibleData){const{selectors:{image:e,imageSingleProduct:t,detail
1:{title:i,price:a,titleSingleProduct:n,priceSingleProduct:s}}}=window.ST_META_DATA.compatibleData,l={loop:{thumbnail:[{parent:".sp-product-card",child:".sp-product-card-media",await:!1}],title:[{parent:".sp-product-card",child:".sp-product-card-heading",await:!1}],price:[{parent:".sp-product-card",child:".sp-product-card-price",await:!1}]},single:{thumbnail:[],title:[],price:[]}};return e.map((e=>{const t=e.split("||");l.loop.thumbnail.push({parent:t[0],child:t[1]})})),t.map((e=>{l.single.thumbnail.push({parent:null,child:e,await:1})})),i.map((e=>{const t=e.split("||");l.loop.title.push({parent:t[0],child:t[1]})})),n.map((e=>{l.single.title.push({parent:null,child:e})})),a.map((e=>{const t=e.split("||");l.loop.price.push({parent:t[0],child:t[1]})})),s.map((e=>{l.single.price.push({parent:null,child:e})})),l}return null},$=function(e,t,i=[]){let a=!1;if(t||(t=["homepage","collection_page","collection_list","product_page","search","others"]),"string"==typeof t){let i=t;switch(t){case"collection_page":i="collection";break;case"collection_list":i="list-collections";break;case"product_page":i="product";break;case"homepage":i="index";break;case"others":i="page"}"all"!==i&&i!==e||(a=!0)}else{t.map((e=>{switch(e){case"collection_page":return"collection";case"collection_list":return"list-collections";case"product_page":return"product";case"homepage":return"index";case"others":return"page";default:return e}})).includes(e)&&(a=!0)}return a},k=function(t=""){return t?e.querySelectorAll(t):u?e.querySelectorAll(u):e.querySelectorAll('a[href*="/products/"]:not(.sp-link):not(.stBadgeLo
1aded),[data-href]:not(.sp-link):not(.stBadgeLoaded)')},G=function(){let t=[],i=[];const a=e.querySelectorAll(r);for(let e=0;e<a.length;e++)t.push(a[e].innerHTML.trim()),a[e].classList.add("stTitleLoaded");t=[...new Set(t)];const n=t.length;for(let e=0;e<n;e+=50){const a=t.slice(e,e+50),n=a.length;let s="";a.map(((e,t)=>{s+=`title:"${e}"${t<n-1?" OR ":""}`})),s&&i.push(s)}return i},I=function(e){const t=e.split("#")[0].split("?")[0].split("/products/");return decodeURIComponent(t[1])}}(window.document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.