1import{c as C,A as E}from"./chunk-aria-live-region-context-DAmBJh4s.js";import{c as L,a as _}from"./chunk-cart-sections-DQ33OuN-.js";import{c as w}from"./chunk-deferred-media-Clw3gdQB.js";import{m as A}from"./chunk-modal-context-CA9qKp2P.js";import{T as P,a as R,b as k,h as T,c as x,d as M}from"./chunk-tracking-B0r3HcYL.js";import{s as y}from"./chunk-utils-Cu9pvtuE.js";import{s as H}from"./chunk-context-request-event-GdmzvDV-.js";import{a as O}from"./chunk-lit-element-CMQwxE0N.js";import{t as I}from"./chunk-custom-element-BhZVzxrc.js";import{r as p}from"./chunk-state-CumkKq1M.js";import"./chunk-create-context-89xeped_.js";import"./chunk-property-BRfFPm5t.js";/** 2 * @license 3 * Copyright 2021 Google LLC 4 * SPDX-License-Identifier: BSD-3-Clause 5 */class U{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,s=!1){const i=s||!Object.is(e,this.o);this.o=e,i&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:i}]of this.subscriptions)s(this.o,i)},e!==void 0&&(this.value=e)}addCallback(e,s,i){if(!i)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:s});const{disposer:a}=this.subscriptions.get(e);e(this.value,a)}clearCallbacks(){this.subscriptions.clear()}}/** 6 * @license 7 * Copyright 2021 Google LLC 8 * SPDX-License-Identifier: BSD-3-Clause 9 */let V=class extends Event{constructor(e,s){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=s}};class D extends U{constructor(e,s,i){var a,r;super(s.context!==void 0?s.initialValue:i),this.onContextRequest=o=>{if(o.context!==this.context)return;const n=o.contextTarget??o.composedPath()[0];n!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,n,o.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;const n=new Set;for(const[d,{consumerHost:S}]of this.subscriptions)n.has(d)||(n.add(d),S.dispatchEvent(new H(this.context,S,d,!0)));o.stopPropagation()},this.host=e,s.context!==void 0?this.context=s.context:this.context=s,this.attachListeners(),(r=(a=this.host).addController)==null||r.call(a,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new V(this.context,this.host))}}/** 10 * @license 11 * Copyright 2017 Google LLC 12 * SPDX-License-Identifier: BSD-3-Clause 13 */function m({context:t}){return(e,s)=>{const i=new WeakMap;if(typeof s=="object")return s.addInitializer(function(){i.set(this,new D(this,{context:t}))}),{get(){return e.get.call(this)},set(a){var r;return(r=i.get(this))==null||r.setValue(a),e.set.call(this,a)},init(a){var r;return(r=i.get(this))==null||r.setValue(a),a}};{e.constructor.addInitializer(o=>{i.set(o,new D(o,{context:t}))});const a=Object.getOwnPropertyDescriptor(e,s);let r;if(a===void 0){const o=new WeakMap;r={get(){return o.get(this)},set(n){i.get(this).setValue(n),o.set(this,n)},configurable:!0,enumerable:!0}}else{const o=a.set;r={...a,set(n){i.get(this).setValue(n),o==null||o.call(this,n)}}}return void Object.defineProperty(e,s,r)}}}const l=class l{static observe(e,s,i=.5,a={}){if(!e){console.warn("InView: No element provided for observation.");return}const r=new IntersectionObserver((o,n)=>{o.forEach(d=>{d.isIntersecting&&(s(),n.unobserve(d.target),l.observers.delete(d.target))})},{threshold:i,...a});r.observe(e),l.observers.set(e,r)}static unobserve(e){const s=l.observers.get(e);s&&(s.unobserve(e),l.observers.delete(e))}};l.observers=new WeakMap;let f=l;var N=Object.defineProperty,W=Object.getOwnPropertyDescriptor,u=(t,e,s,i)=>{for(var a=i>1?void 0:i?W(e,s):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(a=(i?o(e,s,a):o(a))||a);return i&&a&&N(e,s,a),a};const h={OPEN:"modal-dialog::open",CLOSE:"modal-dialog::close",CLOSE_ALL:"modal-dialog::close-all"},v={UPDATED:"cart:updated",UPDATED_SECTIONS:"cart:updated-sections"},b={PAUSE:"deferred-media::pause",PLAY:"deferred-media::play"},g="modals";let c=class extends O{constructor(){super(),this.boundTrackClickHandlers=new Map,this.cart=window.__CART__,this.cartSections={},this.modals=[],this.activeDeferredMedia=null,this.trackClickElements=[],this.trackScrolledIntoViewElements=[],this.trackScrollDepthElement=null,this._updateFirstTimeVisit(),this.trackClickElements=this.querySelectorAll(`[${P}]`),this.trackScrolledIntoViewElements=this.querySelectorAll(`[${R}]`),this.trackScrollDepthElement=this.querySelector(`[${k}]`),this.boundHandleCartUpdate=this._handleCartUpdate.bind(this),this.boundHandleCartSectionsUpdate=this._handleCartSectionsUpdate.bind(this),this.boundHandleAriaLiveRegionSet=this._handleAriaLiveRegionSet.bind(this),this.boundHandleAriaLiveRegionClear=this._handleAriaLiveRegionClear.bind(this),this.boundHandleDeferredMediaPause=this._handleDeferredMediaPause.bind(this),this.boundHandleDeferredMediaPlay=this._handleDeferredMediaPlay.bind(this),this.boundHandleDialogSchemaClick=this._handleDialogSchemaClick.bind(this),this.boundHandleDialogEvent=this._handleDialogEvent.bind(this),this.boundWindowScroll=this._handleWindowScroll.bind(this)}createRenderRoot(){return this}connectedCallback(){this.addEventListener(v.UPDATED,this.boundHandleCartUpdate),this.addEventListener(v.UPDATED_SECTIONS,this.boundHandleCartSectionsUpdate),this.addEventListener(E.SET,this.boundHandleAriaLiveRegionSet),this.addEventListener(E.CLEAR,this.boundHandleAriaLiveRegionClear),this.addEventListener(b.PAUSE,this.boundHandleDeferredMediaPause),this.addEventListener(b.PLAY,this.boundHandleDeferredMediaPlay),this.addEventListener("click",this.boundHandleDialogSchemaClick),Object.values(h).forEac
13h(t=>{this.addEventListener(t,this.boundHandleDialogEvent)}),this._handleRestoreModals(),this.trackClickElements.forEach(t=>{const e=()=>T(t);t.addEventListener("click",e),this.boundTrackClickHandlers.set(t,e)}),this.trackScrolledIntoViewElements.forEach(t=>f.observe(t,()=>x(t))),window.addEventListener("scroll",this.boundWindowScroll)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(v.UPDATED,this.boundHandleCartUpdate),this.removeEventListener(v.UPDATED_SECTIONS,this.boundHandleCartSectionsUpdate),this.removeEventListener(E.SET,this.boundHandleAriaLiveRegionSet),this.removeEventListener(E.CLEAR,this.boundHandleAriaLiveRegionClear),this.removeEventListener(b.PAUSE,this.boundHandleDeferredMediaPause),this.removeEventListener(b.PLAY,this.boundHandleDeferredMediaPlay),this.removeEventListener("click",this.boundHandleDialogSchemaClick),Object.values(h).forEach(t=>{this.removeEventListener(t,this.boundHandleDialogEvent)}),this.trackClickElements.forEach(t=>{const e=this.boundTrackClickHandlers.get(t);e&&t.removeEventListener("click",e)}),this.boundTrackClickHandlers.clear(),this.trackScrolledIntoViewElements.forEach(t=>f.unobserve(t)),window.removeEventListener("scroll",this.boundWindowScroll)}_handleDeferredMediaPlay(t){const e=t.composedPath(),s=e.length>0?e[0]:t.target;s===this.activeDeferredMedia||s.tagName!=="DEFERRED-MEDIA"||(this.activeDeferredMedia=s)}_handleDeferredMediaPause(){this._pauseAllDeferredMedia()}_handleCartUpdate(t){t.detail&&(this.cart=t.detail)}_handleCartSectionsUpdate(t){t.detail&&(this.cartSections=t.detail||{})}_handleDialogSchemaClick(t){const e=t.composedPath(),s=e.length>0?e[0]:t.target;if(s.tagName==="A"){const i=s.getAttribute("href");if(i&&(i.startsWith("modal-dialog://")||i.startsWith("#modal-dialog://"))){t.preventDefault();const a=i.replace("modal-dialog://","").replace("#","");a&&this._handleDialogEvent(new CustomEvent(h.OPEN,{detail:a}))}}}_handleDialogEvent(t){let e=[...this.modals];switch(t.type){case h.OPEN:t.detail&&(e=[...e,t.detail]);break;case h.CLOSE:t.detail&&(e=e.filter(s=>s!==t.detail));break;case h.CLOSE_ALL:e=[];break}e=[...new Set(e)],this.modals=e,this._applyModalsState(),this._pauseAllDeferredMedia(),this._updateQueryParams()}async _pauseAllDeferredMedia(){const t=this.activeDeferredMedia!==null;this.activeDeferredMedia=null,!t&&(customElements.get("deferred-media")||await customElements.whenDefined("deferred-media"),this.querySelectorAll("deferred-media").forEach(e=>e.pause(!0)))}async _applyModalsState(){await customElements.whenDefined("modal-dialog");const t=this.modals,e=Array.from(this.querySelectorAll("modal-dialog")),s=window.innerWidth-document.body.getBoundingClientRect().width;document.documentElement.style.setProperty("--scrollbar-width",`${s}px`);for(const i of e)t.includes(i.id)?i.show():i.hide()}_handleRestoreModals(){const e=new URLSearchParams(window.location.search).get(g);if(e){if(e==="cart-drawer-dialog")return;this.modals=e.split(",").map(s=>s.trim()).filter(Boolean),this._applyModalsState()}}_handleWindowScroll(){this.trackScrollDepthElement&&M(this.trackScrollDepthElement)}_updateFirstTimeVisit(){var t;y((t=window._template)==null?void 0:t.name)}_updateQueryParams(){const t=new URLSearchParams(window.location.search),e=this.modals,s=this.modals.join(",");e.length>0?t.set(g,s):t.delete(g);const i=`${window.location.pathname}?${t.toString()}`;window.history.replaceState({},"",i)}_handleAriaLiveRegionSet(t){t.detail&&(this.ariaLiveRegion=t.detail)}_handleAriaLiveRegionClear(){this.ariaLiveRegion={message:""}}};u([m({context:L}),p()],c.prototype,"cart",2);u([m({context:_}),p()],c.prototype,"cartSections",2);u([m({context:A}),p()],c.prototype,"modals",2);u([m({context:C}),p()],c.prototype,"ariaLiveRegion",2);u([m({context:w}),p()],c.prototype,"activeDeferredMedia",2);c=u([I("app-provider")],c);
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.