1import BaseMedia from"element.base-media";import{loadProduct}from"util.product-loader";export class ModelMedia extends BaseMedia{getPlayerTarget(){return new Promise(resolve=>{this.setAttribute("loaded","");const initWhenReady=()=>{window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.setupShopifyXr.bind(this)},{name:"model-viewer-ui",version:"1.0",onLoad:()=>{const modelViewerUi=this.setupModelViewerUi();resolve(modelViewerUi)}}])};typeof customElements<"u"&&customElements.whenDefined?customElements.whenDefined("model-viewer").then(initWhenReady):initWhenReady()})}playerHandler(target,prop){target[prop]()}async setupShopifyXr(){if(!window.ShopifyXR)document.addEventListener("shopify_xr_initialized",this.setupShopifyXr.bind(this));else{const productModels=(await loadProduct(this.getAttribute("handle"))).media.filter(media=>media.media_type==="model");window.ShopifyXR.addModels(productModels),window.ShopifyXR.setupXRElements()}}setupModelViewerUi(){const modelViewer=this.querySelector("model-viewer");return modelViewer?(modelViewer.addEventListener("shopify_model_viewer_ui_toggle_play",()=>{this.setAttribute("playing","")}),modelViewer.addEventListener("shopify_model_viewer_ui_toggle_pause",()=>{this.removeAttribute("playing")}),new window.Shopify.ModelViewerUI(modelViewer,{focusOnPlay:!1})):null}}customElements.define("model-media",ModelMedia); 2//# sourceMappingURL=/cdn/shop/t/153/assets/element.model.js.map?v=94284935004375649201775616195
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.