1import inView from"@archetype-themes/scripts/vendors/in-view";export default class extends HTMLElement{connectedCallback(){const handler={get:(target,prop)=>async()=>{target=await target,this.playerHandler(target,prop)}};this.player=new Proxy(this.getPlayerTarget(),handler),this.pausedByUser=!1,this.playingWhenLastViewed=!1,inView(this,()=>((this.autoplay&&!this.pausedByUser||this.playingWhenLastViewed)&&this.play(),()=>{this.playingWhenLastViewed=this.playing,this.pause()}))}static get observedAttributes(){return["playing"]}attributeChangedCallback(name,oldValue,newValue){name==="playing"&&(oldValue===null&&newValue===""?this.dispatchEvent(new CustomEvent("media:play",{bubbles:!0})):newValue===null&&this.dispatchEvent(new CustomEvent("media:pause",{bubbles:!0})))}play(){this.pausedByUser=!1,!this.playing&&(this.player.play(),this.playingWhenLastViewed=!0)}pause(){this.pausedByUser=!0,this.playing&&this.player.pause()}getPlayerTarget(){throw new Error("getPlayerTarget must be implemented in a subclass")}playerHandler(target,prop){throw new Error("playerHandler must be implemented in a subclass")}get playing(){return this.hasAttribute("playing")}get autoplay(){return this.hasAttribute("autoplay")}} 2//# sourceMappingURL=/cdn/shop/t/185/assets/base-media.js.map?v=158686823065200144011728421714
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.