@epigraph/solutions 1.6.0-alpha → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17479,7 +17479,7 @@ void main() {
|
|
|
17479
17479
|
.model-viewer.hide {
|
|
17480
17480
|
visibility: hidden;
|
|
17481
17481
|
}
|
|
17482
|
-
`]}firstUpdated(e){super.firstUpdated(e),this.__createAndPortalArModal(),this.appWcRef.addEventListener(this.appWcRef.eventsManager.productSettingUpdatedEvent.name,()
|
|
17482
|
+
`]}firstUpdated(e){super.firstUpdated(e),this.__createAndPortalArModal(),this.appWcRef.addEventListener(this.appWcRef.eventsManager.experienceUpdatedEvent.name,this.__syncArPlacement.bind(this)),this.appWcRef.addEventListener(this.appWcRef.eventsManager.productSettingUpdatedEvent.name,this.__syncArPlacement.bind(this))}__syncArPlacement(){this.arPlacement=this.appWcRef.productSettings.ar.placement}__createAndPortalArModal(){this.arModalElem=document.createElement("epg-modal-ar"),this.arModalElem.id="arModal",this.arModalElem.setAttribute("powered-by-epigraph",""),this.arModalElem.setAttribute("powered-by-epigraph-href",this.appWcRef.epigraphWebsiteRedirectUrls.modal),this.arModalElem.style.zIndex="1001",this.arModalElem.isLoading=!0,this.arModalElem.addEventListener("epgOnLaunchArClicked",()=>void this.presentAr()),this.arModalElem.addEventListener("epgOnModalHidden",()=>this.onArModalClose()),document.body.appendChild(this.arModalElem)}disconnectedCallback(){super.disconnectedCallback(),this.appWcRef.removeEventListener(this.appWcRef.eventsManager.experienceUpdatedEvent.name,this.__syncArPlacement.bind(this)),this.appWcRef.removeEventListener(this.appWcRef.eventsManager.productSettingUpdatedEvent.name,this.__syncArPlacement.bind(this)),this.arModalElem?.remove()}__registerModelViewerWebComponent(){window.customElements.get("model-viewer")||window.customElements.define("model-viewer",LJ)}static setupWebComponent(){window.customElements.get(og.webComponentName)||window.customElements.define(og.webComponentName,og)}get arLink(){return this.__arLink}showArModal(){this.arModalElem.showModal();const e=new oa(!0,oa.PANEL_TYPE.AR,oa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}showQr(){this.qrModalElem.showModal();const e=new oa(!0,oa.PANEL_TYPE.QR,oa.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}async resolveSrcUrl(){if(this.glbSrc="",this.usdzSrc="",this.arModalElem.isLoading=!0,sx){const e=await this.appWcRef.getGlbUrlForAr();if(e===null){window.epigraph.logger.error({title:"Error getting the GLB for AR session",contextOverride:this._loggerContext});return}this.glbSrc=e}else bv&&(this.usdzSrc=await this.appWcRef.getUsdzUrlForAr(),this.glbSrc="https://asset.myepigraph.com/solutions-assets/__PIPELINE__/assets/3d-assets/proxyGeo/null-proxy.glb");this.arModalElem.isLoading=!1}getViewInYourSpaceUrl(){return cn.generateShareableUrl({baseUrl:this.appWcRef.baseUrlOverride,identifier:this.appWcRef.identifier,identifierType:this.appWcRef.identifierType,arCompatible:!0})}async getViewInYourSpaceQR(){const e=this.getViewInYourSpaceUrl();return this.appWcRef.qrCodeGenerator.generateQrCode({text:e.href})}async launchAR(){if(this.canLaunchAr()){const e=new uL([]);this.appWcRef.epigraphAnalytics.sendEvent(e),this.showArModal(),setTimeout(()=>{this.resolveSrcUrl()},1e3)}else{const e=await this.getViewInYourSpaceQR();this.qrModalElem.qrCodeImage=e,this.showQr()}return Promise.resolve(!0)}canLaunchAr(){return this.modelViewerElem.canActivateAR}async presentAr(){return this.modelViewerElem.activateAR()}isARSessionActive(){return this.modelViewerElem.getAttribute("ar-status")==="presenting"}getMinimumRequirementsString(){let e="";return WW&&(VD?e="iOS 16 and above":$D&&(e="Android 12 and above")),e}onArModalClose(){const e=new la(!0,la.PANEL_TYPE.AR,la.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}onQrModalClose(){const e=new la(!0,la.PANEL_TYPE.QR,la.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(e)}__renderQrModal(){return re`<epg-modal-qr
|
|
17483
17483
|
id="qrModal"
|
|
17484
17484
|
powered-by-epigraph
|
|
17485
17485
|
powered-by-epigraph-href=${this.appWcRef.epigraphWebsiteRedirectUrls.modal}
|