{"version":3,"sources":["../../src/constants/errors.ts","../../src/app/render/cache/GlassesCache.ts","../../src/app/render/cache/VideoCache.ts","../../src/helpers/ParameterHelper.ts","../../src/helpers/VtoInstanceContainer.ts","../../src/constants/actions.ts","../../src/functions/GetScreenshot.ts","../../src/reducers/renderReducer.ts","../../src/functions/CloseRenderFunction.tsx","../../src/helpers/CallbackHelper.ts","../../src/config/acceptance.js","../../src/config/development.js","../../src/config/development-localserver.js","../../src/config/integration.js","../../src/config/production.js","../../src/config/staging.js","../../src/reducers/appReducer.ts","../../src/helpers/GlassesHelper.ts","../../src/VtoApi.ts","../../src/helpers/EnvironmentHelper.ts","../../src/helpers/LocalizationHelper.ts","../../src/interfaces/InitializeOptions.ts","../../src/functions/InitializeFunction.tsx","../../src/interfaces/VtoCoreEnvironment.ts","../../src/functions/IsUpcSupportedFunction.tsx","../../src/app/render/LoadingSpinner.tsx","../../src/helpers/TransitionColorHelper.ts","../../src/helpers/DownloadHelper.ts","../../src/icons/RotateIcon.tsx","../../src/app/render/debug/PupilOverlay.tsx","../../src/helpers/OverlayHelper.ts","../../src/app/render/debug/PupilImageOverlay.tsx","../../src/app/render/debug/MeshCenterOverlay.tsx","../../src/app/render/debug/RenderDebugOverlay.tsx","../../src/app/render/RenderCanvas.tsx","../../src/helpers/MathHelper.ts","../../src/icons/DoubleFingerIcon.tsx","../../src/app/render/SwipeableContainer.tsx","../../src/app/render/RenderContainer.tsx","../../src/app/render/RenderError.tsx","../../src/app/render/RenderLoader.tsx","../../src/interfaces/RenderOptions.ts","../../src/functions/RenderFunction.tsx","../../src/constants/Styling.ts","../../src/reducers/combinedReducers.ts","../../src/VtoCore.ts","../../src/Store.ts","../../src/functions/SetTransitionOpacity.ts","../../src/functions/SetTransitionOverrideColor.ts","../../src/functions/setTransitionLensName.ts","../../src/functions/DownloadTransitionColorCatalogue.ts"],"names":["VtoError","type","message","_defineProperty","_this","Object","setPrototypeOf","prototype","_createClass","this","Error","OpacityError","_this3","UnknownError","e","_this4","InitializationError","_this5","InvalidEnvironmentError","environment","_this6","InvalidParametersError","parameter","_this7","UpcSupportedError","upc","_this8","RenderingError","_this13","UnmountComponentError","divId","_this15","InstanceManagementError","_this18","MissingInstanceError","id","_this19","ScreenshotError","_this20","glassesCache","GlassesCache","glassesData","undefined","videoCache","VideoCache","videoData","isObject","item","_typeof","Array","isArray","isString","isNumber","Number","isNaN","isBoolean","mergeDeep","target","source","output","assign","keys","forEach","key","logger","RemoteLogConfig","getInstance","getLoggerInfo","name","version","VtoInstanceContainer","vtoInstances","push","render","instance","glRender","warn","instanceId","findIndex","value","splice","find","_instance","renderCanvas","SET_CONFIG","SET_ANALYTICS_CONFIG","UPDATE_INSTANCE","ADD_VIDEO","DELETE_VIDEO_DATA","SET_VIDEO_DATA","SET_VIDEO_FACE_DATA","SET_VIDEO_STATUS","SET_INSTANCE_INDEX","SWIPE_INSTANCE","DELETE_INSTANCE","ADD_GLASSES","GLASSES_FALLBACK","SET_GLASSES_DATA","SET_GLASSES_STATUS","SET_RENDERER_STATUS","RenderActions","updateInstance","createAction","Actions","setInstanceIndex","swipeInstance","deleteInstance","addVideo","setVideoData","deleteVideoData","setVideoFaceData","setVideoStatus","eraseVideoCache","addGlasses","glassesFallback","setGlassesData","setGlassesStatus","setRendererStatus","RenderReducer","handleActions","state","action","payload","newState","currentInstance","videoStatus","rendererStatus","videoId","faceData","videoFaceData","status","hasOwnProperty","poseIndex","renderOptions","noseIndex","swiped","upcStatus","resolution","CloseRenderFunction","store","options","onSuccess","onError","debug","validateCloseRenderOptions","error","getVtoInstance","container","document","getElementById","ReactDOM","dispatch","destroy","removeInstance","getScreenshot","quality","Promise","resolve","reject","outputCanvas","createElement","antialiasCanvas","width","parseInt","style","height","ctx","getContext","antialiasCanvasContext","steps","filter","drawImage","dataUrl","toDataURL","w","h","console","CallbackHelper","onRenderSuccess","onRenderError","onTransitionAnimation","opacityValue","onTransitionAnimationEnd","vtoCoreEnvironment","vtoGlassesEnvironment","vtoServerEnvironment","publicHost","gaTrackingId","trackerName","initialState","config","productionConfig","analyticsConfig","AppActions","setConfig","setAnalyticsConfig","AppReducer","_objectSpread","glassesDownloader","GlassesDownloader","assetLoader","AssetLoader","GlassesHelper","Catalog","getUpcAvailability","env","GlassesEnvironment","PROD","then","upcAvailability","glassesType","available","lods","length","glassesEnvironment","singleTexture","b3dparams","lensMap","downloadGltfGlasses","gltfPointer","loadGltfAsset","glasses","asset","accessTime","Date","now","downloadGlasses","glassesPromise","VtoApi","VtoServerClient","setEnvironment","singlePose","getVideo","developmentConfig","developmentLocalServerConfig","stagingConfig","integrationConfig","acceptanceConfig","LocalizationHelper","locale","localizationPromise","localTranslations","localizedTranslations","page","text","translationType","defaultTranslations","de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","zh","CORE","PERMISSION_ERROR","ERROR","SUBTEXT","WEBCAM_ERROR","RENDER_VTO","CLICK_AND_MOVE","ROTATE","SLIDE_DESKTOP","SLIDE_TWO_FINGERS","SWIPE_TWO_FINGERS","RENDER_ERROR","TITLE_1","TITLE_2","TITLE_3","UPC_MISSING","TITLE","textEnv","fetch","baseUrl","response","ok","json","language","split","localeMap","translationFound","fetchLocalization","translation","fallbackTranslation","englishTranslation","defaultInitializeOptions","brand","storeId","videoCacheLimit","glassesCacheLimit","InitializeFunction","mergedOptions","callbacks","includes","validateInitializeOptions","getState","app","initialize","supportedFeatures","webglRendering","GlUtils","supportsRendering","IsUpcSupportedFunction","validateIsUpcSupportedOptions","supported","LoadingSpinner","transitionLensName","finalOpacity","animationStartTime","animationDuration","props","size","React","className","DownloadHelper","url","blob","centerImage","form","FormData","append","method","body","face","v2","image","iris","imagePupils","pupils","detected","RotateIcon","viewBox","stroke","strokeWidth","fill","fillRule","transform","points","d","transitionLensMap","transitionOpacity","animationEnabled","animateForward","downloadTransitionsPromise","TransitionColorHelper","downloadTransitionColors","downloadPromise","downloadTransitionLenses","colorMap","map","colorName","setTransitionOverrideColor","color","OVERRIDE","reset","startAnimation","duration","forward","currentOpacity","computePartialAnimation","getTransitionLens","lensName","getCurrentTransitionLens","setCurrentTransitionLens","setCurrentTransitionLensName","setCurrentLensOpacity","inputOpacity","getCurrentLensOpacity","animationProgress","PupilOverlay","left","right","shouldRender","x","top","y","OverlayHelper","position","inputImageSize","cropOffset","screenSpaceRatio","outputSize","PupilImageOverlay","inputPosition","canvasSize","leftPupil","convertCoordinates","rightPupil","MeshCenterOverlay","meshCenter","RenderDebugOverlay","debugOptions","showMeshCenter","showPupils","showImagePupils","RenderCanvas","canvas","actions","current","vtoRenderer","ThreeRender","mirror","addRender","prevProps","sendRenderEvent","video","glassesStatus","renderKey","previouslyRenderedKey","renderGlasses","pupillaryDistance","updateOptions","enableScaling","_this2","renderVto","renderFov","offsetY","offsetZ","ref","showDebugOverlay","connect","ownProps","bindActionCreators","MathHelper","num","min","max","DoubleFingerIcon","xmlns","clipRule","SwipeableContainer","Math","round","swipeSpeedModifier","noseSwipeSpeedModifier","hammerManagerPose","Hammer","containerRef","domEvents","touchAction","recognizers","direction","pointers","on","computeIndexes","previousY","hammerManagerNose","touches","enableNosePosition","hammerManagerOverlay","time","firstTouch","setState","overlay","event","oldIndex","previousX","center","deltaX","deltaIndex","indexInterval","clamp","indexCount","onSetIndex","oldNoseIndex","deltaY","noseIndexInterval","noseIndexCount","onSetNoseIndex","enabled","initializeHammer","addEventListener","preventDefault","destroyHammer","notification","getString","display","children","RenderContainer","detectPupils","initialIndex","fitting","fetchAssets","fetchFaceData","singlePoseIndex","shouldUpdateVideo","shouldUpdateGlasses","downloadingDivId","downloadingVideoId","meshVideoData","startsWith","shouldEnableNosePosition","nosePositionTouches","showRotateBar","RenderError","RenderLoader","LazyRenderContainer","shouldShowErrorScreen","optimizeSinglePose","shouldShowLoadingScreen","showPercentage","defaultRenderOptions","showMesh","calculatePupils","calculateMeshCenter","checkError","hideGlasses","hideShadow","hideBackground","hideLenses","hideFrame","meshColor","renderCount","RenderFunction","validateRenderOptions","callback","input","parseFloat","stringToNumber","validUpc","join","addVto","newVideoStatus","newGlassesStatus","classList","add","setRenderErrorCallback","Provider","combineReducers","enhancer","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","rootReducer","configureStore","setVtoEnvironment","errorWrapper","errorFunction","VtoCore","isUpcSupported","closeRender","setTransitionOpacity","opacity","transitionLens","transitionColor","setTransitionColorName","setTransitionLensName","downloadTransitionColorCatalogue","colors"],"mappings":"y+KAAMA,MAAS,8BAGb,WAAYC,EAAMC,GAAe,MAIiB,OAJjB,UACFC,IAA7BC,wBAASH,EAAI,aAAKC,KAAWC,eAC7BC,EAAKH,KAAOA,EACZG,EAAKF,QAAUA,EACfG,OAAOC,eAAc,KAAON,EAASO,WAAW,EAKjD,OAJAC,0BAED,WACE,OAAOC,KAAKR,SACb,EAZY,CAYZ,EAZoBS,QAsBjBC,EAAa,8BAGjB,WAAYT,GAAe,MAE2B,OAF3B,UACzBU,cAAMD,EAAaV,KAAMC,GACzBG,OAAOC,eAAc,KAAOK,EAAaJ,WAAW,EACrD,YANgB,CAAQP,GAAQG,EAA7BQ,EAAa,OACI,gBAAc,IAQ/BE,EAAa,8BACjB,WAAYC,GAAQ,MAEkC,OAFlC,UAClBC,cAAM,eAAgBD,EAAEZ,SACxBG,OAAOC,eAAc,KAAOO,EAAaN,WAAW,EACrD,YAJgB,CAAQP,GAOrBgB,EAAoB,8BACxB,mBAE6D,OAF7D,UACEC,SAAM,2BAAuB,4BAC7BZ,OAAOC,eAAc,KAAOU,EAAoBT,WAAW,EAC5D,YAJuB,CAAQP,GAO5BkB,EAAwB,8BAC5B,WAAYC,GAAmB,MAEkC,OAFlC,UAC7BC,cAAM,0BAAyB,UAAKD,EAAW,4BAC/Cd,OAAOC,eAAc,KAAOY,EAAwBX,WAAW,EAChE,YAJ2B,CAAQP,GAOhCqB,EAAuB,8BAC3B,WAAYC,GAAiB,MAEmC,OAFnC,UAC3BC,cAAM,yBAAwB,UAAKD,EAAS,0BAC5CjB,OAAOC,eAAc,KAA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sJ,yBAAyB,CAACpJ,QAAMG,MAAK,SAAC2V,GACnD,OAAOtiB,OAAOwD,KAAK8e,MAFkB,IAAC9V,GLyGxCnD,cAAa,WAAmC,IAAlCzJ,EAAO,UAAH,6CAAG,aAAc0J,EAAU,UAAH,6CAAG,GAC3C,OAAOD,GAAczJ,EAAM0J,KAI/BmY,GAAkB,cAClB9d,GAAO+E,MAAM","file":"15.chunk.js","sourcesContent":["class VtoError extends Error {\n private type: string;\n\n constructor(type, message: string) {\n super(`${type}: ${message}`);\n this.type = type;\n this.message = message;\n Object.setPrototypeOf(this, VtoError.prototype);\n }\n\n getType() {\n return this.type;\n }\n}\n\nclass GenericError extends VtoError {\n constructor(e: Error) {\n super('GenericError', e.message);\n Object.setPrototypeOf(this, GenericError.prototype);\n }\n}\n\nclass OpacityError extends VtoError {\n public static type = 'OpacityError';\n\n constructor(message: string) {\n super(OpacityError.type, message);\n Object.setPrototypeOf(this, OpacityError.prototype);\n }\n}\n\nclass UnknownError extends VtoError {\n constructor(e: Error) {\n super('UnknownError', e.message);\n Object.setPrototypeOf(this, UnknownError.prototype);\n }\n}\n\nclass InitializationError extends VtoError {\n constructor() {\n super('InitializationError', 'failed to initialize vto');\n Object.setPrototypeOf(this, InitializationError.prototype);\n }\n}\n\nclass InvalidEnvironmentError extends VtoError {\n constructor(environment: string) {\n super('InvalidEnvironmentError', `${environment} environment is invalid`);\n Object.setPrototypeOf(this, InvalidEnvironmentError.prototype);\n }\n}\n\nclass InvalidParametersError extends VtoError {\n constructor(parameter: string) {\n super('InvalidParametersError', `${parameter} parameter is invalid`);\n Object.setPrototypeOf(this, InvalidParametersError.prototype);\n }\n}\n\nclass UpcSupportedError extends VtoError {\n constructor(upc: string) {\n super('UpcSupportedError', `failed to determine if upc ${upc} is supported`);\n Object.setPrototypeOf(this, UpcSupportedError.prototype);\n }\n}\n\nclass UserCreateError extends VtoError {\n constructor() {\n super('UserCreateError', 'failed to create user');\n Object.setPrototypeOf(this, UserCreateError.prototype);\n }\n}\n\nclass UserDownloadError extends VtoError {\n constructor(userId: string) {\n super('UserDownloadError', `failed to download user data for id: ${userId}`);\n Object.setPrototypeOf(this, UserDownloadError.prototype);\n }\n}\n\nclass VideoDownloadError extends VtoError {\n constructor(videoId: string) {\n super('VideoDownloadError', `failed to download video data for id: ${videoId}`);\n Object.setPrototypeOf(this, VideoDownloadError.prototype);\n }\n}\n\nclass UpcMissingError extends VtoError {\n constructor(upc: string) {\n super('UpcMissingError', `upc ${upc} could not be found`);\n Object.setPrototypeOf(this, UpcMissingError.prototype);\n }\n}\n\nclass RenderingError extends VtoError {\n constructor(upc: string) {\n super('RenderingError', `upc ${upc} failed to successfully render`);\n Object.setPrototypeOf(this, RenderingError.prototype);\n }\n}\n\nclass MountComponentError extends VtoError {\n constructor(divId: string) {\n super('MountComponentError', `failed to mount component at divId: ${divId}`);\n Object.setPrototypeOf(this, MountComponentError.prototype);\n }\n}\n\nclass UnmountComponentError extends VtoError {\n constructor(divId: string) {\n super('UnmountComponentError', `failed to unmount component at divId: ${divId}`);\n Object.setPrototypeOf(this, UnmountComponentError.prototype);\n }\n}\n\nclass UserMissingError extends VtoError {\n constructor(userId: string) {\n super('UserMissingError', `failed to find user with id: ${userId}`);\n Object.setPrototypeOf(this, UserMissingError.prototype);\n }\n}\n\nclass MirrorError extends VtoError {\n constructor() {\n super('MirrorError', 'failed to start vto mirror');\n Object.setPrototypeOf(this, MirrorError.prototype);\n }\n}\n\nclass InstanceManagementError extends VtoError {\n constructor() {\n super('InstanceManagementError', 'Trying to create a renderer without instanciating anything before');\n Object.setPrototypeOf(this, InstanceManagementError.prototype);\n }\n}\n\nclass MissingInstanceError extends VtoError {\n constructor(id: string) {\n super('MissingInstanceError', `Trying to access a non existing vto instance at id: ${id}`);\n Object.setPrototypeOf(this, MissingInstanceError.prototype);\n }\n}\n\nclass ScreenshotError extends VtoError {\n constructor() {\n super('ScreenshotError', 'failed to generate screenshot');\n Object.setPrototypeOf(this, ScreenshotError.prototype);\n }\n}\n\nexport {\n VtoError,\n GenericError,\n UnknownError,\n OpacityError,\n InitializationError,\n InvalidEnvironmentError,\n InvalidParametersError,\n UpcSupportedError,\n UserCreateError,\n UserDownloadError,\n VideoDownloadError,\n UpcMissingError,\n RenderingError,\n MountComponentError,\n UnmountComponentError,\n UserMissingError,\n MirrorError,\n InstanceManagementError,\n MissingInstanceError,\n ScreenshotError\n};","const glassesCache: Record = {};\n\nexport const GlassesCache = {\n get: (divId: string): GlassesData => {\n return glassesCache[divId];\n },\n\n contains: (divId: string): boolean => {\n return !!glassesCache[divId];\n },\n\n set: (divId: string, glassesData: GlassesData): void => {\n glassesCache[divId] = glassesData;\n },\n\n delete: (divId: string): void => {\n glassesCache[divId] = undefined;\n }\n};\n","const videoCache: Record = {};\n\nexport const VideoCache = {\n get: (divId: string): VideoData => {\n return videoCache[divId];\n },\n\n contains: (divId: string): boolean => {\n return !!videoCache[divId];\n },\n\n set: (divId: string, videoData: VideoData): void => {\n videoCache[divId] = videoData;\n },\n\n delete: (divId: string): void => {\n videoCache[divId] = undefined;\n }\n};\n","import { InvalidParametersError } from '../constants/errors';\n\nconst isObject = (item: unknown) => {\n return (item !== undefined && typeof item === 'object' && !Array.isArray(item));\n};\n\nconst isString = (item: unknown) => {\n return (item !== undefined && typeof item === 'string');\n};\n\nconst isNumber = (item: unknown) => {\n return (item !== undefined && typeof item === 'number' && !Number.isNaN(item));\n};\n\nconst isBoolean = (item: unknown) => {\n return (item !== undefined && typeof item === 'boolean');\n};\n\nconst isFunction = (item: unknown) => {\n return (item !== undefined && {}.toString.call(item) === '[object Function]');\n};\n\nconst stringToNumber = (input: string | number): number => {\n try {\n if (input === undefined) {\n return undefined;\n } else if (typeof input === 'number') {\n return input;\n } else if (typeof input === 'string') {\n return parseFloat(input);\n } else {\n throw new InvalidParametersError('');\n }\n } catch {\n throw new InvalidParametersError('');\n }\n}\n\nconst mergeDeep = (target, source) => {\n const output = Object.assign({}, target);\n\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(key => {\n if (isObject(source[key])) {\n if (!(key in target))\n Object.assign(output, { [key]: source[key] });\n else\n output[key] = mergeDeep(target[key], source[key]);\n } else {\n Object.assign(output, { [key]: source[key] });\n }\n });\n }\n\n return output;\n}\n\nconst removeEmpty = (obj: T): Partial => {\n Object.keys(obj).forEach(key => {\n if (obj[key] && typeof obj[key] === 'object') {\n removeEmpty(obj[key]);\n } else if (obj[key] === undefined) {\n delete obj[key];\n }\n });\n return obj;\n};\n\nexport { isString, isBoolean, isNumber, isFunction, isObject, stringToNumber, mergeDeep, removeEmpty};\n","import { ThreeRender } from '@luxottica/vm-renderer-threejs';\nimport { InstanceManagementError, MissingInstanceError } from '../constants/errors';\n\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'VtoInstanceContainer');\n\nclass VtoInstanceContainer {\n // tslint:disable-next-line: variable-name\n private static _instance: VtoInstanceContainer;\n private vtoInstances: VtoInstance[];\n\n constructor() {\n this.vtoInstances = [];\n }\n\n public static get instance() {\n if (!VtoInstanceContainer._instance) {\n VtoInstanceContainer._instance = new VtoInstanceContainer();\n }\n return VtoInstanceContainer._instance;\n }\n\n public addVto(divId: string) {\n for (const instance of this.vtoInstances) {\n if (instance.id === divId) {\n return;\n }\n }\n this.vtoInstances.push({\n id: divId,\n });\n }\n\n public addRender({ id, render }: { id: string; render: ThreeRender; }) {\n for (const instance of this.vtoInstances) {\n if (instance.id === id) {\n if (instance.glRender) {\n logger.warn('You are probably instantiating a VTO on a target without closing it');\n }\n instance.glRender = render;\n return;\n }\n }\n throw new InstanceManagementError();\n }\n\n public removeInstance(id: string) {\n const instanceId = this.vtoInstances.findIndex((value) => {\n return value.id === id;\n });\n if (instanceId >= 0) {\n this.vtoInstances.splice(instanceId, 1);\n }\n }\n\n public getVtoInstance(id: string): VtoInstance {\n try {\n const found = this.vtoInstances.find((value) => {\n return value.id === id;\n });\n return found;\n } catch {\n throw new MissingInstanceError(id);\n }\n }\n}\n\nexport {\n VtoInstanceContainer,\n};\n","export const SET_CONFIG = 'SET_CONFIG';\nexport const SET_GLASSES_ENVIRONMENT = 'SET_GLASSES_ENVIRONMENT';\nexport const SET_ANALYTICS_CONFIG = 'SET_ANALYTICS_CONFIG';\n\nexport const SET_USER = 'SET_USER';\n\nexport const SET_CACHE_LIMITS = 'SET_CACHE_LIMITS';\nexport const UPDATE_INSTANCE = 'UPDATE_INSTANCE';\nexport const ADD_VIDEO = 'ADD_VIDEO';\nexport const DELETE_VIDEO_DATA = 'DELETE_VIDEO_DATA';\nexport const SET_VIDEO_DATA = 'SET_VIDEO_DATA';\nexport const SET_VIDEO_FACE_DATA = 'SET_VIDEO_FACE_DATA';\nexport const SET_RENDER_CANVAS_DATA = 'SET_RENDER_CANVAS_DATA';\nexport const SET_VIDEO_STATUS = 'SET_VIDEO_STATUS';\nexport const SET_INSTANCE_INDEX = 'SET_INSTANCE_INDEX';\nexport const SWIPE_INSTANCE = 'SWIPE_INSTANCE';\nexport const DELETE_INSTANCE = 'DELETE_INSTANCE';\nexport const SET_VIDEO_LOADING = 'SET_VIDEO_LOADING';\nexport const ERASE_VIDEO_CACHE = 'ERASE_VIDEO_CACHE';\n\nexport const ADD_GLASSES = 'ADD_GLASSES';\nexport const GLASSES_FALLBACK = 'GLASSES_FALLBACK';\nexport const SET_GLASSES_DATA = 'SET_GLASSES_DATA';\nexport const SET_GLASSES_STATUS = 'SET_GLASSES_STATUS';\nexport const ERASE_GLASSES_CACHE = 'ERASE_GLASSES_CACHE';\n\nexport const SET_MIRROR_STATUS = 'SET_MIRROR_STATUS';\nexport const SET_MIRROR_STREAM_DATA = 'SET_MIRROR_STREAM_DATA';\nexport const CLEAR_MIRROR_STREAM_DATA = 'CLEAR_MIRROR_STREAM_DATA';\nexport const ADD_MIRROR_GLASSES = 'ADD_MIRROR_GLASSES';\nexport const SET_MIRROR_GLASSES_DATA = 'SET_MIRROR_GLASSES_DATA';\nexport const SET_MIRROR_GLASSES_STATUS = 'SET_MIRROR_GLASSES_STATUS';\n\nexport const ADD_MIRROR_VIDEO = 'ADD_MIRROR_VIDEO';\nexport const SET_MIRROR_VIDEO_DATA = 'SET_MIRROR_VIDEO_DATA';\nexport const SET_MIRROR_VIDEO_STATUS = 'SET_MIRROR_VIDEO_STATUS';\n\nexport const SET_RENDERER_STATUS = 'SET_RENDERER_STATUS';","import { ScreenshotError } from '../constants/errors';\n\nexport interface Screenshot {\n dataUrl: string;\n w: number;\n h: number\n}\n\nlet renderCanvas: HTMLCanvasElement;\n\nexport const setActiveCanvas = (canvas: HTMLCanvasElement) => {\n renderCanvas = canvas;\n};\n\nexport const disposeScreenshot = () => {\n renderCanvas = null; \n}\n\nexport const getScreenshot = (type: string, quality: number): Promise => {\n return new Promise((resolve, reject)=>{\n try {\n\n let outputCanvas = document.createElement('canvas');\n const antialiasCanvas = document.createElement('canvas');\n \n outputCanvas.width = parseInt(renderCanvas.style.width);\n outputCanvas.height = parseInt(renderCanvas.style.height);\n\n antialiasCanvas.width = renderCanvas.width;\n antialiasCanvas.height = renderCanvas.height;\n\n let ctx = outputCanvas.getContext('2d');\n const antialiasCanvasContext = antialiasCanvas.getContext('2d');\n const ratio = (renderCanvas.width / outputCanvas.width);\n const steps = ratio>>1;\n antialiasCanvasContext.filter = `blur(${steps}px)`;\n antialiasCanvasContext.drawImage(renderCanvas, 0, 0);\n\n ctx.drawImage(antialiasCanvas,\n 0, 0, renderCanvas.width, renderCanvas.height,\n 0, 0, outputCanvas.width, outputCanvas.height);\n \n resolve({\n dataUrl: outputCanvas.toDataURL(type, quality),\n w: outputCanvas.width,\n h: outputCanvas.height\n });\n \n outputCanvas = undefined;\n ctx = undefined\n } catch (e) {\n console.error(e);\n reject(new ScreenshotError());\n }\n });\n}","import { Action, createAction, handleActions } from 'redux-actions';\nimport { GlassesCache } from '../app/render/cache/GlassesCache';\nimport { VideoCache } from '../app/render/cache/VideoCache';\nimport * as Actions from '../constants/actions';\nimport { AssetResolution } from '@luxottica/vm-glasses';\n\nconst initialState: RenderStoreState = {\n instance: {}\n};\n\nexport const RenderActions = {\n updateInstance: createAction(Actions.UPDATE_INSTANCE),\n setInstanceIndex: createAction<{ divId: string, poseIndex?: number, noseIndex?: number }>(Actions.SET_INSTANCE_INDEX),\n swipeInstance: createAction<{ divId: string }>(Actions.SWIPE_INSTANCE),\n deleteInstance: createAction<{ divId: string }>(Actions.DELETE_INSTANCE),\n\n addVideo: createAction<{ divId: string, videoId: string }>(Actions.ADD_VIDEO),\n setVideoData: createAction<{ divId: string, videoId: string, videoData: VideoData }>(Actions.SET_VIDEO_DATA),\n deleteVideoData: createAction<{ divId: string }>(Actions.DELETE_VIDEO_DATA),\n setVideoFaceData: createAction<{ divId: string, videoId: string, videoFaceData: VideoFaceData }>(Actions.SET_VIDEO_FACE_DATA),\n setVideoStatus: createAction<{ divId: string, videoId: string, status: RenderStatus }>(Actions.SET_VIDEO_STATUS),\n eraseVideoCache: createAction(Actions.ERASE_VIDEO_CACHE),\n\n addGlasses: createAction<{ divId: string, upc: string }>(Actions.ADD_GLASSES),\n glassesFallback: createAction<{ divId: string, upc: string, resolution: AssetResolution }>(Actions.GLASSES_FALLBACK),\n setGlassesData: createAction<{ divId: string, upc: string, glassesData: GlassesData }>(Actions.SET_GLASSES_DATA),\n setGlassesStatus: createAction<{ divId: string, upc: string, status: RenderStatus }>(Actions.SET_GLASSES_STATUS),\n\n setRendererStatus: createAction<{ divId: string, status: RenderStatus}>(Actions.SET_RENDERER_STATUS)\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const RenderReducer = handleActions({\n\n [Actions.UPDATE_INSTANCE]: (state, action: Action): RenderStoreState => {\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...action.payload\n }\n }\n };\n },\n\n [Actions.DELETE_INSTANCE]: (state, action: Action): RenderStoreState => {\n const newState = { ...state };\n delete newState.instance[action.payload.divId];\n return newState;\n },\n\n [Actions.ADD_VIDEO]: (state, action: Action<{ divId: string, videoId: string }>): RenderStoreState => {\n const currentInstance = state.instance[action.payload.divId];\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n videoStatus: 'LOADING',\n rendererStatus: 'LOADING',\n }\n }\n };\n },\n\n [Actions.DELETE_VIDEO_DATA]: (state, action: Action<{ divId: string, videoId: string }>): RenderStoreState => {\n VideoCache.delete(action.payload.divId);\n const currentInstance = state.instance[action.payload.divId];\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n videoStatus: undefined\n }\n }\n }\n },\n\n [Actions.SET_VIDEO_DATA]: (state, action: Action<{ divId: string, videoId: string, videoData: VideoData}>): RenderStoreState => {\n\n VideoCache.set(action.payload.divId, action.payload.videoData);\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n videoStatus: 'READY'\n }\n }\n }\n },\n\n [Actions.SET_VIDEO_FACE_DATA]: (state, action: Action<{ divId: string, videoId: string, videoFaceData: VideoFaceData }>): RenderStoreState => {\n \n if (VideoCache.contains(action.payload.videoId)) {\n VideoCache.set(action.payload.divId, {\n ...VideoCache.get(action.payload.divId),\n faceData: {\n ...VideoCache.get(action.payload.divId).faceData,\n ...action.payload.videoFaceData\n }\n });\n return { ...state };\n } else {\n return { ...state };\n }\n },\n\n [Actions.SET_VIDEO_STATUS]: (state, action: Action<{ divId: string, videoId: string, status: RenderStatus}>): RenderStoreState => {\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n videoStatus: action.payload.status\n }\n }\n }\n },\n\n [Actions.SET_INSTANCE_INDEX]: (state, action: Action<{divId: string, poseIndex: number, noseIndex: number}>): RenderStoreState => {\n if (state.instance.hasOwnProperty(action.payload.divId)\n && (action.payload.poseIndex !== state.instance[action.payload.divId].renderOptions.poseIndex\n || action.payload.noseIndex !== state.instance[action.payload.divId].renderOptions.noseIndex)) {\n return {\n ...state,\n instance: {...state.instance,\n [action.payload.divId]: {\n ...state.instance[action.payload.divId],\n renderOptions: {\n ...state.instance[action.payload.divId].renderOptions,\n poseIndex: (action.payload.poseIndex || action.payload.poseIndex === 0)\n ? action.payload.poseIndex : state.instance[action.payload.divId].renderOptions.poseIndex,\n noseIndex: (action.payload.noseIndex || action.payload.noseIndex === 0)\n ? action.payload.noseIndex : state.instance[action.payload.divId].renderOptions.noseIndex\n }\n }\n }\n };\n } else {\n return {\n ...state\n };\n }\n },\n\n [Actions.SWIPE_INSTANCE]: (state, action: Action<{divId: string}>): RenderStoreState => {\n if (state.instance.hasOwnProperty(action.payload.divId)) {\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...state.instance[action.payload.divId],\n swiped: true\n }\n }\n };\n } else {\n return { ...state };\n }\n },\n\n [Actions.ADD_GLASSES]: (state, action: Action<{\n divId: string,\n upc: string,\n }>): RenderStoreState => {\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n upcStatus: 'LOADING',\n rendererStatus: 'LOADING',\n }\n }\n };\n },\n\n [Actions.GLASSES_FALLBACK]: (state, action: Action<{\n divId: string,\n upc: string,\n resolution: AssetResolution\n }>): RenderStoreState => {\n\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [currentInstance.divId]: {\n ...currentInstance,\n upc: action.payload.upc,\n renderOptions: {\n ...currentInstance.renderOptions,\n resolution: action.payload.resolution\n }\n }\n }\n };\n },\n\n [Actions.SET_GLASSES_STATUS]: (state, action: Action<{\n divId: string,\n upc: string,\n status: RenderStatus\n }>): RenderStoreState => {\n\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n upcStatus: action.payload.status\n }\n }\n }\n },\n\n [Actions.SET_GLASSES_DATA]: (state, action: Action<{ divId: string, upc: string, glassesData: GlassesData }>): RenderStoreState => {\n\n const currentInstance = state.instance[action.payload.divId];\n GlassesCache.set(action.payload.divId, action.payload.glassesData);\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n upcStatus: 'READY'\n }\n }\n }\n },\n\n [Actions.SET_RENDERER_STATUS]: (state, action: Action<{\n divId: string,\n status: RenderStatus,\n }>): RenderStoreState => {\n\n const currentInstance = state.instance[action.payload.divId];\n\n return {\n ...state,\n instance: {\n ...state.instance,\n [action.payload.divId]: {\n ...currentInstance,\n rendererStatus: action.payload.status\n }\n }\n }\n },\n\n}, initialState);\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport * as ReactDOM from 'react-dom';\nimport { Store } from 'redux';\nimport { name, version } from '../../package.json';\nimport { GlassesCache } from '../app/render/cache/GlassesCache';\nimport { VideoCache } from '../app/render/cache/VideoCache';\nimport { InvalidParametersError, UnknownError, UnmountComponentError, VtoError } from '../constants/errors';\nimport { isString } from '../helpers/ParameterHelper';\nimport { VtoInstanceContainer } from '../helpers/VtoInstanceContainer';\nimport { CloseRenderOptions } from '../interfaces/CloseRenderOptions';\nimport { RootState } from '../reducers/combinedReducers';\nimport { RenderActions } from '../reducers/renderReducer';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'CloseRenderFunction');\n\nconst validateCloseRenderOptions = (options: CloseRenderOptions) => {\n if (!options.divId || !isString(options.divId)) {\n throw new InvalidParametersError('divId');\n }\n};\n\nconst CloseRenderFunction = (\n store: Store,\n options: CloseRenderOptions,\n onSuccess: () => void,\n onError: (error: VtoError) => void,\n): void => {\n logger.debug('closing vto with divId={}', options?.divId);\n\n try {\n validateCloseRenderOptions(options);\n } catch (error: unknown) {\n if (error instanceof VtoError) {\n onError(error);\n } else if (error instanceof Error){\n onError(new UnknownError(error));\n }\n return;\n }\n\n try {\n const instance: VtoInstance = VtoInstanceContainer.instance.getVtoInstance(options.divId);\n const container = document.getElementById(instance.id);\n if (container) {\n if (ReactDOM.unmountComponentAtNode(container)) {\n logger.debug('closed vto with divId={}', options?.divId);\n onSuccess();\n VideoCache.delete(options.divId);\n GlassesCache.delete(options.divId);\n store.dispatch(RenderActions.deleteInstance({ divId: options.divId }));\n } else {\n onError(new UnmountComponentError(options?.divId));\n }\n }\n if (instance.glRender) {\n instance.glRender.destroy();\n instance.glRender = undefined;\n }\n VtoInstanceContainer.instance.removeInstance(instance.id);\n } catch (error) {\n onError(new UnmountComponentError(options.divId));\n }\n}\n\nexport {\n CloseRenderFunction\n};\n","import { VtoCallbacks } from '../interfaces/InitializeOptions';\n\nconst setCallbacks = (\n callbacks: Partial\n) => {\n if (callbacks) {\n if (callbacks.onTransitionAnimation) { CallbackHelper.onTransitionAnimation = callbacks.onTransitionAnimation; }\n if (callbacks.onTransitionAnimationEnd) { CallbackHelper.onTransitionAnimationEnd = callbacks.onTransitionAnimationEnd; }\n }\n};\n\nconst setRenderSuccessCallback = (\n callback: () => void\n) => {\n if (!!callback) {\n CallbackHelper.onRenderSuccess = callback;\n }\n};\n\nconst setRenderErrorCallback = (\n callback: (error) => void\n) => {\n if (!!callback) {\n CallbackHelper.onRenderError = callback;\n }\n};\n\nconst CallbackHelper = {\n onRenderSuccess: () => { return; },\n onRenderError: (error) => { return; },\n onTransitionAnimation: (opacityValue: number) => { return; },\n onTransitionAnimationEnd: (opacityValue: number) => { return; },\n};\n\nexport { CallbackHelper, setCallbacks, setRenderSuccessCallback, setRenderErrorCallback };\n","const acceptanceConfig = {\n vtoCoreEnvironment: 'acceptance',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'ACCEPTANCE',\n publicHost: 'https://d4dq1eaizwz84.cloudfront.net',\n gaTrackingId: 'UA-84556257-4',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = acceptanceConfig;","const developmentConfig = {\n vtoCoreEnvironment: 'development',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'STAGING',\n publicHost: 'http://localhost:3000',\n gaTrackingId: 'UA-84556257-4',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = developmentConfig;","const developmentLocalServerConfig = {\n vtoCoreEnvironment: 'development-localserver',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'LOCAL',\n publicHost: 'http://localhost:3000',\n gaTrackingId: 'UA-84556257-4',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = developmentLocalServerConfig;","const integrationConfig = {\n vtoCoreEnvironment: 'integration',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'INTEGRATION',\n publicHost: 'https://d4dq1eaizwz84.cloudfront.net',\n gaTrackingId: 'UA-84556257-4',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = integrationConfig;","const productionConfig = {\n vtoCoreEnvironment: 'production',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'PRODUCTION',\n publicHost: 'https://d4dq1eaizwz84.cloudfront.net',\n gaTrackingId: 'UA-84556257-5',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = productionConfig;","const stagingConfig = {\n vtoCoreEnvironment: 'staging',\n vtoGlassesEnvironment: 'PROD',\n vtoServerEnvironment: 'STAGING',\n publicHost: 'https://s3.amazonaws.com/vto-core',\n gaTrackingId: 'UA-84556257-4',\n trackerName: 'VTO_CORE_TRACKER'\n}\n\nmodule.exports = stagingConfig;","import { Action, createAction, handleActions } from 'redux-actions';\nimport * as Actions from '../constants/actions';\nimport * as productionConfig from '../../src/config/production';\nimport { AnalyticsConfig } from '../interfaces/AnalyticsConfig';\n\nconst initialState: AppStoreState = {\n config: {\n ...productionConfig,\n vtoCoreEnvironment: productionConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: productionConfig.vtoServerEnvironment as VtoServerEnvironment\n },\n analyticsConfig: {},\n};\n\nexport const AppActions = {\n setConfig: createAction(Actions.SET_CONFIG),\n setAnalyticsConfig: createAction(Actions.SET_ANALYTICS_CONFIG),\n};\n\nexport const AppReducer = handleActions({\n\n [Actions.SET_CONFIG]: (state, action: Action): AppStoreState => {\n return (action.payload) ? {\n ...state,\n config: {\n ...action.payload,\n }\n } : {\n ...state\n }\n },\n\n [Actions.SET_ANALYTICS_CONFIG]: (state, action: Action): AppStoreState => {\n return (action.payload) ? {\n ...state,\n analyticsConfig: (action.payload) ? action.payload : {}\n } : {\n ...state\n }\n },\n\n}, initialState);\n","import { AssetLoader } from '@luxottica/vm-renderer-threejs';\nimport { Catalog, AssetResolution, GlassesDownloader, GlassesEnvironment, UpcAvailability } from '@luxottica/vm-glasses';\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'GlassesHelper');\n\nconst glassesDownloader = new GlassesDownloader();\nconst assetLoader = new AssetLoader();\n\nconst glassesPromise = (\n upc: string,\n resolution: AssetResolution,\n glassesEnvironment: GlassesEnvironment,\n singleTexture?: number\n): Promise => {\n const b3dparams = { upc: upc, resolution: resolution, glassesEnvironment: glassesEnvironment, lensMap: true, singleTexture: singleTexture};\n return Catalog.getUpcAvailability({env: glassesEnvironment}, upc).then((upcAvailability: UpcAvailability)=> {\n if(upcAvailability.glassesType == 'GLTF') {\n return glassesDownloader.downloadGltfGlasses({upc, glassesEnvironment}).then((gltfPointer)=>{\n return assetLoader.loadGltfAsset(gltfPointer).then((glasses: GltfAsset)=>{\n return { asset: glasses, accessTime: Date.now(), environment: glassesEnvironment, resolution };\n });\n });\n } else {\n return glassesDownloader.downloadGlasses(b3dparams)\n .catch((error)=>{\n b3dparams.lensMap = false;\n return glassesDownloader.downloadGlasses(b3dparams);\n }).then((glasses) => {\n logger.debug(`download succeeded for upc ${upc}`);\n return {\n asset: glasses,\n accessTime: Date.now(),\n environment: glassesEnvironment\n };\n }).catch((error) => {\n logger.error(error);\n throw error;\n });\n }\n });\n};\n\nexport const GlassesHelper = {\n\n getUpcKey: (upc: string, resolution: AssetResolution, environment: GlassesEnvironment, singlePose: boolean, poseIndex: number) => {\n return `${upc}_${resolution}_${environment}${singlePose ? `_${poseIndex}` : ''}`;\n },\n\n isUpcSupported: (\n upc: string\n ): Promise => {\n return Catalog.getUpcAvailability({ env: GlassesEnvironment.PROD },upc)\n .then((upcAvailability) => {\n if(upcAvailability.glassesType === 'B3D')\n return upcAvailability.available[256] || upcAvailability.available[512]\n else if (upcAvailability.glassesType === 'GLTF')\n return upcAvailability.lods.length > 0;\n \n return false;\n });\n },\n\n downloadGlasses: (\n upc: string,\n resolution: AssetResolution,\n glassesEnvironment: GlassesEnvironment,\n singleTexture?: number\n ): Promise => {\n \n if (upc) {\n return new Promise((resolve, reject) => {\n glassesPromise(upc, resolution, glassesEnvironment, singleTexture).then((glasses) => {\n resolve(glasses);\n }).catch((e) => {\n logger.error(`failed to download ${resolution} res glasses for upc ${upc}`, e);\n reject(e);\n });\n });\n } else {\n return Promise.reject('upc is undefined');\n }\n }\n};\n","\nimport { VtoServerClient } from '@luxottica/vm-vtoserver-client';\nimport {\n UpcSupportedError\n} from './constants/errors';\nimport { GlassesHelper } from './helpers/GlassesHelper';\n\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'VtoApi');\n\nconst VtoApi = {\n setEnvironment(environment: VtoServerEnvironment): void {\n VtoServerClient.setEnvironment(environment);\n },\n\n getUpc(upc: string): Promise {\n return GlassesHelper.isUpcSupported(upc).catch(() => {\n throw new UpcSupportedError(upc);\n });\n },\n\n getVideoData(\n videoId: string,\n singlePose?: number, \n ): Promise {\n return VtoServerClient.getVideo(videoId, singlePose);\n }\n};\n\nexport { VtoApi };\n","import { Store } from 'redux';\nimport * as acceptanceConfig from '../config/acceptance';\nimport * as developmentConfig from '../config/development';\nimport * as developmentLocalServerConfig from '../config/development-localserver';\nimport * as integrationConfig from '../config/integration';\nimport * as productionConfig from '../config/production';\nimport * as stagingConfig from '../config/staging';\nimport { InvalidEnvironmentError } from '../constants/errors';\nimport { VtoCoreEnvironment } from '../interfaces/VtoCoreEnvironment';\nimport { AppActions } from '../reducers/appReducer';\nimport { RootState } from '../reducers/combinedReducers';\nimport { VtoApi } from '../VtoApi';\n\nconst setEnvironment = (environment: VtoCoreEnvironment, store: Store): void => {\n let config: Config;\n switch (environment) {\n case 'development':\n config = {\n ...developmentConfig,\n vtoCoreEnvironment: developmentConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: developmentConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n case 'development-localserver':\n config = {\n ...developmentLocalServerConfig,\n vtoCoreEnvironment: developmentLocalServerConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: developmentLocalServerConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n case 'staging':\n config = {\n ...stagingConfig,\n vtoCoreEnvironment: stagingConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: stagingConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n case 'integration':\n config = {\n ...integrationConfig,\n vtoCoreEnvironment: integrationConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: integrationConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n case 'acceptance':\n config = {\n ...acceptanceConfig,\n vtoCoreEnvironment: acceptanceConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: acceptanceConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n case 'production':\n config = {\n ...productionConfig,\n vtoCoreEnvironment: productionConfig.vtoCoreEnvironment as VtoCoreEnvironment,\n vtoServerEnvironment: productionConfig.vtoServerEnvironment as VtoServerEnvironment\n };\n break;\n default:\n throw new InvalidEnvironmentError(environment);\n }\n VtoApi.setEnvironment(config.vtoServerEnvironment);\n store.dispatch(AppActions.setConfig(config));\n};\n\nexport { setEnvironment };\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'LocalizationHelper');\n\nexport class LocalizationHelper {\n\n private static baseUrl = 'https://d5nhc6q3o19l2.cloudfront.net';\n private static translationType = 'CORE';\n private static localeMap = {\n de: 'de-DE',\n en: 'en-US',\n es: 'es-ES',\n fr: 'fr-FR',\n it: 'it-IT',\n ja: 'ja-JP',\n ko: 'ko-KR',\n nl: 'nl-NL',\n pl: 'pl-PL',\n pt: 'pt-PT',\n sv: 'sv-SE',\n tr: 'tr-TR',\n zh: 'zh-CN'\n };\n\n private static defaultTranslations = {\n CORE: {\n PERMISSION_ERROR: {\n ERROR: 'You must allow access to your camera to create a Virtual Model.',\n SUBTEXT: 'Click the Share or Allow button above to enable your webcam.'\n },\n WEBCAM_ERROR: {\n ERROR: 'We could not detect your webcam.',\n SUBTEXT: 'Enable webcam access in your browser and refresh the page to continue.'\n },\n RENDER_VTO: {\n CLICK_AND_MOVE: 'Click and move left and right',\n ROTATE: 'Click and drag to rotate',\n SLIDE_DESKTOP: 'Drag the pointer along the nose to adjust the frames',\n SLIDE_TWO_FINGERS: 'Use two fingers to adjust on the nose',\n SWIPE_TWO_FINGERS: 'Use one finger to swipe left and right'\n },\n RENDER_ERROR: {\n TITLE_1: 'Oops',\n TITLE_2: 'We couldn\\'t retrieve your Virtual Model.',\n TITLE_3: 'Please try again later.'\n },\n UPC_MISSING: {\n TITLE: 'Virtual Model Coming Soon For This Option'\n }\n }\n };\n\n private static localizedTranslations;\n\n private static fetchLocalization = (\n environment: VtoCoreEnvironment,\n locale: string\n ): Promise<{\n [key: string]: string\n }> => {\n\n let textEnv;\n switch (environment) {\n case 'development':\n case 'development-localserver':\n textEnv = 'dev';\n break;\n case 'staging':\n case 'integration':\n case 'acceptance':\n textEnv = 'test';\n break;\n case 'production':\n textEnv = 'prod';\n break;\n default:\n break;\n }\n\n return fetch(`${LocalizationHelper.baseUrl}/vto/v1/${textEnv}/ui/application_${locale}.json`)\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n throw Error(`failed to find localization for locale: ${locale}`);\n }\n }).then((json) => {\n return json;\n });\n }\n\n private static localizationPromise = (\n environment: VtoCoreEnvironment,\n locale: string\n ) => {\n let language = locale.split('-')[0];\n if (!LocalizationHelper.localeMap[language]) {\n logger.error('Unknown language, falling back to english');\n language = 'en';\n locale = 'en-US';\n }\n return new Promise((resolve) => {\n let translationFound = false;\n LocalizationHelper.fetchLocalization(environment, locale)\n .then((translation) => {\n translationFound = true;\n resolve(translation);\n }).catch(() => {\n logger.error(`failed to find localization for locale: ${locale}`);\n }).then(() => {\n if (!translationFound) {\n return LocalizationHelper.fetchLocalization(environment, LocalizationHelper.localeMap[language]);\n } else {\n throw Error('break');\n }\n }).then((fallbackTranslation) => {\n translationFound = true;\n resolve(fallbackTranslation);\n }).catch(() => {\n if (!translationFound) {\n logger.error(`failed to find localization for locale: ${LocalizationHelper.localeMap[language]}`);\n }\n }).then(() => {\n if (!translationFound) {\n return LocalizationHelper.fetchLocalization(environment, 'en-US');\n } else {\n throw Error('break');\n }\n }).then((englishTranslation) => {\n translationFound = true;\n resolve(englishTranslation);\n }).catch(() => {\n if (!translationFound) {\n logger.error('failed to find localization for locale: en-US');\n }\n }).then(() => {\n if (!translationFound) {\n resolve(LocalizationHelper.defaultTranslations);\n }\n });\n });\n }\n\n static initialize(\n environment: VtoCoreEnvironment,\n locale: string\n ) {\n return this.localizationPromise(environment, locale).then((localTranslations) => {\n this.localizedTranslations = localTranslations;\n });\n }\n\n static getString(\n page: string,\n key: string\n ): string {\n let text = '';\n\n try {\n text = this.localizedTranslations[this.translationType][page][key];\n } catch (e) {\n logger.warn(`local translation not found for [${this.translationType}][${page}][${key}]`);\n try {\n text = this.defaultTranslations[this.translationType][page][key];\n } catch (e) {\n logger.warn(`default translation not found for [${this.translationType}][${page}][${key}]`);\n }\n }\n\n return text;\n }\n}","import { AnalyticsConfig } from './AnalyticsConfig';\nimport { VtoCoreEnvironment } from './VtoCoreEnvironment';\n\ninterface VtoCallbacks {\n onTransitionAnimation?: (opacityValue: number) => void;\n onTransitionAnimationEnd?: (opacityValue: number) => void;\n}\ninterface InitializeOptions {\n environment: VtoCoreEnvironment,\n locale: string,\n brand: string,\n storeId: string,\n videoCacheLimit?: number,\n glassesCacheLimit?: number\n analyticsConfig?: AnalyticsConfig,\n callbacks?: VtoCallbacks,\n}\n\nconst defaultInitializeOptions: Partial = {\n locale: 'en-US',\n brand: 'undefined',\n storeId: undefined,\n videoCacheLimit: 500,\n glassesCacheLimit: 500,\n analyticsConfig: {},\n}\n\nexport {\n InitializeOptions,\n defaultInitializeOptions,\n VtoCallbacks\n}","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { GlUtils } from '@luxottica/vm-renderer-threejs';\nimport { Store } from 'redux';\nimport { name, version } from '../../package.json';\nimport { InitializationError, InvalidParametersError, VtoError } from '../constants/errors';\nimport { setCallbacks } from '../helpers/CallbackHelper';\nimport { setEnvironment } from '../helpers/EnvironmentHelper';\nimport { LocalizationHelper } from '../helpers/LocalizationHelper';\nimport { isNumber, isObject, isString, mergeDeep } from '../helpers/ParameterHelper';\nimport { defaultInitializeOptions, InitializeOptions } from '../interfaces/InitializeOptions';\nimport { isVtoCoreEnvironment } from '../interfaces/VtoCoreEnvironment';\nimport { AppActions } from '../reducers/appReducer';\nimport { RootState } from '../reducers/combinedReducers';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'InitializeFunction');\n\nconst validateInitializeOptions = (options: InitializeOptions) => {\n if (options.environment && !isVtoCoreEnvironment(options.environment)) {\n throw new InvalidParametersError('environment');\n }\n if (options.locale && !isString(options.locale)) {\n throw new InvalidParametersError('locale');\n }\n if (options.brand && !isString(options.brand)) {\n throw new InvalidParametersError('brand');\n }\n if (options.storeId && !isString(options.storeId)) {\n throw new InvalidParametersError('storeId');\n }\n if (options.videoCacheLimit !== undefined\n && (!isNumber(options.videoCacheLimit) || options.videoCacheLimit < 1)) {\n throw new InvalidParametersError('videoCacheLimit');\n }\n if (options.glassesCacheLimit !== undefined\n && (!isNumber(options.glassesCacheLimit) || options.glassesCacheLimit < 1)) {\n throw new InvalidParametersError('videoCacheLimit');\n }\n if (options.analyticsConfig && !isObject(options.analyticsConfig)) {\n throw new InvalidParametersError('analyticsConfig');\n }\n};\n\nconst InitializeFunction = (\n store: Store,\n options: InitializeOptions,\n onSuccess: (supportedFeatures: {\n webglRendering: boolean\n }) => void,\n onError: (error: VtoError) => void,\n): void => {\n logger.debug('initializing vto');\n\n let mergedOptions: Required;\n try {\n validateInitializeOptions(options);\n mergedOptions = mergeDeep(defaultInitializeOptions, options);\n\n if (mergedOptions.environment !== store.getState().app.config.vtoCoreEnvironment) {\n setEnvironment(mergedOptions.environment, store);\n }\n\n setCallbacks(options.callbacks);\n store.dispatch(AppActions.setAnalyticsConfig(mergedOptions.analyticsConfig));\n } catch (error: unknown) {\n if (error instanceof VtoError) {\n onError(error);\n } else {\n onError(new InitializationError());\n }\n return;\n }\n\n LocalizationHelper.initialize(\n mergedOptions.environment,\n mergedOptions.locale\n ).then(() => {\n\n const supportedFeatures = {\n webglRendering: GlUtils.supportsRendering()\n };\n\n \n\n onSuccess(supportedFeatures);\n\n }).catch((error: VtoError) => {\n onError(error);\n });\n}\n\nexport {\n InitializeFunction\n};\n","declare type VtoCoreEnvironment = 'development' | 'development-localserver' | 'staging' | 'integration' | 'acceptance' | 'production';\n\nconst isVtoCoreEnvironment = (env: string): env is VtoCoreEnvironment => {\n return [\n 'development',\n 'development-localserver',\n 'staging',\n 'integration',\n 'acceptance',\n 'production'\n ].includes(env);\n}\n\nexport { VtoCoreEnvironment, isVtoCoreEnvironment }","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\nimport { InvalidParametersError, UpcSupportedError, VtoError } from '../constants/errors';\nimport { isString } from '../helpers/ParameterHelper';\nimport { IsUpcSupportedOptions } from '../interfaces/IsUpcSupportedOptions';\nimport { VtoApi } from '../VtoApi';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'IsUpcSupportedFunction');\n\nconst validateIsUpcSupportedOptions = (options: IsUpcSupportedOptions) => {\n if (!options.upc || !isString(options.upc)) {\n throw new InvalidParametersError('upc');\n }\n};\n\nconst IsUpcSupportedFunction = (\n options: IsUpcSupportedOptions,\n onSuccess: (supported: boolean) => void,\n onError: (error: VtoError) => void,\n): void => {\n logger.debug('checking if upc is supported with upc={}', options.upc);\n\n try {\n validateIsUpcSupportedOptions(options);\n } catch (error: unknown) {\n if (error instanceof VtoError) {\n onError(error);\n } else {\n onError(new UpcSupportedError(options.upc));\n }\n return;\n }\n\n VtoApi.getUpc(options.upc).then((supported: boolean) => {\n logger.debug('upc catalog has responded with upc={}, isSupported={}', options.upc, supported);\n onSuccess(supported);\n }).catch((error: VtoError) => {\n onError(error);\n });\n}\n\nexport {\n IsUpcSupportedFunction\n};\n","import * as React from 'react';\nimport './LoadingSpinner.scss';\n\nexport interface LoadingSpinnerProps {\n showPercentage: boolean;\n width: number;\n height: number;\n percentage?: number;\n}\nexport interface LoadingSpinnerState {\n size: number;\n}\n\nexport class LoadingSpinner extends React.Component<\n LoadingSpinnerProps,\n LoadingSpinnerState\n> {\n\n constructor(props: LoadingSpinnerProps) {\n super(props);\n this.state = {\n size: (props.width <= props.height) ? props.width : props.height\n };\n }\n\n render() {\n const size = (this.props.width <= this.props.height)\n ? this.props.width : this.props.height;\n return (\n
\n
\n
\n
\n
\n );\n }\n}\n","import { Catalog, CatalogConfiguration, GlassesEnvironment } from '@luxottica/vm-glasses';\nimport { CallbackHelper } from './CallbackHelper';\n\nconst transitionLensMap: TransitionLenses = {};\nlet transitionOpacity = 0.0;\nlet transitionLensName;\nlet finalOpacity: number;\n\nlet animationEnabled = false;\nlet animateForward = false;\nlet animationStartTime: number;\nlet animationDuration: number;\n\nconst computePartialAnimation = (\n forward: boolean,\n duration: number,\n currentOpacity: number\n): number => {\n return forward ?\n Date.now() - (duration * currentOpacity)\n :\n Date.now() - (duration * (1 - currentOpacity));\n};\n\n// cache previous results\nconst downloadTransitionsPromise: {\n [K in GlassesEnvironment]?: ReturnType<(typeof Catalog)['downloadTransitionLenses']>\n} = {};\n\nconst TransitionColorHelper = {\n downloadTransitionColors: (config: CatalogConfiguration): Promise<{\n [name: string]: TransitionLens;\n} | void> => {\n // silently block transitions feature on unauthorised keys\n /* if (!FeatureLicensingService.isFeatureAuthorized(Features.VM_TRANSITIONS)) {\n transitionLensMap = {};\n return Promise.resolve();\n } */\n\n // cache previous results\n const downloadPromise = downloadTransitionsPromise[config.env] || Catalog.downloadTransitionLenses(config);\n downloadTransitionsPromise[config.env] = downloadPromise;\n \n // map colors for internal use\n return downloadPromise.then((colorMap) => {\n Object.keys(colorMap).map((colorName) => {\n transitionLensMap[colorName] = colorMap[colorName];\n });\n return colorMap;\n });\n },\n\n setTransitionOverrideColor: (color: TransitionLens) => {\n transitionLensMap.OVERRIDE = color;\n },\n\n reset: () => {\n animationEnabled = false;\n finalOpacity = undefined;\n },\n\n startAnimation: (duration: number) => {\n if (!animationEnabled) {\n animationEnabled = true;\n animationDuration = duration;\n animateForward = transitionOpacity < 0.5;\n animationStartTime = (transitionOpacity % 1 === 0) ?\n Date.now() : computePartialAnimation(animateForward, animationDuration, transitionOpacity);\n finalOpacity = undefined;\n }\n },\n\n getTransitionLens: (lensName: string): TransitionLens => {\n return transitionLensMap?.[lensName];\n },\n\n getCurrentTransitionLens: (): TransitionLens => {\n return transitionLensMap?.[transitionLensName];\n },\n\n setCurrentTransitionLens(lensName: string){\n transitionLensName = lensName;\n },\n\n setCurrentTransitionLensName(): string {\n return transitionLensName;\n },\n\n setCurrentLensOpacity: (inputOpacity: number): void => {\n TransitionColorHelper.reset();\n transitionOpacity = inputOpacity;\n },\n\n getCurrentLensOpacity: (): number => {\n if (finalOpacity !== undefined || !animationEnabled) {\n return transitionOpacity;\n\n } else {\n let animationProgress = (Date.now() - animationStartTime) / animationDuration;\n if (animationProgress >= 1.0) {\n animationProgress = 1.0;\n animationEnabled = false;\n }\n transitionOpacity = (animateForward) ? animationProgress : (1.0 - animationProgress);\n if (animationProgress === 1.0) {\n finalOpacity = transitionOpacity;\n CallbackHelper.onTransitionAnimationEnd(finalOpacity);\n }\n\n CallbackHelper.onTransitionAnimation(transitionOpacity);\n return transitionOpacity;\n }\n }\n};\n\nexport { TransitionColorHelper };\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'DownloadHelper');\n\nexport default class DownloadHelper {\n static download(url): Promise {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then((response: Response) => {\n if (response.ok) {\n resolve(response.blob());\n } else {\n reject('Download Error');\n }\n });\n });\n }\n\n static detectPupils(\n centerImage: Blob\n ): Promise {\n\n const form = new FormData();\n form.append('myFile', centerImage, 'myFile');\n return fetch('https://pupil-detector.luxdeepblue.com/process', {\n method: 'POST',\n body: form\n }).then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n return Promise.reject();\n }\n }).then((json) => {\n return {\n face: json.v2.face,\n image: json.v2.image,\n iris: json.v2.iris,\n imagePupils: {\n ...json.v2.pupils,\n detected: (json?.v2?.pupils?.detected === 'true') ? true : false\n }\n };\n }).catch((e) => {\n logger.error(e);\n throw new Error('failed to detect pupils');\n });\n\n }\n}","import * as React from 'react';\n\nexport class RotateIcon extends React.PureComponent {\n\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n","import * as React from 'react';\n\ninterface PupilOverlayProps {\n faceData: VideoFaceData;\n}\n\nexport class PupilOverlay extends React.PureComponent<\n PupilOverlayProps\n> {\n shouldRender(): boolean {\n return (this.props.faceData?.pupils?.left !== undefined\n && this.props.faceData?.pupils?.right !== undefined);\n }\n\n render() {\n return (this.shouldRender()) ? (\n <>\n
\n
\n \n ) : null;\n }\n}\n","export const OverlayHelper = {\n imageToRenderCoordinates: (\n position: {x: number, y: number},\n inputImageSize: {width: number, height: number},\n cropOffset: {x: number, y: number},\n screenSpaceRatio: {width: number, height: number},\n outputSize: {width: number, height: number},\n ): Point => {\n return {\n x: (position.x - (cropOffset.x * inputImageSize.width)) * (outputSize.width / inputImageSize.width) * (1 / screenSpaceRatio.width),\n y: (position.y - (cropOffset.y * inputImageSize.height)) * (outputSize.height / inputImageSize.height) * (1 / screenSpaceRatio.height),\n };\n }\n};","import * as React from 'react';\nimport { OverlayHelper } from '../../../helpers/OverlayHelper';\n\ninterface PupilImageOverlayProps {\n poseIndex: number;\n faceData: VideoFaceData;\n cropOffset: {x: number, y: number};\n screenSpaceRatio: {width: number, height: number};\n canvasSize: {width: number, height: number};\n}\n\nexport class PupilImageOverlay extends React.PureComponent<\n PupilImageOverlayProps\n> {\n\n shouldRender(): boolean {\n return (this.props.faceData !== undefined\n && this.props.faceData.imagePupils?.detected\n && this.props.cropOffset !== undefined\n && this.props.poseIndex === 7);\n }\n\n convertCoordinates(inputPosition: {x: number, y: number}): Point {\n return OverlayHelper.imageToRenderCoordinates(\n {x: inputPosition.x, y: inputPosition.y},\n {width: this.props.faceData.image.width, height: this.props.faceData.image.height},\n {x: this.props.cropOffset.x, y: this.props.cropOffset.y},\n {width: this.props.screenSpaceRatio.width, height: this.props.screenSpaceRatio.height},\n {width: this.props.canvasSize.width, height: this.props.canvasSize.height},\n );\n }\n\n render() {\n if (this.shouldRender()) {\n const leftPupil = this.convertCoordinates(this.props.faceData.imagePupils.left);\n const rightPupil = this.convertCoordinates(this.props.faceData.imagePupils.right);\n return (<>\n
\n
\n );\n } else {\n return null;\n }\n }\n}\n","import * as React from 'react';\n\ninterface MeshCenterProps {\n meshCenter: Point;\n}\n\nexport class MeshCenterOverlay extends React.PureComponent<\n MeshCenterProps\n> {\n shouldRender(): boolean {\n return (this.props.meshCenter !== undefined);\n }\n\n render() {\n return (this.shouldRender()) ? (\n <>\n
\n \n ) : null;\n }\n}\n","import * as React from 'react';\nimport './RenderDebugOverlay.scss';\nimport { PupilOverlay } from './PupilOverlay';\nimport { PupilImageOverlay } from './PupilImageOverlay';\nimport { MeshCenterOverlay } from './MeshCenterOverlay';\nimport { RenderDebugOptions } from '../../../interfaces/RenderOptions';\n\ninterface RenderDebugOverlayProps {\n debugOptions: RenderDebugOptions;\n width: number;\n height: number;\n videoData: VideoData;\n poseIndex: number;\n}\n\nexport class RenderDebugOverlay extends React.PureComponent<\n RenderDebugOverlayProps\n> {\n\n render() {\n return (\n
\n {(this.props.debugOptions.showMeshCenter)\n && }\n {(this.props.debugOptions.showPupils)\n && }\n {(this.props.debugOptions.showImagePupils)\n && }\n
\n );\n }\n}\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { ThreeRender } from '@luxottica/vm-renderer-threejs';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { name, version } from '../../../package.json';\nimport { TransitionColorHelper } from '../../helpers/TransitionColorHelper';\nimport { VtoInstanceContainer } from '../../helpers/VtoInstanceContainer';\nimport { RootState } from '../../reducers/combinedReducers';\nimport { RenderActions } from '../../reducers/renderReducer';\nimport { GlassesCache } from './cache/GlassesCache';\nimport { VideoCache } from './cache/VideoCache';\nimport { RenderDebugOverlay } from './debug/RenderDebugOverlay';\nimport { setActiveCanvas, disposeScreenshot } from '../../functions/GetScreenshot';\nimport './RenderCanvas.scss';\nimport { CallbackHelper } from '../../helpers/CallbackHelper';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'RenderCanvas');\n\ninterface RenderCanvasProps {\n actions?: typeof RenderActions;\n divId: string;\n renderKey?: number;\n video?: VideoData;\n videoStatus?: RenderStatus;\n glasses?: GlassesData;\n glassesStatus?: RenderStatus;\n instance?: InstanceData;\n}\n\nclass RenderCanvas extends React.Component<\n RenderCanvasProps\n> {\n\n vtoRenderer: ThreeRender;\n canvas: React.RefObject;\n previouslyRenderedKey = -1;\n\n constructor(props: RenderCanvasProps) {\n super(props);\n this.canvas = React.createRef();\n props.actions.setRendererStatus({\n divId: props.divId,\n status: 'LOADING',\n });\n }\n\n componentDidMount() {\n setActiveCanvas(this.canvas.current);\n this.vtoRenderer = new ThreeRender(\n this.canvas.current,\n {\n debugOptions: this.props.instance.renderOptions.debugOptions,\n mirror: false,\n }\n );\n VtoInstanceContainer.instance.addRender({\n id: this.props.divId,\n render: this.vtoRenderer,\n });\n\n this.renderCanvas();\n }\n\n componentWillUnmount() {\n disposeScreenshot();\n this.vtoRenderer.destroy();\n this.vtoRenderer = null;\n }\n\n componentDidUpdate(prevProps: RenderCanvasProps) {\n this.renderCanvas(prevProps);\n }\n\n renderCanvas(prevProps?: RenderCanvasProps): void {\n\n // check if the couple UPC+VideoID is being drawn for the first time\n const sendRenderEvent = (this.props.divId !== prevProps?.divId\n || this.props.glasses?.asset.upc !== prevProps?.glasses?.asset.upc\n || this.props.glasses?.resolution !== prevProps?.glasses?.resolution\n || this.props.video?.videoId !== prevProps?.video?.videoId);\n\n const shouldRender = (this.props.videoStatus === 'READY'\n && this.props.glassesStatus === 'READY'\n && (this.props.renderKey !== this.previouslyRenderedKey\n || this.props.instance.renderOptions.poseIndex !== prevProps.instance.renderOptions.poseIndex\n || this.props.instance.renderOptions.noseIndex !== prevProps.instance.renderOptions.noseIndex)\n );\n\n if (shouldRender) {\n this.previouslyRenderedKey = this.props.renderKey;\n this.renderGlasses(sendRenderEvent);\n }\n }\n\n renderGlasses(sendRenderEvent: boolean): Promise {\n\n const instance = this.props.instance;\n const video = this.props.video;\n const glasses = this.props.glasses;\n const renderOptions = instance.renderOptions;\n\n const selectedPd = (instance.pupillaryDistance) ? instance.pupillaryDistance : video.pupillaryDistance;\n\n this.vtoRenderer.updateOptions({\n debugOptions: renderOptions.debugOptions\n });\n\n // scaling is enabled if declared from JS or if the incoming video got a pupillary distance\n const enableScaling = renderOptions.debugOptions.enableScaling || video.pupillaryDistance !== undefined;\n\n // JS pupillary distance win over video pupillary distance when enabled\n // TODO: I dont understand this at all??\n let pupillaryDistance = video.pupillaryDistance;\n if (pupillaryDistance !== undefined && renderOptions.debugOptions.enableScaling) {\n pupillaryDistance = instance.pupillaryDistance;\n }\n\n return TransitionColorHelper.downloadTransitionColors({\n env: glasses.environment\n }).then(()=>{\n return this.vtoRenderer.renderVto(\n glasses.asset,\n {\n ...video,\n pupillaryDistance,\n renderFov: undefined\n },\n enableScaling,\n renderOptions.poseIndex,\n renderOptions.noseIndex,\n undefined,\n undefined,\n renderOptions.offsetY,\n renderOptions.offsetZ,\n TransitionColorHelper.getCurrentTransitionLens(),\n TransitionColorHelper.getCurrentLensOpacity()\n );\n }).then(() => {\n\n // first success draw for videoId+UPC couple\n if (sendRenderEvent) { \n this.props.actions.setRendererStatus({\n divId: this.props.divId,\n status: 'READY',\n });\n }\n \n CallbackHelper.onRenderSuccess();\n\n }).catch((e) => {\n this.props.actions.setRendererStatus({\n divId: this.props.divId,\n status: 'ERROR',\n });\n logger.error(e);\n CallbackHelper.onRenderError(e);\n });\n }\n\n private showDebugOverlay(): boolean {\n return (this.props.instance.renderOptions.debugOptions !== undefined\n && this.props.video !== undefined);\n }\n\n render() {\n return (\n <>\n \n {(this.showDebugOverlay()) &&\n \n }\n \n );\n }\n}\n\nfunction mapStateToProps(state: RootState, ownProps: RenderCanvasProps) {\n const instance = state.render.instance[ownProps.divId];\n return {\n instance: instance,\n renderKey: instance.renderKey,\n video: VideoCache.get(instance.divId),\n videoStatus: instance.videoStatus,\n glasses: GlassesCache.get(instance.divId),\n glassesStatus: instance.upcStatus\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n ...RenderActions\n }, dispatch)\n };\n}\n\n// Terrible fix, this cast to any permits to update typescript without breaking project's react/redux\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default connect(mapStateToProps, mapDispatchToProps)(RenderCanvas) as any;\n","export class MathHelper {\n\n public static clamp(\n num: number,\n min: number,\n max: number\n ): number {\n return num <= min ? min : num >= max ? max : num;\n }\n}\n","import React from 'react';\n\nconst DoubleFingerIcon = () => {\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport {\n DoubleFingerIcon\n};\n","import * as Hammer from 'hammerjs';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { LocalizationHelper } from '../../helpers/LocalizationHelper';\nimport { MathHelper } from '../../helpers/MathHelper';\nimport { DoubleFingerIcon } from '../../icons/DoubleFingerIcon';\nimport { RenderActions } from '../../reducers/renderReducer';\nimport './SwipeableContainer.scss';\n\ninterface SwipeableContainerProps {\n actions?: typeof RenderActions;\n children?: any;\n enabled: boolean;\n instance: InstanceData;\n poseIndex: number;\n noseIndex: number;\n enableNosePosition: boolean;\n touches: number;\n width: number;\n height: number;\n upc: string;\n}\n\ninterface SwipeableContainerState {\n poseIndex: number;\n noseIndex: number;\n overlay: boolean;\n}\n\nclass SwipeableContainer extends React.Component<\n SwipeableContainerProps,\n SwipeableContainerState\n> {\n\n private firstTouch = true;\n private hammerManagerOverlay: HammerManager;\n private hammerManagerPose: HammerManager;\n private hammerManagerNose: HammerManager;\n private containerRef: React.RefObject;\n\n private readonly indexCount = 14;\n private readonly swipeSpeedModifier = 0.04;\n private readonly indexInterval = Math.round(this.props.height * this.swipeSpeedModifier);\n\n private readonly noseIndexCount = 20;\n private readonly noseSwipeSpeedModifier = 0.02;\n private readonly noseIndexInterval = Math.round(this.props.height * this.noseSwipeSpeedModifier);\n\n private previousX = undefined;\n private previousY = undefined;\n\n constructor(props) {\n super(props);\n this.containerRef = React.createRef();\n this.firstTouch = true;\n this.state = {\n poseIndex: this.props.poseIndex,\n noseIndex: this.props.noseIndex,\n overlay: false\n };\n }\n\n private initializeHammer = () => {\n this.hammerManagerPose = new Hammer.Manager(this.containerRef.current, {\n domEvents: true,\n touchAction: 'pan-x',\n recognizers: [\n [Hammer.Pan, {\n direction: Hammer.DIRECTION_HORIZONTAL,\n pointers: 1,\n }]\n ]\n });\n this.hammerManagerPose.on('panmove', this.computeIndexes);\n this.hammerManagerPose.on('panend', () => { this.previousY = undefined; });\n\n this.hammerManagerNose = new Hammer.Manager(this.containerRef.current, {\n domEvents: true,\n touchAction: 'pan-y',\n recognizers: [\n [Hammer.Pan, {\n direction: Hammer.DIRECTION_VERTICAL,\n pointers: (this.props.touches === 2) ? 2 : 1,\n }]\n ]\n });\n this.hammerManagerNose.on('panmove', this.computeIndexes);\n this.hammerManagerNose.on('panend', () => { this.previousY = undefined; });\n\n if (this.props.enableNosePosition) {\n this.hammerManagerOverlay = new Hammer.Manager(this.containerRef.current, {\n domEvents: false,\n touchAction: 'press',\n recognizers: [\n [Hammer.Press, {\n pointers: (this.props.touches === 2) ? 2 : 1,\n time: 0\n }]\n ]\n });\n this.hammerManagerOverlay.on('press', () => {\n if (this.firstTouch) {\n this.setState({ overlay: true });\n this.firstTouch = false;\n }\n });\n }\n }\n\n private destroyHammer = () => {\n this.hammerManagerOverlay?.destroy();\n this.hammerManagerNose?.destroy();\n this.hammerManagerPose?.destroy();\n }\n\n componentDidMount() {\n if (this.props.enabled) {\n this.initializeHammer();\n this.containerRef.current.addEventListener('touchstart', (event: TouchEvent) => {\n if (event.touches.length === 2) {\n // avoid scrolling when user is using two fingers\n event.preventDefault();\n }\n });\n\n this.containerRef.current.addEventListener('touchend', () => {\n this.setState({\n overlay: false\n });\n });\n\n this.containerRef.current.addEventListener('mouseup', () => {\n this.setState({\n overlay: false\n });\n });\n }\n }\n\n componentDidUpdate(prevProps: SwipeableContainerProps) {\n if (prevProps.poseIndex !== this.props.poseIndex) {\n this.setState({ poseIndex: this.props.poseIndex });\n }\n if (prevProps.noseIndex !== this.props.noseIndex) {\n this.setState({ noseIndex: this.props.noseIndex });\n }\n if (prevProps.enableNosePosition !== this.props.enableNosePosition\n || prevProps.touches !== this.props.touches) {\n this.destroyHammer();\n this.initializeHammer();\n }\n }\n\n componentWillUnmount() {\n this.destroyHammer();\n }\n\n private onSetIndex = (poseIndex) => {\n if (this.props.instance && !this.props.instance.swiped) {\n this.props.actions.swipeInstance({divId: this.props.instance.divId});\n }\n this.props.actions.setInstanceIndex({\n divId: this.props.instance.divId,\n poseIndex: poseIndex\n });\n }\n\n private onSetNoseIndex = (noseIndex) => {\n if (this.props.enableNosePosition) {\n this.props.actions.setInstanceIndex({\n divId: this.props.instance.divId,\n noseIndex: noseIndex\n });\n }\n }\n\n private computeIndexes = (\n event: HammerInput\n ): void => {\n\n if (event.direction === Hammer.DIRECTION_LEFT || event.direction === Hammer.DIRECTION_RIGHT) {\n if (event.pointers.length === 1) {\n const oldIndex = this.state.poseIndex;\n if (this.previousX === undefined) {\n this.previousX = event.center.x;\n }\n const deltaX = this.previousX - event.center.x;\n const deltaIndex = Math.round(deltaX / this.indexInterval);\n const poseIndex = MathHelper.clamp(this.state.poseIndex + deltaIndex, 0, this.indexCount);\n\n this.setState({ poseIndex: poseIndex });\n if (oldIndex !== poseIndex) {\n this.previousX = event.center.x;\n this.onSetIndex(poseIndex);\n }\n }\n\n } else if (event.direction === Hammer.DIRECTION_UP || event.direction === Hammer.DIRECTION_DOWN) {\n if (this.props.touches === 1\n || (this.props.touches === 2 && event.pointers.length === 2)) {\n\n const oldNoseIndex = this.state.noseIndex;\n if (this.previousY === undefined) {\n this.previousY = event.center.y;\n }\n const deltaY = this.previousY - event.center.y;\n const deltaIndex = Math.round(deltaY / this.noseIndexInterval);\n const noseIndex = MathHelper.clamp(this.state.noseIndex - deltaIndex, 0, this.noseIndexCount);\n\n this.setState({\n noseIndex\n });\n if (oldNoseIndex !== noseIndex) {\n this.previousY = event.center.y;\n this.onSetNoseIndex(noseIndex);\n }\n }\n }\n }\n\n render() {\n\n const notification = (this.props.touches === 2) ? <>\n \n {LocalizationHelper.getString('RENDER_VTO', 'SLIDE_TWO_FINGERS')}\n : <>\n {LocalizationHelper.getString('RENDER_VTO', 'SLIDE_DESKTOP')}\n ;\n\n if (this.props.enabled) {\n return (\n
\n {this.props.children}\n
\n {notification}\n
\n
\n );\n } else {\n return this.props.children;\n }\n }\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n ...RenderActions\n }, dispatch)\n };\n}\n\n// Terrible fix, this cast to any permits to update typescript without breaking project's react/redux\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default connect(undefined, mapDispatchToProps)(SwipeableContainer) as any;\n","import { GlassesEnvironment } from '@luxottica/vm-glasses';\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { MeshVideoData } from '@luxottica/vm-vtoserver-client';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { name, version } from '../../../package.json';\nimport { CallbackHelper } from '../../helpers/CallbackHelper';\nimport DownloadHelper from '../../helpers/DownloadHelper';\nimport { GlassesHelper } from '../../helpers/GlassesHelper';\nimport { LocalizationHelper } from '../../helpers/LocalizationHelper';\nimport { RotateIcon } from '../../icons/RotateIcon';\nimport { RenderActions } from '../../reducers/renderReducer';\nimport { VtoApi } from '../../VtoApi';\nimport RenderCanvas from './RenderCanvas';\nimport './RenderContainer.scss';\nimport SwipeableContainer from './SwipeableContainer';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'RenderContainer');\n\ninterface RenderContainerProps {\n actions?: typeof RenderActions;\n singlePose?: boolean;\n divId: string;\n instance: InstanceData;\n videoId: string;\n video: VideoData;\n videoStatus: RenderStatus;\n upc: string;\n resolution: AssetResolution;\n glasses: GlassesData;\n glassesStatus: RenderStatus;\n glassesEnvironment: GlassesEnvironment;\n pupillaryDistance: number;\n poseIndex: number;\n noseIndex: number;\n width: number;\n height: number;\n offsetY: number;\n offsetZ: number;\n showRotateBar: boolean;\n enableNosePosition: boolean;\n nosePositionTouches: number;\n showImagePupils: boolean;\n}\n\ninterface RenderContainerState {\n initialIndex: number;\n swiped: boolean;\n}\n\nclass RenderContainer extends React.Component<\n RenderContainerProps,\n RenderContainerState\n> {\n\n constructor(props: RenderContainerProps) {\n super(props);\n this.state = {\n initialIndex: props.poseIndex,\n swiped: false\n };\n }\n\n componentDidMount() {\n this.fetchAssets();\n }\n\n componentDidUpdate(prevProps: RenderContainerProps) {\n this.fetchAssets();\n\n if (!prevProps.showImagePupils\n && this.props.showImagePupils\n && this.props.video?.videoId !== undefined\n && this.props.video?.faceData?.imagePupils === undefined ) {\n this.fetchFaceData(this.props.divId, this.props.video.videoId, this.props.video.centerImage);\n }\n }\n\n fetchAssets() {\n\n const singlePoseIndex = this.props.singlePose ? this.props.poseIndex : undefined;\n const shouldUpdateVideo = this.props.videoStatus === undefined;\n const shouldUpdateGlasses = this.props.glassesStatus === undefined;\n\n if (shouldUpdateVideo) {\n const downloadingDivId = this.props.divId;\n const downloadingVideoId = this.props.videoId;\n this.props.actions.addVideo({ divId: downloadingDivId, videoId: downloadingVideoId });\n VtoApi.getVideoData(downloadingVideoId, singlePoseIndex)\n .then((meshVideoData: MeshVideoData) => {\n this.props.actions.setVideoData({\n divId: downloadingDivId,\n videoId: downloadingVideoId,\n videoData: {\n ...meshVideoData,\n }\n });\n if (this.props.showImagePupils && !this.props.singlePose) {\n this.fetchFaceData(downloadingDivId, meshVideoData.videoId, meshVideoData.centerImage);\n }\n }).catch((error) => {\n this.props.actions.setVideoStatus({ divId: downloadingDivId, videoId: downloadingVideoId, status: 'ERROR' });\n CallbackHelper.onRenderError(error);\n });\n }\n\n if (shouldUpdateGlasses) {\n\n this.props.actions.addGlasses({\n divId: this.props.divId,\n upc: this.props.upc\n });\n\n GlassesHelper.downloadGlasses(\n this.props.upc,\n this.props.resolution,\n this.props.glassesEnvironment,\n singlePoseIndex\n ).then((glassesData) => {\n this.props.actions.setGlassesData({\n divId: this.props.divId,\n upc: this.props.upc,\n glassesData: glassesData\n });\n }).catch((error) => {\n logger.error(error);\n\n if (this.props.glassesEnvironment.startsWith('QA')) {\n logger.error('failed to download asset');\n CallbackHelper.onRenderError(error);\n this.props.actions.setGlassesStatus({\n divId: this.props.divId,\n upc: this.props.upc,\n status: 'ERROR'\n });\n\n } else if (this.props.resolution === '512') {\n logger.error('failed to download 512 resolution asset, falling back to 256 resolution');\n CallbackHelper.onRenderError(error);\n this.props.actions.glassesFallback({\n divId: this.props.divId,\n upc: this.props.upc,\n resolution: '256',\n });\n this.props.actions.setGlassesStatus({\n divId: this.props.divId,\n upc: this.props.upc,\n status: 'ERROR'\n });\n\n } else {\n logger.error('failed to download 256 resolution asset');\n CallbackHelper.onRenderError(error);\n this.props.actions.setGlassesStatus({\n divId: this.props.divId,\n upc: this.props.upc,\n status: 'ERROR'\n });\n }\n });\n }\n }\n\n fetchFaceData = (divId: string, videoId: string, centerImage: Blob): void => {\n DownloadHelper.detectPupils(centerImage).then((faceData) => {\n this.props.actions.setVideoFaceData({\n divId: divId,\n videoId: videoId,\n videoFaceData: faceData,\n });\n }).catch((error) => {\n logger.error(error);\n });\n }\n\n onStartPan = () => {\n this.setState({\n initialIndex: this.props.poseIndex,\n swiped: true,\n });\n }\n\n shouldEnableNosePosition = () => {\n return this.props.enableNosePosition && (this.props.glasses?.asset as GltfAsset)?.fitting !== 'fast';\n }\n\n render() {\n return (\n \n
\n \n {\n (this.props.showRotateBar && !this.props.singlePose) &&\n
\n \n
\n {LocalizationHelper.getString('RENDER_VTO', 'ROTATE')}\n
\n
\n }\n
\n
\n );\n }\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n ...RenderActions\n }, dispatch)\n };\n}\n\n// Terrible fix, this cast to any permits to update typescript without breaking project's react/redux\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default connect(null, mapDispatchToProps)(RenderContainer) as any;\n","import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LocalizationHelper } from '../../helpers/LocalizationHelper';\nimport './RenderError.scss';\n\nexport class RenderError extends React.Component {\n\n render() {\n return (\n
\n
\n \n \n \n
\n
\n {LocalizationHelper.getString('UPC_MISSING', 'TITLE')}\n
\n
\n );\n }\n}","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { RootState } from '../../reducers/combinedReducers';\nimport { RenderActions } from '../../reducers/renderReducer';\nimport { GlassesCache } from './cache/GlassesCache';\nimport { VideoCache } from './cache/VideoCache';\nimport { LoadingSpinner } from './LoadingSpinner';\nimport RenderContainer from './RenderContainer';\nimport { RenderError } from './RenderError';\nimport './RenderLoader.scss';\n\ninterface RenderLoaderProps {\n actions?: typeof RenderActions;\n divId: string;\n instance?: InstanceData;\n video?: VideoData;\n videoStatus?: RenderStatus;\n glasses?: GlassesData;\n glassesStatus?: RenderStatus;\n rendererStatus?: RenderStatus;\n}\n\ninterface RenderLoaderState {\n LazyRenderContainer: typeof RenderContainer;\n}\n\nclass RenderLoader extends React.Component<\n RenderLoaderProps,\n RenderLoaderState\n> {\n\n constructor(props: RenderLoaderProps) {\n super(props);\n this.state = {\n LazyRenderContainer: undefined\n };\n }\n\n componentDidMount() {\n this.setState({\n LazyRenderContainer: RenderContainer\n });\n }\n\n componentWillUnmount() {\n VideoCache.delete(this.props.divId);\n GlassesCache.delete(this.props.divId);\n }\n\n shouldShowErrorScreen(): boolean {\n return (this.props.glassesStatus === 'ERROR' || this.props.videoStatus === 'ERROR' || this.props.rendererStatus === 'ERROR');\n }\n\n shouldShowLoadingScreen(): boolean {\n if (this.shouldShowErrorScreen()) {\n return false;\n } else if (this.props.glassesStatus === 'LOADING' || this.props.videoStatus === 'LOADING' || this.props.rendererStatus === 'LOADING') {\n return true;\n } else {\n return false;\n }\n }\n\n render() {\n return (\n
\n { !this.shouldShowErrorScreen()\n && this.state.LazyRenderContainer !== undefined\n && this.props.instance !== undefined &&\n \n }\n {\n this.shouldShowErrorScreen() && \n }\n {\n (this.shouldShowLoadingScreen()) ? : undefined\n }\n
\n );\n }\n}\n\nfunction mapStateToProps(state: RootState, ownProps: RenderLoaderProps) {\n const instance = state.render.instance[ownProps.divId];\n\n return {\n instance: instance,\n video: VideoCache.get(ownProps.divId),\n videoStatus: instance.videoStatus,\n glasses: GlassesCache.get(ownProps.divId),\n glassesStatus: instance.upcStatus,\n rendererStatus: instance.rendererStatus,\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n ...RenderActions\n }, dispatch)\n };\n}\n\n// Terrible fix, this cast to any permits to update typescript without breaking project's react/redux\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default connect(mapStateToProps, mapDispatchToProps)(RenderLoader) as any;\n","import { AssetResolution } from '@luxottica/vm-glasses';\n\ninterface RenderOptions {\n divId: string,\n videoId: string,\n upc: string,\n pupillaryDistance?: number,\n poseIndex?: number,\n optimizeSinglePose?: boolean,\n noseIndex?: number,\n showRotateBar?: boolean,\n enableNosePosition?: boolean,\n nosePositionTouches?: number,\n resolution?: AssetResolution,\n width?: number,\n height?: number,\n offsetY?: number,\n offsetZ?: number,\n debugOptions?: RenderDebugOptions,\n}\n\ninterface RenderDebugOptions {\n glassesEnvironment?: VtoGlassesEnvironment,\n showMesh?: boolean;\n calculatePupils?: boolean;\n showMeshCenter?: boolean;\n calculateMeshCenter?: boolean;\n showPupils?: boolean;\n showImagePupils?: boolean;\n checkError?: boolean;\n hideGlasses?: boolean;\n hideShadow?: boolean;\n hideBackground?: boolean;\n hideLenses?: boolean;\n hideFrame?: boolean;\n enableScaling?: boolean;\n meshColor?: number[];\n}\n\nconst defaultRenderDebugOptions: Partial = {\n glassesEnvironment: 'PROD' as VtoGlassesEnvironment,\n showMesh: false,\n calculatePupils: false,\n showMeshCenter: false,\n calculateMeshCenter: false,\n showPupils: false,\n showImagePupils: false,\n checkError: false,\n hideGlasses: false,\n hideShadow: false,\n hideBackground: false,\n hideLenses: false,\n hideFrame: false,\n enableScaling: false,\n meshColor: [0.0, 1.0, 0.0, 0.5]\n}\n\nconst defaultRenderOptions: Partial = {\n poseIndex: 7,\n noseIndex: 0,\n showRotateBar: true,\n enableNosePosition: true,\n nosePositionTouches: 1,\n resolution: '512',\n width: 480,\n height: 480,\n offsetY: 0,\n offsetZ: 0,\n debugOptions: defaultRenderDebugOptions\n}\n\n\nexport { RenderOptions, RenderDebugOptions, defaultRenderOptions }","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { Store } from 'redux';\nimport { GlassesEnvironment } from '@luxottica/vm-glasses';\nimport { name, version } from '../../package.json';\nimport RenderLoader from '../app/render/RenderLoader';\nimport { InvalidParametersError, RenderingError, UnknownError, VtoError } from '../constants/errors';\nimport { GlassesHelper } from '../helpers/GlassesHelper';\nimport { MathHelper } from '../helpers/MathHelper';\nimport { isBoolean, isNumber, isString, mergeDeep, stringToNumber } from '../helpers/ParameterHelper';\nimport { VtoInstanceContainer } from '../helpers/VtoInstanceContainer';\nimport { defaultRenderOptions, RenderOptions } from '../interfaces/RenderOptions';\nimport { RootState } from '../reducers/combinedReducers';\nimport { RenderActions } from '../reducers/renderReducer';\nimport { ROOT_STYLE_NAME } from '../constants/Styling';\nimport { GlassesCache } from '../app/render/cache/GlassesCache';\nimport { VideoCache } from '../app/render/cache/VideoCache';\nimport { CallbackHelper, setCallbacks, setRenderErrorCallback, setRenderSuccessCallback } from '../helpers/CallbackHelper';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'RenderFunction');\n\nlet renderCount = 0;\n\nconst validateRenderOptions = (options: RenderOptions) => {\n if (!options.divId || !isString(options.divId)) {\n throw new InvalidParametersError('divId');\n }\n if (!options.videoId || !isString(options.videoId)) {\n throw new InvalidParametersError('videoId');\n }\n if (!options.upc || !isString(options.upc)) {\n throw new InvalidParametersError('upc');\n }\n if (options.pupillaryDistance !== undefined\n && (!isNumber(options.pupillaryDistance) || options.pupillaryDistance < 1)) {\n throw new InvalidParametersError('pupillaryDistance');\n }\n if (options.poseIndex !== undefined\n && (!isNumber(options.poseIndex) || options.poseIndex < 0)) {\n throw new InvalidParametersError('poseIndex');\n }\n if (options.noseIndex !== undefined\n && (!isNumber(options.noseIndex) || options.noseIndex < 0)) {\n throw new InvalidParametersError('noseIndex');\n }\n if (options.showRotateBar !== undefined && !isBoolean(options.showRotateBar)) {\n throw new InvalidParametersError('showRotateBar');\n }\n if (options.enableNosePosition !== undefined && !isBoolean(options.enableNosePosition)) {\n throw new InvalidParametersError('enableNosePosition');\n }\n if (options.nosePositionTouches !== undefined\n && (!isNumber(options.nosePositionTouches) || options.nosePositionTouches < 1)) {\n throw new InvalidParametersError('nosePositionTouches');\n }\n if (options.resolution && !['256', '512'].includes(options.resolution)) {\n throw new InvalidParametersError('resolution');\n }\n if (options.width !== undefined\n && (!isNumber(options.width) || options.width < 1)) {\n throw new InvalidParametersError('width');\n }\n if (options.height !== undefined\n && (!isNumber(options.height) || options.height < 1)) {\n throw new InvalidParametersError('height');\n }\n if (options.offsetY !==undefined\n && !isNumber(options.offsetY)) {\n throw new InvalidParametersError('offsetY');\n }\n if (options.offsetZ!==undefined\n && !isNumber(options.offsetZ)) {\n throw new InvalidParametersError('offsetZ');\n }\n if (options.debugOptions) {\n if (options.debugOptions.glassesEnvironment !== undefined \n && !Object.keys(GlassesEnvironment).includes(options.debugOptions.glassesEnvironment)) {\n throw new InvalidParametersError('glassesEnvironment');\n }\n if (options.debugOptions.showMesh !== undefined && !isBoolean(options.debugOptions.showMesh)) {\n throw new InvalidParametersError('showMesh');\n }\n if (options.debugOptions.showMeshCenter !== undefined && !isBoolean(options.debugOptions.showMeshCenter)) {\n throw new InvalidParametersError('showMeshCenter');\n }\n if (options.debugOptions.showPupils !== undefined && !isBoolean(options.debugOptions.showPupils)) {\n throw new InvalidParametersError('showPupils');\n }\n if (options.debugOptions.showImagePupils !== undefined && !isBoolean(options.debugOptions.showImagePupils)) {\n throw new InvalidParametersError('showImagePupils');\n }\n if (options.debugOptions.checkError !== undefined && !isBoolean(options.debugOptions.checkError)) {\n throw new InvalidParametersError('checkError');\n }\n if (options.debugOptions.hideGlasses !== undefined && !isBoolean(options.debugOptions.hideGlasses)) {\n throw new InvalidParametersError('hideGlasses');\n }\n if (options.debugOptions.hideShadow !== undefined && !isBoolean(options.debugOptions.hideShadow)) {\n throw new InvalidParametersError('hideShadow');\n }\n if (options.debugOptions.hideBackground !== undefined && !isBoolean(options.debugOptions.hideBackground)) {\n throw new InvalidParametersError('hideBackground');\n }\n if (options.debugOptions.hideLenses !== undefined && !isBoolean(options.debugOptions.hideLenses)) {\n throw new InvalidParametersError('hideLenses');\n }\n if (options.debugOptions.hideFrame !== undefined && !isBoolean(options.debugOptions.hideFrame)) {\n throw new InvalidParametersError('hideFrame');\n }\n if (options.debugOptions.enableScaling !== undefined && !isBoolean(options.debugOptions.enableScaling)) {\n throw new InvalidParametersError('enableScaling');\n }\n if (options.debugOptions.meshColor && (options.debugOptions.meshColor.length !== 4\n || !isNumber(options.debugOptions.meshColor[0])\n || !isNumber(options.debugOptions.meshColor[1])\n || !isNumber(options.debugOptions.meshColor[2])\n || !isNumber(options.debugOptions.meshColor[3])\n )) {\n throw new InvalidParametersError('meshColor');\n }\n }\n};\n\nconst RenderFunction = (\n store: Store,\n options: RenderOptions,\n onSuccess: () => void,\n onError: (error: VtoError) => void,\n): void => {\n logger.debug('rendering vto with videoId={}', options?.videoId);\n renderCount++;\n\n try {\n validateRenderOptions(options);\n } catch (error: unknown) {\n if (error instanceof VtoError) {\n onError(error);\n } else if (error instanceof Error){\n onError(new UnknownError(error));\n } else {\n logger.error(error);\n }\n return;\n }\n \n const mergedOptions: Required = mergeDeep(defaultRenderOptions, options);\n \n try {\n mergedOptions.pupillaryDistance = stringToNumber(mergedOptions.pupillaryDistance);\n mergedOptions.poseIndex = MathHelper.clamp(mergedOptions.poseIndex, 0 , 14);\n mergedOptions.noseIndex = MathHelper.clamp(mergedOptions.noseIndex, 0 , 20);\n\n mergedOptions.debugOptions.calculatePupils = mergedOptions.debugOptions.showPupils;\n mergedOptions.debugOptions.calculateMeshCenter = mergedOptions.debugOptions.showMeshCenter;\n\n if (store.getState().render.instance[mergedOptions.divId]?.upcStatus === 'ERROR') {\n CallbackHelper.onRenderError(new RenderingError(mergedOptions.upc));\n }\n\n // if the video id exists and is in error state VTO wants to retry a render\n // this because microservices are highly asynchronous and is possible that the same\n // VTO instance can find an existing video after a retry\n if (store.getState().render.instance[mergedOptions.divId]?.videoStatus === 'ERROR') {\n store.dispatch(\n RenderActions.deleteVideoData({ divId: mergedOptions.divId })\n );\n }\n\n const container = document.getElementById(mergedOptions.divId);\n const validUpc = (mergedOptions.upc && mergedOptions.upc.includes('|'))\n ? mergedOptions.upc.split('|').join('-') : mergedOptions.upc;\n VtoInstanceContainer.instance.addVto(mergedOptions.divId);\n\n // reset upcStatus if upc has changed\n const currentInstance = store.getState().render.instance[mergedOptions.divId];\n\n let newVideoStatus;\n if (currentInstance === undefined\n || mergedOptions.videoId !== currentInstance.videoId\n || mergedOptions.optimizeSinglePose !== currentInstance.renderOptions.optimizeSinglePose\n || (mergedOptions.optimizeSinglePose && mergedOptions.poseIndex !== currentInstance.renderOptions.poseIndex)) {\n newVideoStatus = undefined;\n VideoCache.delete(mergedOptions.divId);\n } else {\n newVideoStatus = currentInstance?.videoStatus;\n }\n\n let newGlassesStatus;\n if (currentInstance === undefined\n || mergedOptions.upc !== currentInstance.upc\n || mergedOptions.debugOptions.glassesEnvironment !== currentInstance.glassesEnvironment\n || mergedOptions.resolution !== currentInstance.renderOptions.resolution\n || mergedOptions.optimizeSinglePose !== currentInstance.renderOptions.optimizeSinglePose\n || (mergedOptions.optimizeSinglePose && mergedOptions.poseIndex !== currentInstance.renderOptions.poseIndex)) {\n newGlassesStatus = undefined;\n GlassesCache.delete(mergedOptions.divId);\n } else {\n newGlassesStatus = currentInstance?.upcStatus;\n }\n\n store.dispatch(RenderActions.updateInstance({\n divId: mergedOptions.divId,\n glassesEnvironment: mergedOptions.debugOptions.glassesEnvironment,\n renderKey: renderCount,\n swiped: false,\n upc: validUpc,\n upcStatus: newGlassesStatus,\n videoId: mergedOptions.videoId,\n videoStatus: newVideoStatus,\n pupillaryDistance: mergedOptions.pupillaryDistance,\n renderOptions: mergedOptions,\n rendererStatus: undefined,\n }));\n\n if (!!container) {\n container.classList.add(ROOT_STYLE_NAME);\n }\n\n if (!!onSuccess) { setRenderSuccessCallback(onSuccess); }\n if (!!onError) { setRenderErrorCallback(onError); }\n\n ReactDOM.render(\n \n \n ,\n container\n );\n } catch (error) {\n if (error instanceof VtoError) {\n onError(error);\n } else if (error instanceof Error){\n onError(new RenderingError(mergedOptions.upc));\n } else {\n onError(new UnknownError(error));\n }\n }\n}\n\nexport {\n RenderFunction\n};\n","const ROOT_STYLE_NAME = 'vto-core-module-root-style';\n\nexport {\n ROOT_STYLE_NAME\n};","import { combineReducers } from 'redux';\nimport { AppReducer } from './appReducer';\nimport { RenderReducer } from './renderReducer';\n\nexport interface RootState {\n app: AppStoreState;\n render: RenderStoreState;\n}\n\nexport default combineReducers({\n app: AppReducer,\n render: RenderReducer,\n});\n","import { AssetResolution, GlassesEnvironment, TransitionLens } from '@luxottica/vm-glasses';\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../package.json';\nimport { VtoError } from './constants/errors';\nimport { CloseRenderFunction } from './functions/CloseRenderFunction';\nimport { downloadTransitionColorCatalogue } from './functions/DownloadTransitionColorCatalogue';\nimport { getScreenshot, Screenshot } from './functions/GetScreenshot';\nimport { InitializeFunction } from './functions/InitializeFunction';\nimport { IsUpcSupportedFunction } from './functions/IsUpcSupportedFunction';\nimport { RenderFunction } from './functions/RenderFunction';\nimport { setTransitionLensName } from './functions/setTransitionLensName';\nimport { setTransitionOpacity } from './functions/SetTransitionOpacity';\nimport { setTransitionOverrideColor } from './functions/SetTransitionOverrideColor';\nimport { setEnvironment } from './helpers/EnvironmentHelper';\nimport { AnalyticsConfig } from './interfaces/AnalyticsConfig';\nimport { CloseRenderOptions } from './interfaces/CloseRenderOptions';\nimport { InitializeOptions } from './interfaces/InitializeOptions';\nimport { IsUpcSupportedOptions } from './interfaces/IsUpcSupportedOptions';\nimport { RenderDataResponse } from './interfaces/RenderDataResponse';\nimport { RenderOptions } from './interfaces/RenderOptions';\nimport { VtoCoreEnvironment } from './interfaces/VtoCoreEnvironment';\nimport { configureStore } from './Store';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'VtoCore');\n\nconst store = configureStore();\n\nconst setVtoEnvironment = (environment: VtoCoreEnvironment) => {\n setEnvironment(environment, store);\n};\n\nconst errorWrapper = (errorFunction: (error: VtoError) => void): (error: VtoError) => void => {\n return (error: VtoError) => {\n logger.error(error);\n if (errorFunction) {\n errorFunction(error);\n }\n }\n}\n\nconst VtoCore = {\n\n /**\n * Initializes VtoCore component\n * Use 'initialize' to setup the vto client. This function should be called on every browser page with vto enabled. If passed an empty userId, the service will create a new one for you. If passed an existing userId, the service will validate that the user id exists.\n * \n * Available locales: de-DE, en-US, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, pl-PL, pt-PT, sv-SE, tr-TR, zh-CN, zh-HK, zh-TW\n * \n * Make sure to save the valid userId on the client and pass this into subsequent calls to 'initialize'.\n * \n * Supported features will also be returned from successful initialization. This tells the client whether it supports capture and rendering.\n * \n * Depending on the platform and supportFeatures, the client should then execute either 'fileCapture' or 'webcamCapture'\n * \n * @param options - InitializeOptions\n * @param onSuccess - onSuccess\n * @param onError - onError\n */\n initialize(\n options: InitializeOptions,\n onSuccess: (supportedFeatures: {\n webglRendering: boolean\n }) => void,\n onError: (error: VtoError) => void = () => { return; }\n ): void {\n InitializeFunction(store, options, onSuccess, errorWrapper(onError));\n },\n\n isUpcSupported(\n options: IsUpcSupportedOptions,\n onSuccess: (supported: boolean) => void,\n onError: (error: VtoError) => void = () => { return; }\n ): void {\n IsUpcSupportedFunction(options, onSuccess, errorWrapper(onError));\n },\n\n render(\n options: RenderOptions,\n onSuccess: () => void,\n onError: (error: VtoError) => void = () => { return; }\n ): void {\n RenderFunction(store, options, onSuccess, errorWrapper(onError));\n },\n\n closeRender(\n options: CloseRenderOptions,\n onSuccess: () => void,\n onError: (error: VtoError) => void = () => { return; }\n ): void {\n CloseRenderFunction(store, options, onSuccess, errorWrapper(onError));\n },\n\n setTransitionOpacity(opacity: number): void {\n return setTransitionOpacity(opacity);\n },\n\n setTransitionOverrideColor(transitionLens: TransitionLens): void {\n return setTransitionOverrideColor(transitionLens);\n },\n \n setTransitionColorName(colorName: string): void {\n return setTransitionLensName(colorName);\n },\n\n downloadTransitionColorCatalogue(environment: GlassesEnvironment): Promise> {\n return downloadTransitionColorCatalogue(environment);\n },\n\n getScreenshot(type = 'image/jpeg', quality = 0.9): Promise {\n return getScreenshot(type, quality);\n }\n};\n\nsetVtoEnvironment('production');\nlogger.debug('VtoCore loaded');\n\nexport {\n VtoCore,\n VtoError,\n VtoCoreEnvironment,\n AssetResolution,\n AnalyticsConfig,\n InitializeOptions,\n IsUpcSupportedOptions,\n RenderDataResponse,\n RenderOptions,\n CloseRenderOptions,\n setVtoEnvironment\n};\n","import { compose, createStore, Store } from 'redux';\nimport rootReducer, { RootState } from './reducers/combinedReducers';\n\n\nexport function configureStore(initialState?: RootState): Store {\n const composeEnhancers =\n typeof window === 'object' &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n // trace: true,\n name: 'vto-core'\n }) : compose;\n\n const enhancer = composeEnhancers();\n return createStore(rootReducer, initialState, enhancer);\n}\n","import { OpacityError } from '../constants/errors';\nimport { TransitionColorHelper } from '../helpers/TransitionColorHelper';\n\n\nconst setTransitionOpacity = (opacity = 0): void => {\n \n if (opacity !== undefined) {\n if (typeof opacity !== 'number' || opacity < 0 || opacity > 1) {\n const error = new OpacityError('opacity must be a number between 0 and 1');\n throw error;\n }\n TransitionColorHelper.setCurrentLensOpacity(opacity);\n\n } else {\n const error = new OpacityError('opacity cannot be set when mirror is not initialized');\n throw error;\n }\n};\n\nexport {\n setTransitionOpacity\n};\n","import { TransitionColorHelper } from '../helpers/TransitionColorHelper';\n\nconst setTransitionOverrideColor = (transitionColor: TransitionLens): void => {\n TransitionColorHelper.setTransitionOverrideColor(transitionColor);\n};\n\nexport {\n setTransitionOverrideColor\n};\n","import { TransitionColorHelper } from '../helpers/TransitionColorHelper';\n\n\nconst setTransitionLensName = (colorName: string): void => {\n TransitionColorHelper.setCurrentTransitionLens(colorName);\n};\n\nexport {\n setTransitionLensName\n};\n","\nimport { Catalog, GlassesEnvironment } from '@luxottica/vm-glasses';\n\nconst downloadTransitionColorCatalogue = (env: GlassesEnvironment): Promise> => {\n return Catalog.downloadTransitionLenses({env}).then((colors)=>{\n return Object.keys(colors);\n });\n};\n\nexport {\n downloadTransitionColorCatalogue\n};\n"],"sourceRoot":""}