PageSourceSearch

https://ritual.com/cdn/shop/t/577/assets/core-app-provider.iu6JAv6x.min.js

js ritual.com collected 2026-09-24 08:29:52 UTC 5,147 bytes, 1 lines download raw bytes

1import{c as e,A as t}from"./aria-live-region-context.BL8qyJKc.min.js";import{c as i}from"./cart-context.QcHz7LM1.min.js";import{c as a}from"./cart-sections.irqgSI0g.min.js";import{c as s}from"./deferred-media.DiwlLEmi.min.js";import{m as n}from"./modal-context.Cz6CkDXz.min.js";import{c as d}from"./quickshop.hLMAjQnS.min.js";import{k as r,r as o,t as l,a as h}from"./vendor-lit.Cg17OMaX.min.js";var c=Object.defineProperty,m=Object.getOwnPropertyDescriptor,p=(e,t,i,a)=>{for(var s,n=a>1?void 0:a?m(t,i):t,d=e.length-1;d>=0;d--)(s=e[d])&&(n=(a?s(t,i,n):s(n))||n);return a&&n&&c(t,i,n),n};const v={OPEN:"modal-dialog::open",CLOSE:"modal-dialog::close",CLOSE_ALL:"modal-dialog::close-all"},u="cart:updated",E="cart:updated-sections",f="deferred-media::pause",_="deferred-media::play",g={OPEN:"quickshop::open",CLOSE:"quickshop::close"},L="modals";let S=class extends h{constructor(){super(...arguments),this.cart=window.__CART__,this.cartSections={},this.modals=[],this.activeDeferredMedia=null,this.quickShop=null}createRenderRoot(){return this}connectedCallback(){this.addEventListener(u,this._handleCartUpdate.bind(this)),this.addEventListener(E,this._handleCartSectionsUpdate.bind(this)),this.addEventListener(t.SET,this._handleAriaLiveRegionSet.bind(this)),this.addEventListener(t.CLEAR,this._handleAriaLiveRegionClear.bind(this)),this.addEventListener(f,this._handleDeferredMediaPause.bind(this)),this.addEventListener(_,this._handleDeferredMediaPlay.bind(this)),this.addEventListener("click",this._handleDialogSchemaClick.bind(this)),Object.values(v).forEach(e=>{this.addEventListener(e,this._handleDialogEvent.bind(this))}),Object.values(g).forEach(e=>{this.addEventListener(e,this._handleQuickShopEvent.bind(this))}),this._handleRestoreModals()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(u,this._handleCartUpdate.bind(this)),this.removeEventListener(E,this._handleCartSectionsUpdate.bind(this)),this.removeEventListener(t.SET,this._handleAriaLiveRegionSet.bind(this)),this.removeEventListener(t.CLEAR,this._handleAriaLiveRegionClear.bind(this)),this.removeEventListener(f,this._handleDeferredMediaPause.bind(this)),this.removeEventListener(_,this._handleDeferredMediaPlay.bind(this)),this.removeEventListener("click",this._handleDialogSchemaClick.bind(this)),Object.values(v).forEach(e=>{this.removeEventListener(e,this._handleDialogEvent.bind(this))}),Object.values(g).forEach(e=>{this.removeEventListener(e,this._handleQuickShopEvent.bind(this))})}_handleDeferredMediaPlay(e){const t=e.composedPath(),i=t.length>0?t[0]:e.target;i!==this.activeDeferredMedia&&"DEFERRED-MEDIA"===i.tagName&&(this.activeDeferredMedia=i)}_handleDeferredMediaPause(){this._pauseAllDeferredMedia()}_handleCartUpdate(e){e.detail&&(this.cart=e.detail)}_handleCartSectionsUpdate(e){e.detail&&(this.cartSections=e.detail||{})}_handleDialogSchemaClick(e){const t=e.composedPath(),i=t.length>0?t[0]:e.target;if("A"===i.tagName){const t=i.getAttribute("href");if(t&&(t.startsWith("modal-dialog://")||t.startsWith("#modal-dialog://"))){e.preventDefault();const i=t.replace("modal-dialog://","").replace("#","");i&&this._handleDialogEvent(new CustomEvent(v.OPEN,{detail:i}))}}}_handleDialogEvent(e){let t=[...this.modals];switch(e.type){case v.OPEN:e.detail&&(t=[...t,e.detail]);break;case v.CLOSE:e.detail&&(t=t.filter(t=>t!==e.detail)),this.quickShop=null;break;case v.CLOSE_ALL:t=[],this.quickShop=null}t=[...new Set(t)],this.modals=t,this._applyModalsState(),this._pauseAllDeferredMedia(),this._updateQueryParams()}_pauseAllDeferredMedia(){try{if(null===this.activeDeferredMedia)return void Array.from(this.querySelectorAll("deferred-media")).forEach(e=>e.pause(!0));this.activeDeferredMedia=null}catch(e){console.error(e)}}async _applyModalsState(){await customElements.whenDefined("modal-dialog");const e=this.modals,t=Array.from(this.querySelectorAll("modal-dialog"));if(e.length>0){const e=window.innerWidth-document.body.getBoundingClientRect().width;document.documentElement.style.setProperty("--scrollbar-width",`${e}px`)}else document.documentElement.style.setProperty("--scrollbar-width","0px");for(const i of t)e.includes(i.id)?i.show():i.hide()}_handleRestoreModals(){const e=new URLSearchParams(window.location.search).get(L);e&&(this.modals=e.split(",").map(e=>
1e.trim()).filter(Boolean),this._applyModalsState())}_updateQueryParams(){const e=new URLSearchParams(window.location.search),t=this.modals,i=this.modals.join(",");t.length>0?e.set(L,i):e.delete(L);const a=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",a)}_handleAriaLiveRegionSet(e){e.detail&&(this.ariaLiveRegion=e.detail)}_handleAriaLiveRegionClear(){this.ariaLiveRegion={message:""}}_handleQuickShopEvent(e){const t=e.type,i=e.detail;this.quickShop=t===g.OPEN?i:null}};p([r({context:i}),o()],S.prototype,"cart",2),p([r({context:a}),o()],S.prototype,"cartSections",2),p([r({context:n}),o()],S.prototype,"modals",2),p([r({context:e}),o()],S.prototype,"ariaLiveRegion",2),p([r({context:s}),o()],S.prototype,"activeDeferredMedia",2),p([r({context:d}),o()],S.prototype,"quickShop",2),S=p([l("app-provider")],S);export{S as A};

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.