PageSourceSearch

https://www.ohpolly.com/cdn/shop/t/1735/assets/shipping-notice.js?v=164867526771269116661789654329

js ohpolly.com collected 2026-10-03 20:38:04 UTC 4,934 bytes, 2 lines download raw bytes

1class ShippingNotice extends window.BAO.CustomElement(){connectedCallback(){this.watchPurpleDot(),this.watchOrderDeadline(),this.setupListeners(),this.checkView()}setupListeners(){this.checkView=this.checkView.bind(this),window.BAO.eventBus.addEventListener(window.BAO.EVENTS.PRODUCT.OPTION_CHANGED,this.checkView),window.BAO.eventBus.addEventListener(window.BAO.EVENTS.PRODUCT.OPTION_SELECTED,this.checkView)}checkView(event=null){const variant=event?.detail?.variant;if(variant){const currentVariantEl=this.els.currentVariant.element;currentVariantEl.setAttribute("data-current-variant-available",variant.available),currentVariantEl.setAttribute("data-current-variant-restock",this.variantHasRestock(variant.id))}setTimeout(()=>{const orderDeadlineViewEl=this.els.orderDeadlineView?.element,preorderViewEl=this.els.preorderView?.element,restockViewEl=this.els.restockView?.element;switch(this.view){case"instock":orderDeadlineViewEl?.setAttribute("aria-hidden","false"),preorderViewEl?.setAttribute("aria-hidden","true"),restockViewEl?.setAttribute("aria-hidden","true"),this.hideOrderNoteIfMarketHasNoDeadline(),this.setAttribute("aria-hidden","false");break;case"preorder":orderDeadlineViewEl?.setAttribute("aria-hidden","true"),preorderViewEl?.setAttribute("aria-hidden","false"),restockViewEl?.setAttribute("aria-hidden","true"),this.setAttribute("aria-hidden","false");break;case"restock":orderDeadlineViewEl?.setAttribute("aria-hidden","true"),preorderViewEl?.setAttribute("aria-hidden","true"),restockViewEl?.setAttribute("aria-hidden","false"),this.setAttribute("aria-hidden","false");break;case"unavailable":orderDeadlineViewEl?.setAttribute("aria-hidden","true"),preorderViewEl?.setAttribute("aria-hidden","true"),restockViewEl?.setAttribute("aria-hidden","true"),this.setAttribute("aria-hidden","true");break;default:}},200)}watchPurpleDot(){const targetElement=this.externalEls.form.element,mutationCallback=(mutationsList,observer2)=>{for(const mutation of mutationsList)mutation.type==="childList"&&mutation.addedNodes.forEach(node=>{node.nodeType===1&&node.id==="pd-branding"&&(this.checkView(),this.setAttribute("aria-hidden","false"),observer2.disconnect())})},observer=new MutationObserver(mutationCallback),observerConfig={childList:!0,subtree:!0};observer.observe(targetElement,observerConfig)}watchOrderDeadline(){const targetElement=this.querySelector(".shopify-app-block");if(!targetElement)return;const mutationCallback=(mutationsList,observer2)=>{for(const mutation of mutationsList)mutation.type==="childList"&&(window.theme.strings.products.product.free_delivery_order_deadline_message&&window.Shopify.shop==="oh-polly-uk.myshopify.com"&&this.checkIfWeNeedToUpdateTheOrderDeadlineMessage(),this.checkView())},observer=new MutationObserver(mutationCallback),observerConfig={childList:!0,subtree:!0};observer.observe(targetElement,observerConfig)}checkIfWeNeedToUpdateTheOrderDeadlineMessage(){this.dataset.freeNextDayDelivery&&(this.querySelector(".prd-OrderDeadlineApp").innerHTML=window.theme.strings.products.product.free_delivery_order_deadline_message,this.els.deliveryNoteIcon.element.style.display="block")}hideOrderNoteIfMarketHasNoDeadline(){const{isMappedMarket,shippingGroupPromise}=window.BAO.orderDeadline;if(!isMappedMarket){this.hideOrderNoteIfCustomerIsOutsideOfUK();return}shippingGroupPromise.then(shippingGroupId=>{this.setAttribute("aria-hidden",shippingGroupId?"false":"true")})}hideOrderNoteIfCustomerIsOutsideOfUK(){window.Shopify.shop==="oh-polly-uk.myshopify.com"&&window.BAO.geoLocationPromise.finally(()=>{window.theme.customer.countryCode!=="GB"?this.setAttribute("aria-hidden","true"):this.setAttribute("aria-hidden","false")})}variantHasRestock(variantId){const restockByVariant=this.restockByVariant;return Object.prototype.hasOwnProperty.call(restockByVariant,String(variantId))?restockByVariant[String(variantId)]===!0?"true":"false":this.els.currentVariant.element.dataset.currentVariantRestock}get restockByVariant(){const restockByVariantEl=this.els.restockByVariant?.element;if(!restockByVariantEl)return{};try{return JSON.parse(restockByVariantEl.textContent)}catch{return{}}}get view(){const formEl=this.externalEls.form?.element;if(formEl?.classList.contains("is-preorder-variant")||formEl?.classList.contains("x-pd-atc-form--preorder"))return"preorder";const learnMoreEl=formEl?.querySelector("purple-dot-learn-more");if(learnMoreEl&&learnMoreEl.getBoundingClientRect().height>0)return"preorder";if(this.els.currentVariant.element.dataset.currentVariantAvailable==="false")return this.els.currentVariant.element.dataset.currentVariantRestock==="true"?"restock":"unavailable";if(this.els.currentVariant.element.dataset.currentVariantAvailable==="true")return"instock"}}customElements.get("shipping-notice")||customElements.define("shipping-notice",ShippingNotice);
2//# sourceMappingURL=/cdn/shop/t/1735/assets/shipping-notice.js.map?v=164867526771269116661789654329

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.