PageSourceSearch

https://www.lacoquetakids.com/cdn/shop/t/291/assets/collection-switch.js?v=136121380723836023021761906979

js lacoquetakids.com collected 2026-10-03 21:24:23 UTC 2,129 bytes, 2 lines download raw bytes

1const{Cycler}=window.BAO;export class CollectionSwitch extends window.BAO.CustomElement(){CURRENT_STYLE_ATTRIBUTE="current-style";ALLOWED_STYLES=["default","model"];CLASSES={default:"clc-ProductGrid-default",model:"clc-ProductGrid-model"};connectedCallback(){if(!this.triggerElement)throw new Error(`<${this.localName}> needs an element with data-collection-switch-el=trigger to work"`);this.handleTriggerClick=this.handleTriggerClick.bind(this),this.cycler=new Cycler(this.ALLOWED_STYLES),this.cycler.set(this.cycler.items.findIndex(i=>i===this.currentStyle)),this.triggerElement.addEventListener("click",this.handleTriggerClick,{passive:!0})}disconnectedCallback(){this.triggerElement.removeEventListener("click",this.handleTriggerClick)}async handleTriggerClick(){const currentStyle=this.cycler.next();this.setCartAttribute(currentStyle),this.currentStyle=currentStyle,this.syncThemeSwitchers(currentStyle),window.BAO.eventBus.dispatchEvent(window.BAO.EVENTS.THEME_SWITCH,{currentStyle})}syncThemeSwitchers(currentStyle){this.allOtherThemeSwitches.forEach(el=>{el.currentStyle=currentStyle,el.cycler.next()})}setCartAttribute(style){return fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({attributes:{current_style:style}})})}get triggerElement(){return this.querySelector('[data-collection-switch-el="trigger"]')}get bodyElement(){return document.querySelector('[data-collection-switch-external-el="body"]')}get currentStyle(){return this.getAttribute(this.CURRENT_STYLE_ATTRIBUTE)||this.ALLOWED_STYLES[0]}set currentStyle(value){this.setAttribute(this.CURRENT_STYLE_ATTRIBUTE,value),this.bodyElement.classList.toggle(this.CLASSES.default,value==="default"),this.bodyElement.classList.toggle(this.CLASSES.model,value==="model")}get allOtherThemeSwitches(){return Array.from(document.querySelectorAll(this.localName)).filter(el=>el!==this)}}customElements.get("collection-switch")||customElements.define("collection-switch",CollectionSwitch);
2//# sourceMappingURL=/cdn/shop/t/291/assets/collection-switch.js.map?v=136121380723836023021761906979

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.