@epigraph/solutions 0.18.2 → 0.18.3

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.
@@ -8381,6 +8381,10 @@ void main() {
8381
8381
  opacity: 0;
8382
8382
  transition: opacity 0.5s ease-in-out;
8383
8383
  pointer-events: none;
8384
+
8385
+ &.show {
8386
+ opacity: 1;
8387
+ }
8384
8388
  }
8385
8389
 
8386
8390
  .camera-interaction-prompt-indicator.play-wiggle-animation {
@@ -8598,7 +8602,7 @@ void main() {
8598
8602
  class="splash-screen"
8599
8603
  current-progress=${this._loadingProgress}
8600
8604
  ></epg-loader-scene>
8601
- `}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.pickerState===!1&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.appEvents.hotspotOpenEvent.name,(e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotClosedEvent.name,(e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l);let d;u?d=this.playAnimationByName({animationName:u}):d=this.playAnimationByName({animationName:a.entry,reverse:!0}),setTimeout(()=>{d?.targetAnimationAction.reset(),this._activeAnimations.delete(d?.animationName??"")},this._animationFadeDurationInMiliseconds)}})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Wn,t=new Pi({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}setShadowIntensity(e){this.renderEngine.contactShadows?.updateShadowIntensity(e)}setShadowSoftness(e){this.renderEngine.contactShadows?.updateShadowSoftness(e)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ux(this),this._assetManager=new pU(this),this._cameraManager=new _U({appWcRef:this}),this._sceneManager=new nz(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners(),this.setShadowIntensity(this.shadowIntensity),this.setShadowSoftness(this.shadowSoftness)}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ge;return this.featuresToEnable.dimensions&&(IU.setupWebComponent(),e=Ee`
8605
+ `}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.pickerState===!1&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.appEvents.hotspotOpenEvent.name,(e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotClosedEvent.name,(e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l);let d;u?d=this.playAnimationByName({animationName:u}):d=this.playAnimationByName({animationName:a.entry,reverse:!0}),setTimeout(()=>{d?.targetAnimationAction.reset(),this._activeAnimations.delete(d?.animationName??"")},this._animationFadeDurationInMiliseconds)}})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Wn,t=new Pi({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}setShadowIntensity(e){this.renderEngine?.contactShadows?.updateShadowIntensity(e)}setShadowSoftness(e){this.renderEngine?.contactShadows?.updateShadowSoftness(e)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ux(this),this._assetManager=new pU(this),this._cameraManager=new _U({appWcRef:this}),this._sceneManager=new nz(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners(),this.setShadowIntensity(this.shadowIntensity),this.setShadowSoftness(this.shadowSoftness)}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ge;return this.featuresToEnable.dimensions&&(IU.setupWebComponent(),e=Ee`
8602
8606
  <dimensions-manager
8603
8607
  id="dimensionsManager"
8604
8608
  .appWcRef=${this}
@@ -8623,7 +8627,7 @@ void main() {
8623
8627
  <div class="view-in-your-space-button ${this._isActiveHotspot?"hide":""}">
8624
8628
  <slot name=${KA.slotCustomViewInYourSpaceButton.name} @click=${this.launchAR}></slot>
8625
8629
  </div>
8626
- `}_repopulateDimensions(){this.dimensionsManager.recalculateBoundsAndDimensions(),this.dimensionsManager.repopulateDimensionIndicators()}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"})}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.isPortraitOrientation=this.getBoundingClientRect().width<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),u=a*.5,d=l*.5;if(u>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem.getBoundingClientRect(),m=p.width>u,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}firstUpdated(){this._setup(),this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}async _onIdentifierOrTypeChange(){window.epigraph.logger.info({title:`IDENTIFIER CHANGED TO: "${this._identifierType}" -- "${this._identifier}"`})}_onDebugChange(){this.dimensionsManager&&(this.dimensionsManager.visualizeBounds=this.debug),this.featuresToEnable.viewer&&(this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers())}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="1"}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="0"}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id"))&&this._onIdentifierOrTypeChange(),e.has("debug")&&this._onDebugChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._isActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton()),e.has("shadowIntensity")&&this.setShadowIntensity(this.shadowIntensity),e.has("shadowSoftness")&&this.setShadowSoftness(this.shadowSoftness)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}getWebComponentName(){return eu.webComponentName}_setupAnalytics(){this._nexusAnalyticsPlugin=new bI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new yI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this._setupAnalytics(),this.parsedUrlParams=Ft.parseUrlForEpigraphParams(this.baseUrlOverride)}disconnectedCallback(){super.disconnectedCallback()}render(){return Ee`
8630
+ `}_repopulateDimensions(){this.dimensionsManager.recalculateBoundsAndDimensions(),this.dimensionsManager.repopulateDimensionIndicators()}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"})}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.isPortraitOrientation=this.getBoundingClientRect().width<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),u=a*.5,d=l*.5;if(u>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem.getBoundingClientRect(),m=p.width>u,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}firstUpdated(){this._setup(),this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}async _onIdentifierOrTypeChange(){window.epigraph.logger.info({title:`IDENTIFIER CHANGED TO: "${this._identifierType}" -- "${this._identifier}"`})}_onDebugChange(){this.dimensionsManager&&(this.dimensionsManager.visualizeBounds=this.debug),this.featuresToEnable.viewer&&(this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers())}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.add("show")}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.remove("show")}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id"))&&this._onIdentifierOrTypeChange(),e.has("debug")&&this._onDebugChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._isActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton()),e.has("shadowIntensity")&&this.setShadowIntensity(this.shadowIntensity),e.has("shadowSoftness")&&this.setShadowSoftness(this.shadowSoftness)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}getWebComponentName(){return eu.webComponentName}_setupAnalytics(){this._nexusAnalyticsPlugin=new bI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new yI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this._setupAnalytics(),this.parsedUrlParams=Ft.parseUrlForEpigraphParams(this.baseUrlOverride)}disconnectedCallback(){super.disconnectedCallback()}render(){return Ee`
8627
8631
  ${Ft.getCustomStylesTemplate()}
8628
8632
  ${this._renderAppCanvasContainer()}
8629
8633
  ${this._renderAppManagers()}
@@ -8657,6 +8661,9 @@ void main() {
8657
8661
  ?is-loading=${this.isLoading}
8658
8662
  ></epg-button-view-in-your-space>
8659
8663
  </slot>`}_renderAppUiElemChildren(){return Ee`
8664
+ <!-- This is here and not within appManagersContainer because of the z-index ordering -->
8665
+ ${this._renderViewInYourSpaceManager()}
8666
+
8660
8667
  ${this._renderCustomViewInYourSpaceButtonSlot()}
8661
8668
  `}async _setup(){window.epigraph.logger.table({title:"Setting up...",contextOverride:this._loggerContext}),this._appEvents=new Ux(this),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}};QG([he({type:String,attribute:pT.label.name})],mT.prototype,"label");let jG=mT;class gT{constructor(e,t){this.__id=e.id,this.__name=e.name,this.__product=t,this.__renderAsset=e.renderAsset??this.__product.renderAsset,this.__proxyAsset=e.proxyAsset??this.__product.proxyAsset}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}}class qG{constructor(e,t){this.__variants=new Map,this.__product=t;for(const a of e){const l=new gT({id:a.id,name:a.name,renderAsset:a.renderAsset,proxyAsset:a.proxyAsset},this.__product);l&&this.__variants.set(l.id,l)}const i=this.__variants.values().next().value;i&&(this.__activeVariant=i)}get activeVariant(){return this.__activeVariant}set activeVariant(e){this.__activeVariant=e}get activeVariantId(){return this.__activeVariant?.id}async setActiveVariantById(e,t){const i=this.__variants.get(e);i&&(this.__activeVariant=i,await this.selectVariantInRenderAsset(this.__activeVariant.id,t))}async selectVariantInRenderAsset(e,t){window.epigraph.logger.info({title:`Switching to variant: ${e}`});const i=new $u(!1),a=this.__activeVariant.renderAsset;if(!this.activeVariant?.renderAsset||!a)return Promise.reject(i);const l=a.variantsExtension,u=a.variantsExtensionName;if(!l?.variants||u===void 0)return i.success=!0,Promise.resolve(i);const d=l.variants.findIndex(p=>p.name===e);return t.traverse(async p=>{if(!(p instanceof lt)||!p.isMesh||!p.userData.gltfExtensions)return;const m=p.userData.gltfExtensions[u];if(!m)return Promise.reject(i);p.userData.originalMaterial||(p.userData.originalMaterial=p.material);const A=m.mappings.find(_=>_.variants.includes(d));if(A){const _=a.resource.parser;p.material=await _.getDependency("material",A.material),_.assignFinalMaterial(p)}else p.material=p.userData.originalMaterial;i.success=!0}),Promise.resolve(i)}addProductVariant(e){this.__variants.set(e.id,e)}removeProductVariant(e){this.__variants.delete(e.id)}hasProductVariantId(e){return this.__variants.get(e)}getProductVariant(e){return this.__variants.get(e)}getAllProductVariants(){return Array.from(this.__variants.values())}getAllProductVariantIds(){return Array.from(this.__variants.keys())}getAllProductVariantNames(){const e=[];for(const t of this.__variants.values())e.push(t.name);return e}}class WG{constructor(e){this.__id=e.id,this.__name=e.name,this.__renderAsset=e.renderAsset,this.__proxyAsset=e.proxyAsset,this.__productVariantCollection=new qG(e.productVariantsConfig,this)}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}get productVariantCollection(){return this.__productVariantCollection}async loadProxy(){this.__proxyAsset&&!this.__proxyAsset?.isLoaded&&await this.__proxyAsset.load()}async loadRenderGeo(e){this.__renderAsset.isLoaded||await this.__renderAsset.load(),e&&this.__addVariantsFromRenderAsset()}async load(e=!1){await this.loadRenderGeo(e),await this.loadProxy()}__addVariantsFromRenderAsset(){if(!(!this.renderAsset?.variantsExtension||this.renderAsset?.variantsExtension?.variants.length===0))for(const e of this.renderAsset.variantsExtension.variants)try{const t=new gT({id:e.name,name:e.name.toUpperCase()},this);this.productVariantCollection.addProductVariant(t)}catch(t){window.epigraph.logger.error({title:`Could add variant: ${e.name} to product: ${this.__name}`,details:t});continue}}}class AT{constructor({nexusApiResultPayload:e,appWcRef:t}){this._products=new Map,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.parseProducts()}getFirstProduct(){return this._products.values().next().value}parseProducts(){const e=new Y1({id:String(this._data.product_variant.id),uri:this._data.product_variant.assets.render_assets.glb.url,preload:!1,appWcRef:this._appWcRef}),t=new WG({id:this._data.product_variant.id,name:this._data.product_variant.title,renderAsset:e,productVariantsConfig:[{id:this._data.product_variant.variant_identifier,name:this._data.product_variant.title}]});this._products.set(t.id,t)}get products(){return this._products}getExperienceDataSettings(){return{}}getProductVariant(){return this._data.product_variant}getProductVariantIdentifier(){return this._data.product_variant.variant_identifier}getAllProductsAndVariants(){const e={};for(const t of this._products.values()){e[t.id]={name:t.name,variants:[]};for(const i of t.productVariantCollection.getAllProductVariantIds())e[t.id].variants.push(i)}return e}getArGlbUrl(){return this._data.product_variant.assets.ar_assets.glb.url}getArUsdzUrl(){return this._data.product_variant.assets.ar_assets.usdz.url}getRenderGeoUrl(){return this._data.product_variant.assets.render_assets.glb.url}}class _T{constructor(e){this._appWcRef=e}async viewInYourSpace(){return await this._appWcRef.launchAR()}async launchAR(){return await this._appWcRef.launchAR()}async getViewInYourSpaceUrl(){return""}async getViewInYourSpaceQR(){return""}canLaunchAR(){return this._appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this._appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this._appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}setCameraZoomLimits({minDistance:e,maxDistance:t}){this._appWcRef.cameraManager.setCameraZoomLimits({minDistance:e,maxDistance:t})}disableCameraZoomLimits(){this._appWcRef.cameraManager.disableCameraZoomLimits()}getCameraTransforms(){return this._appWcRef.cameraManager.getCurrentCameraTransforms()}setCameraTransforms(e){const t=new K1(e);return void this._appWcRef.cameraManager.moveCameraToLocation({newCameraTransforms:t})}getCameraRotation(){return this._appWcRef.cameraManager.getCurrentCameraRotation()}async setCameraRotation(e,t){const{azimuthAngle:i,polarAngle:a,distance:l}=e;return await this._appWcRef.cameraManager.rotateCameraToLocation({azimuthAngle:i,polarAngle:a,distance:l,transition:t})}getCameraFocalLength(){return this._appWcRef.cameraManager.getCameraFocalLength()}setCameraFocalLength(e){this._appWcRef.cameraManager.setCameraFocalLength(e)}getPositionOnMeshFromPoint(e,t){return this._appWcRef.getPositionOnMeshFromPoint(e,t)}setShadowIntensity(e){this._appWcRef.setShadowIntensity(e)}setShadowSoftness(e){this._appWcRef.setShadowSoftness(e)}showDimensions(){this._appWcRef.showDimensions()}hideDimensions(){this._appWcRef.hideDimensions()}areDimensionsVisible(){return this._appWcRef.areDimensionsActive}getDimensions(){return this._appWcRef.getDimensions()}toggleDimensions(){}getAllAnimations(){return this._appWcRef.getAllAnimations()}getAllAnimationNames(){return this._appWcRef.getAllAnimationNames()}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){this._appWcRef.playAnimationByName({animationName:e,clampWhenFinished:t,loop:i,repetitions:a,reverse:l})}stopAnimationByName(e){this._appWcRef.stopAnimationByName(e)}pauseActiveAnimations(e){this._appWcRef.pauseActiveAnimations(e)}resumeActiveAnimations(){this._appWcRef.resumeActiveAnimations()}stopAllAnimations(){this._appWcRef.stopAllAnimations()}showHelp(){this._appWcRef.showHelp()}hideHelp(){this._appWcRef.hideHelp()}toggleHelp(){this._appWcRef.toggleHelp()}isHelpVisible(){return this._appWcRef.isHelpVisible}}var YG=Object.defineProperty,XG=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&YG(e,t,a),a};const yT=class Sa extends b_{constructor(){super(),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=viewer",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=viewer"},this.featuresToEnable={viewer:!0,hotspots:!1,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this._loggerContext=Sa.webComponentName.toUpperCase(),window.epigraph.logger.info({title:`Initializing ${Sa.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new _T(this)}static{this.webComponentName="epigraph-viewer"}static{this.styles=[super.styles,ut`
8662
8669
  :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [