PageSourceSearch

https://winylownia.pl/gfx/pol/hotspots_javascript.js.gzip?r=1783677978

js winylownia.pl collected 2026-10-04 08:56:06 UTC 18,108 bytes, 1 lines download raw bytes

1const HOTSPOTS_GQL={HOTSPOT:(t,e)=>`${t}: hotspots(${e}) {\n      products {\n        id\n        type\n        code\n        name\n        link\n        zones\n        icon\n        iconSecond\n        iconSmall\n        iconSmallSecond\n        price {\n          rebateCodeActive\n          price {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          omnibusPrice {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          omnibusPriceDetails {\n            unit {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            youSavePercent\n            omnibusPriceIsHigherThanSellingPrice\n            newPriceEffectiveUntil {\n              formatted\n            }\n          }\n          max {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          unit {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          unitConvertedPrice {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          youSavePercent\n          beforeRebate {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          beforeRebateDetails {\n            youSavePercent\n            unit {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n          }\n          advancePrice {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          suggested {\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n          rebateNumber {\n            number\n            ${app_shop.vars.priceType} {\n              value\n              formatted\n            }\n          }\n        }\n        sizes {\n          id\n          price {\n            rebateCodeActive\n            price {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            omnibusPrice {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            omnibusPriceDetails {\n              unit {\n                ${app_shop.vars.priceType} {\n                  value\n                  formatted\n                }\n              }\n              youSavePercent\n              omnibusPriceIsHigherThanSellingPrice\n              newPriceEffectiveUntil {\n                formatted\n              }\n            }\n            max {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            unit {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            unitConvertedPrice {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            youSavePercent\n            beforeRebate {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            beforeRebateDetails {\n              youSavePercent\n              unit {\n                ${app_shop.vars.priceType} {\n                  value\n                  formatted\n                }\n              }\n            }\n            advancePrice {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            suggested {\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n            rebateNumber {\n              number\n              ${app_shop.vars.priceType} {\n                value\n                formatted\n              }\n            }\n          }\n        }\n        unit {\n          sellBy\n          plural\n          singular\n          unitConvertedFormat\n        }\n        points\n      }\n      name\n      url\n      type\n      took\n      ${"function"==typeof app_shop?.vars?.additionalHotspotQueryReduce?app_shop?.vars?.additionalHotspotQueryReduce():""}\n    }`,HOTSPOTS_ALL_QUERY:t=>JSON.stringify({query:`query {\n      ${t}\n    }`})};class GetHotspots{constructor(t={}){this.allHotspots=[...document.querySelectorAll(".hotspot__wrapper[data-
1pagetype]")],this.allHotspotsData=[],this.hotspotsToLoad=[...this.allHotspots],this.hotspotsInView=[],this.loadedHotspots=[],this.hotspotsInViewDelay=400,this.priceType=t.priceType,this.callbacksBeforeAppend=t.callbacksBeforeAppend||{},this.callbacksAfterAppend=t.callbacksAfterAppend||{},this.productsMinHeight=t.productsMinHeight??!1,this.omnibusDataAll=[],this.txt={pkt:"pkt","punktów":"punktów",od:"od",do:"do",Subskrypcja:"Subskrypcja","Strefa rekomendacji":"Strefa rekomendacji","Zobacz więcej":"Zobacz więcej"}}async fetchData(t={}){const{data:e,link:s,linkParameter:n=""}=t;if(!e)return!1;try{const t=await fetch(`${s||app_shop.urls.graphql||"/graphql/v1"}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:e});return await t.json()}catch(t){return!1}}async loadHotspots(){const t=HOTSPOTS_GQL.HOTSPOTS_ALL_QUERY(this.hotspotsInView.reduce(((t,e)=>{const s=this.allHotspotsData.filter((t=>e.id===t.id))?.[0],n=`hotspotsPanelParamsInput: { page: ${s?.page}, zone: zone${s?.zone} ${s.products?`, products: [${s.products}]`:""}}`;return t+=HOTSPOTS_GQL.HOTSPOT(s.id,n)}),""));this.hotspotsInView=[];const e=await this.fetchData({data:t,linkParameter:"?hotspots"});e.data&&(Object.entries(e?.data),this.loadedHotspots=[...this.loadedHotspots,...Object.entries(e?.data)],this.hotspotsToSet=[...Object.entries(e?.data)]),this.hotspotsToSet?.forEach((t=>{const e=this.allHotspots.filter((e=>t[0]===e.id))?.[0];return!!e&&(this.setHotspot(t[1],e),!0)}))}loadHotspotsDelay(){clearTimeout(this.loadingTimer),this.loadingTimer=setTimeout((()=>{this.loadHotspots()}),this.hotspotsInViewDelay)}getHotspotsInPage(){this.allHotspotsData=this.allHotspots.map((t=>({id:t?.id,page:t.dataset?.pagetype,zone:t.dataset?.zone,products:t.dataset?.products||null})))}hotspotObserverFunc(t){t.forEach((t=>{if(!t.isIntersecting)return!1;if(this.hotspotsToLoad.includes(t.target)){if(t.target.querySelector(".hotspot.--initialized"))return;this.hotspotsToLoad=this.hotspotsToLoad.filter((e=>e!==t.target)),this.hotspotsInView.push(t.target),this.loadHotspotsDelay(),this.hotspotObserver.unobserve(t.target)}return!0}))}hotspotObserverInit(){this.hotspotObserver=new IntersectionObserver((t=>{this.hotspotObserverFunc(t)})),this.allHotspots.forEach((t=>this.hotspotObserver.observe(t)))}setHtml(t,e,s,n){const o=this.activeTemplate.querySelector(`${t}`);return s?.forEach((t=>{o.setAttribute(t?.name,t?.val)})),!(!o||!e)&&(e&&o?.insertAdjacentHTML(n||"beforeend",e),o?.classList.remove("--hidden"),!0)}getHotspotWrapperName(t,e,s){const n=e?".hotspot_link_headline":".hotspot_headline",o=s.querySelector(n)?.content.cloneNode(!0);if(!o||!t)return null;const i=`${this.txt["Strefa rekomendacji"]}: ${t}`,a=`${this.txt["Strefa rekomendacji"]} ${t}: ${this.txt["Zobacz więcej"]}`;return o.querySelector(".headline__name")?.insertAdjacentHTML("afterbegin",t),o.querySelector(".headline__name")?.setAttribute("aria-label",i),o.querySelector("a.headline")?.setAttribute("href",e),o.querySelector("a.headline")?.setAttribute("title",i),o.querySelector("a.headline__after")?.setAttribute("href",e),o.querySelector("a.headline__after")?.setAttribute("title",a),o.querySelector("a.headline__after .link__text")?.setAttribute("aria-label",a),o}getHotspotWrapper(t,e){const s=e.querySelector("template.hotspot_wrapper")?.content.cloneNode(!0);if(!s)return null;const{name:n,url:o}=t,i=this.getHotspotWrapperName(n,o,e);return i?(s.querySelector(".hotspot__name").append(i),s):(s.querySelector(".hotspot__name")?.remove(),s)}getImgElement(t){return""+(void 0!==this.currProductsData.iconSecond&&void 0!==this.currProductsData.iconSmallSecond?`<picture>\n        <source media="(min-width: 421px)" type="image/webp" srcset="${this.currProductsData.icon}"/>\n        <source media="(min-width: 421px)" type="image/jpeg" srcset="${this.currProductsData.iconSecond}"/>\n        <source media="(max-width: 420px)" type="image/webp" srcset="${this.currProductsData.iconSmall}"/>\n        <source media="(max-width: 420px)" type="image/jpeg" srcset="${this.currProductsData.iconSmallSecond}"/>\n        <img src="${this.currProductsData.iconSecond}" ${t>2?'loading="lazy"':""} alt="${this.currProductsData.name}">\n      </picture>`:`<picture>\n        <source media="(min-width: 421px)" srcset="${this.currProductsData.icon}"/>\n        <source media="(max-width: 420px)" srcset="${this.currProductsData.iconSmall}"/>\n        <img src="${this.currProductsData.iconSecond}" ${t>2?'loading="lazy"':""} alt="${this.currProductsData.name}">\n      </picture>`)}setLabels(t){t?.length&&t.includes("subscription")&&this.setHtml(".label_icons",`<span class="label --subscription">${this.txt.Subskrypcja}</span>`)}setOmnibus(t,e){if(!t||!e)return!1;this.omnibusData=app_shop.fn.getOmnibusDetails?.({productData:this.currProductsData});const s=this.activeTemplate.querySelector(".product__prices");return!!this.omnibusData&&(s?.classList.add(...this.omnibusData.classes.add),s?.classList.remove(...this.omnibusData.classes.remove),this.setHtml(".price.--omnibus",this.omnibusData?.omnibus?.visible?this.omnibusData?.omnibus?.html:null),this.setHtml(".price.--max",this.omnibusData?.max?.visible?this.omnibusData?.max?.html:null),this.setHtml(".price.--before-rebate",this.omnibusData?.beforeRebate?.visible?this.omnibusData?.beforeRebate?.html:null),this.setHtml(".price.--new-price",this.omnibusData?.newPriceEffectiveUntil?.visible?this.omnibusData?.newPriceEffectiveUntil?.html:null),this.setHtml(".label_icons",this.omnibusData?.omnibusLabel?.html),this.omnibusDataAll?.push(this.omnibusData),!0)}setPrices(){const{price:t}=this.currProductsData.price,{unit:e}=this.currProductsData,s=this.priceType;if(0===t[s].value)return this.activeTemplate.querySelector(".price.--phone")?.classList.remove("--hidden"),this.activeTemplate.querySelector(".price.--normal.--main")?.classList.add("--hidden"),this.activeTemplate.querySelector(".product")?.classList.add("--phone"),!1;const{sizes:n,id:o}=this.currProductsData,i=n?.map((t=>t?.price?.unit?.[s]||t?.price?.price?.[s])),a=((t=[])=>t.reduce(((t,e)=>t?.value>e?.value?e:t),t[0]))(i),r=((t=[])=>t.reduce(((t,e)=>t?.value<e?.value?e:t),t[0]))(i);this.setHtml(".price_sellby__sellby",`${e?.sellBy}`,[{name:"data-sellby",val:e?.sellBy}]),this.setHtml(".price_sellby__unit",`${e?.sellBy>1?e?.plural:e?.singular}`),this.setHtml(".price_sellby__sep","/");const p=this.currProductsData.price?.unitConvertedPrice?.[s]?.formatted;p&&this.setHtml(".price.--convert",`(${p} / ${e?.unitConvertedFormat})`);const c=this.currProductsData?.points;return c&&this.setHtml(".price.--points",`${c} <span aria-hidden="true">${this.txt?.pkt}</span><span class="sr-only">${this.txt?.["punktów"]}</span>`),a?.value!==r?.value?(this.setHtml(".price.--normal .price__range.--min",`<span class="sr-only">${this.txt?.od} </span>${a.formatted}`),this.setHtml(".price.--normal .price__range.--max",`<span class="sr-only">${this.txt?.do} </span>${r.formatted}`),this.setHtml(".price.--normal .price__sep"," - "),!1):(this.setOmnibus(o,n),this.setLabels(this.currProductsData.zones),!t?.[s]||(this.setHtml(".price.--normal .price__sub",this.currProductsData.price?.unit?.[s]?.formatted||t?.[s]?.formatted),!1))}getHotspotProducts(t,e){const s=t?.products,n=[];return s?.forEach(((t,o)=>{const i=e.querySelector("template.hotspot_product")?.content.cloneNode(!0);if(!s||!i)return;this.currProductsData=t,this.activeTemplate=i;const{id:a,name:r,link:p}=this.currProductsData,c=[{name:"href",val:p},{name:"title",val:r}];this.setHtml(".product",!1,[{name:"data-id",val:a}]),this.setHtml(".product__name",r,c),this.setHtml(".product__icon",this.getImgElement(o),c,"afterbegin"),this.setPrices(),n.push(i)})),n}async initCallback(t,e,s,n){t&&await Object.values(t).reduce((async(t,o)=>
1{await t,await(o?.(e,s,n))}),Promise.resolve())}hideHotspotWrapper(t){const e=t.querySelector(".skeleton");e?.parentNode?.classList?.add?.("--hidden"),e?.parentNode?.removeChild(e)}async setHotspot(t,e){if(null===t)return void this.hideHotspotWrapper(e);const s=this.getHotspotWrapper(t,e);if(!s)return;const n=e.querySelector(".skeleton"),o=this.getHotspotProducts(t,e);o&&0!==o.length?(o?.forEach((t=>{s?.querySelector(".hotspot__products")?.append(t)})),s?.firstChild?.classList.add("--initialized"),await this.initCallback(this.callbacksBeforeAppend,t,s,e),n?.parentNode?.removeChild(n),e.prepend(s),hotspotSwiperRun(e.id),this.productsMinHeight&&app_shop.fn?.setHeight({selectors:[`#${e?.id} .product__prices`,`#${e?.id} .product__name`,`#${e?.id} .product__opinion`],container:`#${e?.id} .products`}),await this.initCallback(this.callbacksAfterAppend,t,s,e)):this.hideHotspotWrapper(e)}init(){this.allHotspots=[...document.querySelectorAll(".hotspot__wrapper[data-pagetype]")].filter((t=>t.querySelector(".hotspot:not(.--initialized)"))),this.allHotspotsData=[],this.hotspotsToLoad=[...this.allHotspots],this.hotspotsInView=[],this.getHotspotsInPage(),this.hotspotObserverInit()}}app_shop.vars.hotspotCallbacksBeforeAppend={},app_shop.vars.hotspotCallbacksAfterAppend={},app_shop.vars.additionalHotspotQueryObj={},app_shop.vars.productsMinHeight=app_shop?.vars?.hotspotsConfig?.productsMinHeight??!1,app_shop.vars.additionalHotspotQueryReduce=()=>"object"!=typeof app_shop.vars.additionalHotspotQueryObj?"":Object.values(app_shop.vars.additionalHotspotQueryObj).reduce(((t,e,s)=>`${0!==s?`${t} \n `:""} ${e}`),"");const hotspotOptions={priceType:app_shop.vars.priceType||"net",callbacksBeforeAppend:app_shop.vars.hotspotCallbacksBeforeAppend||[],callbacksAfterAppend:app_shop.vars.hotspotCallbacksAfterAppend||[],productsMinHeight:app_shop.vars.productsMinHeight??!1};app_shop.vars.hotspotCallbacksAfterAppend.omnibus=()=>{"function"==typeof runOmnibusFallback&&runOmnibusFallback()},app_shop.vars.hotspots=new GetHotspots(hotspotOptions),app_shop.run((function(){try{app_shop.vars.hotspots.init()}catch(t){window?.errorLog?.(t)}}),"all",".hotspot__wrapper",!0);const HOTSPOTS_OPINION_GQL={OPINION:(t,e)=>`${t}: opinion(${e}) {\n      id\n      author\n      content\n      rating\n      confirmedByPurchase\n    }`,OPINION_ALL_QUERY:t=>JSON.stringify({query:`query {\n      ${t}\n    }`})};class HotspotOpinionsPlugin extends GetHotspots{constructor(){super(),this.txt={"Potwierdzona zakupem":"Potwierdzona zakupem"}}async getOpinion(){const t=this.products.filter((t=>!sessionStorage.getItem(`productOpinions_${t}`))),e=this.products.filter((t=>sessionStorage.getItem(`productOpinions_${t}`))),s=HOTSPOTS_OPINION_GQL.OPINION_ALL_QUERY(t.reduce(((t,e)=>t+=HOTSPOTS_OPINION_GQL.OPINION(`productOpinions_${e}`,`SearchOpinionsInput: { type: "product", ordersBy: "date", sourceId: "${e}", resultsLimit: 1 }`)),"")),n={};e.forEach((t=>{n[`productOpinions_${t}`]=JSON.parse(sessionStorage.getItem(`productOpinions_${t}`))}));const o=t.length?await this.fetchData({data:s,linkParameter:"?opinion"}):{data:n};if(!o)return!1;const i=t.length?{...o.data,...n}:{...o.data};return Object.keys(i)?.forEach((t=>{const e=t.replace("productOpinions_","");sessionStorage.getItem(t)||sessionStorage.setItem(t,JSON.stringify(i[t])),this.setOpinion(e,i[t])})),!0}setOpinionValues(){const t=this.activeTemplate.querySelector(".opinions_element_confirmed"),e=this.activeTemplate.querySelector(".opinions_element_confirmed_text");t&&e&&this.opinionData?.confirmedByPurchase&&(t?.classList.add("--true"),t?.classList.remove("--false"),e.innerText=this.txt["Potwierdzona zakupem"]),this.setHtml(".product__opinion_client",this.opinionData?.author),this.setHtml(".note_value",this.opinionData?.rating),this.setHtml(".product__opinion_content",this.opinionData?.content),this.activeTemplate.querySelectorAll(".note .icon-star").forEach(((t,e)=>{e<(this.opinionData?.rating||0)&&t.classList.add("--active")}))}getOpinionElement(){const t=this.hotspotElement.querySelector(".hotspot_opinion")?.content.cloneNode(!0);return!!t&&(this.activeTemplate=t,this.setOpinionValues(t),t)}setOpinion(t,e){if(!e.length)return!1;const s=e[0];this.opinionData=s;const n=this.getOpinionElement(),o=this.hotspotTemplate?.querySelector(`.product[data-id="${t}"] .product__content_wrapper`);return!(!o||!n)&&(o.append(n),!0)}async init(t){const[e,s,n]=t;return this.hotspotData=e,this.hotspotTemplate=s,this.hotspotElement=n,"opinion"===this.hotspotData?.type&&(this.products=this.hotspotData?.products.map((t=>t.id)),await this.getOpinion(),!0)}}async function hotspotSwiperRun(t){const e={options:{loop:!0,autoHeight:!0,spaceBetween:16,slidesPerView:2,centeredSlides:!0,centeredSlidesB
1ounds:!0,navigation:{nextEl:`#${t} .swiper-button-next`,prevEl:`#${t} .swiper-button-prev`},breakpoints:{757:{slidesPerView:3,centeredSlides:!0}}}};app_shop.vars.view<3&&(app_shop.fn.hotspotSwiper[t]=await bmInitSlider(`#${t} .swiper`,e)),app_shop.run((async()=>{app_shop.fn.hotspotSwiper[t]=await bmInitSlider(`#${t} .swiper`,e)}),[1,2],`#${t}`),app_shop.run((()=>{app_shop.fn.hotspotSwiper[t]&&(app_shop.fn.hotspotSwiper[t].destroy(),delete app_shop.fn.hotspotSwiper[t])}),[3,4],`#${t}`)}app_shop.vars.hotspotCallbacksBeforeAppend.opinion=async(...t)=>{const e=new HotspotOpinionsPlugin;await e.init(t)},app_shop.fn.hotspotSwiper={options:{options:{loop:!1,autoHeight:!1,spaceBetween:16,slidesPerView:2,centeredSlides:!0,centeredSlidesBounds:!0,infinite:!0}}};

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.