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 a=this.activeTemplate.querySelector(`${t}`);return s?.forEach((t=>{a.setAttribute(t?.name,t?.val)})),!(!a||!e)&&(e&&a?.insertAdjacentHTML(n||"beforeend",e),a?.classList.remove("--hidden"),!0)}getHotspotWrapperName(t,e,s){const n=e?".hotspot_link_headline":".hotspot_headline",a=s.querySelector(n)?.content.cloneNode(!0);if(!a||!t)return null;const i=`${this.txt["Strefa rekomendacji"]}: ${t}`,o=`${this.txt["Strefa rekomendacji"]} ${t}: ${this.txt["Zobacz wiÄcej"]}`;return a.querySelector(".headline__name")?.insertAdjacentHTML("afterbegin",t),a.querySelector(".headline__name")?.setAttribute("aria-label",i),a.querySelector("a.headline")?.setAttribute("href",e),a.querySelector("a.headline")?.setAttribute("title",i),a.querySelector("a.headline__after")?.setAttribute("href",e),a.querySelector("a.headline__after")?.setAttribute("title",o),a.querySelector("a.headline__after .link__text")?.setAttribute("aria-label",o),a}getHotspotWrapper(t,e){const s=e.querySelector("template.hotspot_wrapper")?.content.cloneNode(!0);if(!s)return null;const{name:n,url:a}=t,i=this.getHotspotWrapperName(n,a,e);return i?(s.querySelector(".hotspot__name").append(i),s):(s.querySelector(".hotspot__name")?.remove(),s)}getImgElement(){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}" 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}" 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:a}=this.currProductsData,i=n?.map((t=>t?.price?.unit?.[s]||t?.price?.price?.[s])),o=((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>`),o?.value!==r?.value?(this.setHtml(".price.--normal .price__range.--min",`<span class="sr-only">${this.txt?.od} </span>${o.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(a,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=>{const a=e.querySelector("template.hotspot_product")?.content.cloneNode(!0);if(!s||!a)return;this.currProductsData=t,this.activeTemplate=a;const{id:i,name:o,link:r}=this.currProductsData,p=[{name:"href",val:r},{name:"title",val:o}];this.setHtml(".product",!1,[{name:"data-id",val:i}]),this.setHtml(".product__name",o,p),this.setHtml(".product__icon",this.getImgElement(),p,"afterbegin"),this.setPrices(),n.push(a)})),n}async initCallback(t,e,s,n){t&&await Object.values(t).reduce((async(t,a)=>{await t,await(a?.(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"),a=this.getHotspotProducts(t,e);a&&0!==a.length?(a?.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),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-
1pagetype]")].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 a=t.length?await this.fetchData({data:s,linkParameter:"?opinion"}):{data:n};if(!a)return!1;const i=t.length?{...a.data,...n}:{...a.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(),a=this.hotspotTemplate?.querySelector(`.product[data-id="${t}"] .product__content_wrapper`);return!(!a||!n)&&(a.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)}}app_shop.vars.hotspotCallbacksBeforeAppend.opinion=async(...t)=>{const e=new HotspotOpinionsPlugin;await e.init(t)};
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.