PageSourceSearch

https://www.bogliolimilano.com/cdn/shop/t/2/assets/bog-minicart.js?v=130565953737094737631772718645

js bogliolimilano.com collected 2026-09-25 06:06:42 UTC 4,662 bytes, 1 lines download raw bytes

1if(!customElements.get("bog-minicart")){let s=()=>{if(window.Shopify?.designMode)return!0;try{return"1"===window.localStorage.getItem("debug-cart")}catch(t){return!1}},t=280,e=300;class d extends HTMLElement{constructor(){super(),this.removeAnimationDuration=t,this.panelAnimationDuration=e}getCssDurationMs(e,i){e=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(!e)return i;if(e.endsWith("ms")){let t=Number.parseFloat(e);return Number.isFinite(t)?t:i}if(e.endsWith("s")){let t=Number.parseFloat(e);return Number.isFinite(t)?1e3*t:i}let t=Number.parseFloat(e);return Number.isFinite(t)?t:i}connectedCallback(){this.removeAnimationDuration=this.getCssDurationMs("--bog-minicart-remove-animation-duration",this.removeAnimationDuration),this.panelAnimationDuration=this.getCssDurationMs("--bog-minicart-panel-animation-duration",this.panelAnimationDuration),this.cartIcon=document.getElementById("bog-cart-icon-bubble"),this.minicartContainer=this.querySelector("#BogMinicart"),this.minicartContent=this.querySelector(".bog-minicart-content"),this.addEventListener("click",t=>{var e=t.target.closest('[data-action="close"]'),i=t.target.closest("[data-cart-remove]");e?(t.preventDefault(),this.closeMinicart()):i&&(t.preventDefault(),this.handleRemoveItem(i))}),this.cartIcon&&this.cartIcon.addEventListener("click",t=>{t.preventDefault(),this.openMinicart()})}openMinicart(){this.minicartContainer.classList.remove("tw-hidden"),this.minicartContainer.classList.add("tw-flex"),this.minicartContainer.setAttribute("aria-hidden","false"),setTimeout(()=>{this.minicartContent.classList.remove("tw-translate-x-full"),this.minicartContent.classList.add("tw-translate-x-0")},10)}closeMinicart(){this.minicartContent.classList.remove("tw-translate-x-0"),this.minicartContent.classList.add("tw-translate-x-full"),setTimeout(()=>{this.minicartContainer.classList.remove("tw-flex"),this.minicartContainer.classList.add("tw-hidden"),this.minicartContainer.setAttribute("aria-hidden","true")},this.panelAnimationDuration)}getSectionsToRender(){return[{id:"bog-minicart",section:"bog-minicart",selector:".bog-minicart-content"},{id:"bog-cart-icon-bubble",section:"bog-cart-icon-bubble",selector:".shopify-section"}]}async handleRemoveItem(e){if(e instanceof HTMLElement){var t=e.dataset.cartItemKey;if(t){var i=e.closest("[data-minicart-line-item]"),n="true"===i?.dataset.isRemoving;if(!n){this.setRemovingState(e,i,!0);try{var a=await fetch(window.routes?.cart_change_url||"/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({id:t,quantity:0,sections:this.getSectionsToRender().map(t=>t.section),sections_url:window.location.pathname})});if(!a.ok)throw new Error("Failed to remove minicart item");var r=await a.json();await this.animateLineItemRemoval(i),this.renderContents(r),publish(PUB_SUB_EVENTS.cartUpdate,{source:"bog-minicart",cartData:r})}catch(t){s()&&console.error(t),this.setRemovingState(e,i,!1)}}}}}setRemovingState(t,e,i){t instanceof HTMLElement&&(i?(t.setAttribute("aria-disabled","true"),t.style.pointerEvents="none",t.style.opacity="0.5",t.style.cursor="wait"):(t.removeAttribute("aria-disabled"),t.style.pointerEvents="",t.style.opacity="",t.style.cursor="")),e instanceof HTMLElement&&(i?(e.dataset.isRemoving="true",e.style.transition="opacity 150ms ease",e.style.opacity="0.6"):(delete e.dataset.isRemoving,e.style.transition="",e.style.opacity=""))}animateLineItemRemoval(a){var t,e;return!(a instanceof HTMLElement)||window.matchMedia("(prefers-reduced-motion: reduce)").matches?Promise.resolve():(t=a.offsetHeight,e=this.removeAnimationDuration+"ms",a.style.maxHeight=t+"px",a.style.overflow="hidden",a.style.transition=`opacity ${e} ease, transform ${e} ease, max-height ${e} ease, margin ${e} ease`,new Promise(t=>{let e=!1,i=()=>{e||(e=!0,t())},n=window.setTimeout(i,this.removeAnimationDuration+80);a.addEventListener("transitionend",()=>{window.clearTimeout(n),i()},{once:!0}),requestAnimationFrame(()=>{a.style.opacity="0",a.style.transform="translateX(12px)",a.style.maxHeight="0px",a.style.marginTop="0px",a.style.marginBottom="0px"})}))}
1renderContents(n){this.getSectionsToRender().forEach(t=>{var e,i=document.getElementById(t.id);i?(i=i.querySelector(t.selector)||i,n.sections&&n.sections[t.section]&&(e=this.getSectionInnerHTML(n.sections[t.section],t.selector))&&(i.innerHTML=e)):s()&&console.warn("Element not found: "+t.id)}),this.openMinicart()}getSectionInnerHTML(t,e){return(new DOMParser).parseFromString(t,"text/html").querySelector(e).innerHTML}setActiveElement(t){this.activeElement=t}}customElements.define("bog-minicart",d)}

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.