@epigraph/solutions 1.0.14-alpha.1 → 1.0.15
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.
|
@@ -8497,7 +8497,7 @@ void main() {
|
|
|
8497
8497
|
`:xe`
|
|
8498
8498
|
${super.render()}
|
|
8499
8499
|
${this.__renderQrModal()}
|
|
8500
|
-
`}};Go([Ut("#modelViewer")],Na.prototype,"modelViewerElem");Go([Ut("#arModal")],Na.prototype,"arModalElem");Go([Ut("#qrModal")],Na.prototype,"qrModalElem");Go([ue({attribute:!1})],Na.prototype,"appWcRef");Go([ue({type:String,attribute:"glb-src"})],Na.prototype,"glbSrc");Go([ue({type:String,attribute:"usdz-src"})],Na.prototype,"usdzSrc");Go([ue({type:Boolean,attribute:"debug"})],Na.prototype,"debug");let UQ=Na;class _t{constructor(e,t,i=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=i}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class FQ extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new _t(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new _t(this,"experienceUpdated",""),this.productSettingUpdatedEvent=new _t(this,"productSettingUpdatedEvent",""),this.productSettingsShadowTypeUpdatedEvent=new _t(this,"productSettingsShadowTypeUpdatedEvent",""),this.productSettingsSavedEvent=new _t(this,"productsettingssavedevent",""),this.appReadyEvent=new _t(this,"appReady",""),this.appFailedEvent=new _t(this,"appFailed",""),this.productClassChangedEvent=new _t(this,"productClassChanged",""),this.productChangedEvent=new _t(this,"productChanged",""),this.variantChangedEvent=new _t(this,"variantChanged",""),this.structureNodeAddedEvent=new _t(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new _t(this,"structureNodeRemoved",""),this.structureChangedEvent=new _t(this,"structureChanged",""),this.showNodeLoadingIcon=new _t(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new _t(this,"nodeLoadingHide",""),this.cameraFitEvent=new _t(this,"cameraFit",""),this.hotspotsUpdatedEvent=new _t(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new _t(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new _t(this,"hotspotClicked",""),this.hotspotOpenEvent=new _t(this,"hotspotOpen",""),this.hotspotClosedEvent=new _t(this,"hotspotClosed",""),this.hotspotNextEvent=new _t(this,"hotspotNext",""),this.hotspotPreviousEvent=new _t(this,"hotspotPrevious",""),this.sceneBoundsChanged=new _t(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new _t(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new _t(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new _t(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new _t(this,"arGlbReady",""),this.cartChangedEvent=new _t(this,"cartChanged",""),this.sceneRestartedEvent=new _t(this,"sceneRestarted",""),this.pickerFoundPosition=new _t(this,"pickerFoundPosition",""),this.frameUpdated=new _t(this,"frameUpdated",""),this.cameraControlsStart=new _t(this,"cameraControlsStart",""),this.inputStart=new _t(this,"inputStart",""),this.inputMove=new _t(this,"inputMove",""),this.inputEnd=new _t(this,"inputEnd",""),this.cameraMoveToTransform=new _t(this,"cameraMoveToTransform",""),this.debugChanged=new _t(this,"debugChanged","")}}class $Q{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new eI(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}}class zQ{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class GQ{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const i=new zQ(t);this.__productParts.push(i)}}}class HQ{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const i of e){const s=new GQ(i,this.__productId);s&&this.addProductVariant(s)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case ao.SKU:return this.getProductVariantBySku(e);case ao.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case ao.ASIN:return this.getProductVariantByAsin(e);case ao.UPC:return this.getProductVariantByUpc(e);case ao.EXPERIENCE_ID:return;case ao.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class VQ extends Z1{constructor(e){super(e)}}class QQ{constructor(e){this.__appWcRef=e,this.__materialLibraries=new Map}get materialLibraries(){return this.__materialLibraries}makeEmpty(){this.__materialLibraries.clear()}async addMaterialLibrary(e,t){const i=new VQ({id:e,uri:t,preload:!1,appWcRef:this.__appWcRef});return this.__materialLibraries.set(i.id,i),i}}class jQ{constructor(){this.__defaultValues={postEffect:{ao:!1},render:{envMap:"https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr"},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,infinitePolarAngle:!0,minPolarAngle:0,maxPolarAngle:6.25,infiniteAzimuthAngle:!0,minAzimuthAngle:0,maxAzimuthAngle:6.25},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:lh.ACCUMULATIVE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}},this.deepCopyProductSettings(this.__defaultValues)}asJson(){return this.__values}deepCopyProductSettings(e){this.__values=JSON.parse(JSON.stringify(this.__defaultValues)),e.render&&e.render.envMap&&(this.__values.render.envMap=e.render.envMap),e.camera&&(e.camera.initial&&(this.__values.camera.initial=e.camera.initial),e.camera.backgroundColor&&(this.__values.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(this.__values.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(this.__values.camera.focalLength=e.camera.focalLength),e.camera.canPan!==void 0&&(this.__values.camera.canPan=e.camera.canPan),e.camera.canZoom!==void 0&&(this.__values.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(this.__values.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(this.__values.camera.maxDistance=e.camera.maxDistance),e.camera.minPolarAngle&&(this.__values.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(this.__values.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.minAzimuthAngle&&(this.__values.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(this.__values.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(this.__values.postEffect=e.postEffect),e.renderQuality&&(this.__values.renderQuality=e.renderQuality),e.screenshots&&(this.__values.screenshots=e.screenshots),e.shadows?.shadowType&&(this.__values.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(this.__values.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(this.__values.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(this.__values.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(this.__values.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(this.__values.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(this.__values.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons!==void 0&&(this.__values.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}get postEffect(){return this.__values.postEffect}get render(){return this.__values.render}get camera(){return this.__values.camera}get renderQuality(){return this.__values.renderQuality}get screenshots(){return this.__values.screenshots}get shadows(){return this.__values.shadows}get hotspots(){return this.__values.camera}}class qQ{constructor({nexusApiResultPayload:e,appWcRef:t}){this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.__materialLibraryCollection=new QQ(this._appWcRef),this._data.product_data.settings&&(this._appWcRef.productSettings.deepCopyProductSettings(this._data.product_data.settings),this._appWcRef.eventsManager.productSettingUpdatedEvent.fire());const i=this._data.product_data.assets;if(Object.values(i).length===1){const s=Object.values(i)[0];s?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:s,contextOverride:"ASSET COLLECTION"}):(s.proxyGeo="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/staging-assets/pipeline-assets/3d-assets/proxies/null-proxy.glb",this.__needsRootPlug=!0,s.autoGenerateProxyEntity=!0)}}get materialLibraryCollection(){return this.__materialLibraryCollection}get settings(){return this._data.settings}get productSettings(){return this._data.product_data.settings}get channelName(){return this._data.settings.channel.name}get channelSettings(){return this._data.settings.channel.channel_settings}async __parseMaterialLibraries(){this.__materialLibraryCollection.makeEmpty();const e=this._data?.brand?.material_libraries;if(e)for(const[t,i]of Object.entries(e))await this.__materialLibraryCollection.addMaterialLibrary(t,i.url)}async __parseAssets(){return this.__assetCollection=new $Q(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Ba({name:"root@plug",isPrimary:!0,connectionId:"root",position:new se,rotation:new Rn})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new HQ(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseMaterialLibraries(),await this.__parseAssets(),await this.__parseProductVariants()}}var dh=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(m){m.preventDefault(),i(++o%e.children.length)},!1);function t(m){return e.appendChild(m.dom),m}function i(m){for(var _=0;_<e.children.length;_++)e.children[_].style.display=_===m?"block":"none";o=m}var s=(performance||Date).now(),l=s,u=0,d=t(new dh.Panel("FPS","#0ff","#002")),f=t(new dh.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var g=t(new dh.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){u++;var m=(performance||Date).now();if(f.update(m-s,200),m>=l+1e3&&(d.update(u*1e3/(m-l),100),l=m,u=0,g)){var _=performance.memory;g.update(_.usedJSHeapSize/1048576,_.jsHeapSizeLimit/1048576)}return m},update:function(){s=this.end()},domElement:e,setMode:i}};dh.Panel=function(o,e,t){var i=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),d=80*u,f=48*u,g=3*u,m=2*u,_=3*u,y=15*u,v=74*u,E=30*u,T=document.createElement("canvas");T.width=d,T.height=f,T.style.cssText="width:80px;height:48px";var C=T.getContext("2d");return C.font="bold "+9*u+"px Helvetica,Arial,sans-serif",C.textBaseline="top",C.fillStyle=t,C.fillRect(0,0,d,f),C.fillStyle=e,C.fillText(o,g,m),C.fillRect(_,y,v,E),C.fillStyle=t,C.globalAlpha=.9,C.fillRect(_,y,v,E),{dom:T,update:function(x,P){i=Math.min(i,x),s=Math.max(s,x),C.fillStyle=t,C.globalAlpha=1,C.fillRect(0,0,d,y),C.fillStyle=e,C.fillText(l(x)+" "+o+" ("+l(i)+"-"+l(s)+")",g,m),C.drawImage(T,_+u,y,v-u,E,_,y,v-u,E),C.fillRect(_+v-u,y,u,E),C.fillStyle=t,C.globalAlpha=.9,C.fillRect(_+v-u,y,u,l((1-x/P)*E))}}};class ws extends Gh{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new dh}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(ws.webComponentName)||window.customElements.define(ws.webComponentName,ws)}static{this.styles=ut`
|
|
8500
|
+
`}};Go([Ut("#modelViewer")],Na.prototype,"modelViewerElem");Go([Ut("#arModal")],Na.prototype,"arModalElem");Go([Ut("#qrModal")],Na.prototype,"qrModalElem");Go([ue({attribute:!1})],Na.prototype,"appWcRef");Go([ue({type:String,attribute:"glb-src"})],Na.prototype,"glbSrc");Go([ue({type:String,attribute:"usdz-src"})],Na.prototype,"usdzSrc");Go([ue({type:Boolean,attribute:"debug"})],Na.prototype,"debug");let UQ=Na;class _t{constructor(e,t,i=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=i}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class FQ extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new _t(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new _t(this,"experienceUpdated",""),this.productSettingUpdatedEvent=new _t(this,"productSettingUpdatedEvent",""),this.productSettingsShadowTypeUpdatedEvent=new _t(this,"productSettingsShadowTypeUpdatedEvent",""),this.productSettingsSavedEvent=new _t(this,"productsettingssavedevent",""),this.appReadyEvent=new _t(this,"appReady",""),this.appFailedEvent=new _t(this,"appFailed",""),this.productClassChangedEvent=new _t(this,"productClassChanged",""),this.productChangedEvent=new _t(this,"productChanged",""),this.variantChangedEvent=new _t(this,"variantChanged",""),this.structureNodeAddedEvent=new _t(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new _t(this,"structureNodeRemoved",""),this.structureChangedEvent=new _t(this,"structureChanged",""),this.showNodeLoadingIcon=new _t(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new _t(this,"nodeLoadingHide",""),this.cameraFitEvent=new _t(this,"cameraFit",""),this.hotspotsUpdatedEvent=new _t(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new _t(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new _t(this,"hotspotClicked",""),this.hotspotOpenEvent=new _t(this,"hotspotOpen",""),this.hotspotClosedEvent=new _t(this,"hotspotClosed",""),this.hotspotNextEvent=new _t(this,"hotspotNext",""),this.hotspotPreviousEvent=new _t(this,"hotspotPrevious",""),this.sceneBoundsChanged=new _t(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new _t(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new _t(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new _t(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new _t(this,"arGlbReady",""),this.cartChangedEvent=new _t(this,"cartChanged",""),this.sceneRestartedEvent=new _t(this,"sceneRestarted",""),this.pickerFoundPosition=new _t(this,"pickerFoundPosition",""),this.frameUpdated=new _t(this,"frameUpdated",""),this.cameraControlsStart=new _t(this,"cameraControlsStart",""),this.inputStart=new _t(this,"inputStart",""),this.inputMove=new _t(this,"inputMove",""),this.inputEnd=new _t(this,"inputEnd",""),this.cameraMoveToTransform=new _t(this,"cameraMoveToTransform",""),this.debugChanged=new _t(this,"debugChanged","")}}class $Q{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new eI(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}}class zQ{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class GQ{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const i=new zQ(t);this.__productParts.push(i)}}}class HQ{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const i of e){const s=new GQ(i,this.__productId);s&&this.addProductVariant(s)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case ao.SKU:return this.getProductVariantBySku(e);case ao.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case ao.ASIN:return this.getProductVariantByAsin(e);case ao.UPC:return this.getProductVariantByUpc(e);case ao.EXPERIENCE_ID:return;case ao.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class VQ extends Z1{constructor(e){super(e)}}class QQ{constructor(e){this.__appWcRef=e,this.__materialLibraries=new Map}get materialLibraries(){return this.__materialLibraries}makeEmpty(){this.__materialLibraries.clear()}async addMaterialLibrary(e,t){const i=new VQ({id:e,uri:t,preload:!1,appWcRef:this.__appWcRef});return this.__materialLibraries.set(i.id,i),i}}class jQ{constructor(){this.__defaultValues={postEffect:{ao:!1},render:{envMap:"https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr"},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,infinitePolarAngle:!1,minPolarAngle:0,maxPolarAngle:6.25,infiniteAzimuthAngle:!0,minAzimuthAngle:0,maxAzimuthAngle:6.25},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:lh.ACCUMULATIVE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}},this.deepCopyProductSettings(this.__defaultValues)}asJson(){return this.__values}deepCopyProductSettings(e){this.__values=JSON.parse(JSON.stringify(this.__defaultValues)),e.render&&e.render.envMap&&(this.__values.render.envMap=e.render.envMap),e.camera&&(e.camera.initial&&(this.__values.camera.initial=e.camera.initial),e.camera.backgroundColor&&(this.__values.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(this.__values.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(this.__values.camera.focalLength=e.camera.focalLength),e.camera.canPan!==void 0&&(this.__values.camera.canPan=e.camera.canPan),e.camera.canZoom!==void 0&&(this.__values.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(this.__values.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(this.__values.camera.maxDistance=e.camera.maxDistance),e.camera.infinitePolarAngle&&(this.__values.camera.infinitePolarAngle=e.camera.infinitePolarAngle),e.camera.minPolarAngle&&(this.__values.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(this.__values.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.infiniteAzimuthAngle&&(this.__values.camera.infiniteAzimuthAngle=e.camera.infiniteAzimuthAngle),e.camera.minAzimuthAngle&&(this.__values.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(this.__values.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(this.__values.postEffect=e.postEffect),e.renderQuality&&(this.__values.renderQuality=e.renderQuality),e.screenshots&&(this.__values.screenshots=e.screenshots),e.shadows?.shadowType&&(this.__values.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(this.__values.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(this.__values.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(this.__values.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(this.__values.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(this.__values.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(this.__values.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons!==void 0&&(this.__values.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}get postEffect(){return this.__values.postEffect}get render(){return this.__values.render}get camera(){return this.__values.camera}get renderQuality(){return this.__values.renderQuality}get screenshots(){return this.__values.screenshots}get shadows(){return this.__values.shadows}get hotspots(){return this.__values.camera}}class qQ{constructor({nexusApiResultPayload:e,appWcRef:t}){this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.__materialLibraryCollection=new QQ(this._appWcRef),this._data.product_data.settings&&(this._appWcRef.productSettings.deepCopyProductSettings(this._data.product_data.settings),this._appWcRef.eventsManager.productSettingUpdatedEvent.fire());const i=this._data.product_data.assets;if(Object.values(i).length===1){const s=Object.values(i)[0];s?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:s,contextOverride:"ASSET COLLECTION"}):(s.proxyGeo="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/staging-assets/pipeline-assets/3d-assets/proxies/null-proxy.glb",this.__needsRootPlug=!0,s.autoGenerateProxyEntity=!0)}}get materialLibraryCollection(){return this.__materialLibraryCollection}get settings(){return this._data.settings}get productSettings(){return this._data.product_data.settings}get channelName(){return this._data.settings.channel.name}get channelSettings(){return this._data.settings.channel.channel_settings}async __parseMaterialLibraries(){this.__materialLibraryCollection.makeEmpty();const e=this._data?.brand?.material_libraries;if(e)for(const[t,i]of Object.entries(e))await this.__materialLibraryCollection.addMaterialLibrary(t,i.url)}async __parseAssets(){return this.__assetCollection=new $Q(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Ba({name:"root@plug",isPrimary:!0,connectionId:"root",position:new se,rotation:new Rn})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new HQ(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseMaterialLibraries(),await this.__parseAssets(),await this.__parseProductVariants()}}var dh=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(m){m.preventDefault(),i(++o%e.children.length)},!1);function t(m){return e.appendChild(m.dom),m}function i(m){for(var _=0;_<e.children.length;_++)e.children[_].style.display=_===m?"block":"none";o=m}var s=(performance||Date).now(),l=s,u=0,d=t(new dh.Panel("FPS","#0ff","#002")),f=t(new dh.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var g=t(new dh.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){u++;var m=(performance||Date).now();if(f.update(m-s,200),m>=l+1e3&&(d.update(u*1e3/(m-l),100),l=m,u=0,g)){var _=performance.memory;g.update(_.usedJSHeapSize/1048576,_.jsHeapSizeLimit/1048576)}return m},update:function(){s=this.end()},domElement:e,setMode:i}};dh.Panel=function(o,e,t){var i=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),d=80*u,f=48*u,g=3*u,m=2*u,_=3*u,y=15*u,v=74*u,E=30*u,T=document.createElement("canvas");T.width=d,T.height=f,T.style.cssText="width:80px;height:48px";var C=T.getContext("2d");return C.font="bold "+9*u+"px Helvetica,Arial,sans-serif",C.textBaseline="top",C.fillStyle=t,C.fillRect(0,0,d,f),C.fillStyle=e,C.fillText(o,g,m),C.fillRect(_,y,v,E),C.fillStyle=t,C.globalAlpha=.9,C.fillRect(_,y,v,E),{dom:T,update:function(x,P){i=Math.min(i,x),s=Math.max(s,x),C.fillStyle=t,C.globalAlpha=1,C.fillRect(0,0,d,y),C.fillStyle=e,C.fillText(l(x)+" "+o+" ("+l(i)+"-"+l(s)+")",g,m),C.drawImage(T,_+u,y,v-u,E,_,y,v-u,E),C.fillRect(_+v-u,y,u,E),C.fillStyle=t,C.globalAlpha=.9,C.fillRect(_+v-u,y,u,l((1-x/P)*E))}}};class ws extends Gh{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new dh}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(ws.webComponentName)||window.customElements.define(ws.webComponentName,ws)}static{this.styles=ut`
|
|
8501
8501
|
.debug-label {
|
|
8502
8502
|
position: absolute;
|
|
8503
8503
|
top: 0%;
|
|
@@ -8652,12 +8652,15 @@ void main() {
|
|
|
8652
8652
|
min-width: 300px;
|
|
8653
8653
|
right: 15px !important;
|
|
8654
8654
|
position: absolute;
|
|
8655
|
-
padding:
|
|
8655
|
+
padding: 10px;
|
|
8656
8656
|
max-height: 90%;
|
|
8657
|
+
border-radius: 10px;
|
|
8657
8658
|
}
|
|
8658
8659
|
|
|
8659
8660
|
.lil-gui .save-settings-button {
|
|
8660
8661
|
--widget-height: 44px;
|
|
8662
|
+
--widget-color: #b0c697;
|
|
8663
|
+
--widget-border-radius: 10px;
|
|
8661
8664
|
}
|
|
8662
8665
|
|
|
8663
8666
|
.lil-gui.root>.title {
|