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,EAAItK,EAAIkM,GAAMnB,EAAKmB,GAIvB,OAAO5B,GAAOc,EAAYL","sources":["../node_modules/@luxottica/frame-advisor-capture/src/constants/VideoStatus.ts","../node_modules/@luxottica/frame-advisor-capture/src/helpers/Timer.ts","../node_modules/@luxottica/frame-advisor-capture/src/helpers/WebCamHelper.ts","../node_modules/@luxottica/frame-advisor-capture/src/components/NudgingGuide.tsx","../node_modules/@luxottica/frame-advisor-capture/src/components/CheckIcon.tsx","../node_modules/@luxottica/frame-advisor-capture/src/components/TrackingAreaPlaceholder.tsx","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/ImageLoader.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockStreamTrack.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockBridgeMedia.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/AbstractNativeBridge.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeBridge.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeStreamTrack.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeBridgeMedia.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/adapter/UserMedia.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockVideoStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeVideoStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/adapter/WebCamVideoStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/adapter/WebCamStream.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/domain/WebCamConstraints.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/error/WebCamAbstractError.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/error/WebCamAccessNotFoundError.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/error/WebCamAccessRejectedError.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/remotelog/AppViewSessionKeys.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/error/WebCamAccessSystemError.ts","../node_modules/@luxottica/frame-advisor-capture/node_modules/@luxottica/vm-webcam/src/WebCam.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/WarmUp.ts","../node_modules/@luxottica/virtual-mirror/src/errors/errors.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DefaultInitializationOptions.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/FeatureConfigHelper.ts","../node_modules/@luxottica/virtual-mirror/src/interfaces/Features.ts","../node_modules/@luxottica/virtual-mirror/src/app/service/FeatureLicensingService.ts","../node_modules/@luxottica/virtual-mirror/src/app/VmCore.tsx","../node_modules/@luxottica/virtual-mirror/src/constants/actions.ts","../node_modules/@luxottica/virtual-mirror/src/reducers/appReducer.ts","../node_modules/@luxottica/virtual-mirror/src/reducers/mirrorReducer.ts","../node_modules/@luxottica/virtual-mirror/src/reducers/userReducer.ts","../node_modules/@luxottica/virtual-mirror/src/reducers/combinedReducers.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/TransitionColorHelper.ts","../node_modules/@luxottica/virtual-mirror/src/remotelog/AppViewSessionKeys.ts","../node_modules/@luxottica/virtual-mirror/src/Store.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DOMEvents.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/CallbackHelper.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/AnimateOpacity.ts","../node_modules/@luxottica/virtual-mirror/src/remotelog/VmLogger.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/AdobeHelper.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/AnalyticsHelper.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/CloseMirror.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/RequestHelper.ts","../node_modules/@luxottica/virtual-mirror/src/constants/Events.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/GetScreenshot.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/LocalizationDefaults.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/LocalizationHelper.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/SupportedFeaturesHelper.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/InitializationHelper.ts","../node_modules/@luxottica/virtual-mirror/src/app/mirror/FpsCounter.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DefaultEnvironmentOptions.ts","../node_modules/@luxottica/virtual-mirror/src/interfaces/MirrorOptions.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DefaultPrivacyOptions.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DefaultRenderingOptions.ts","../node_modules/@luxottica/virtual-mirror/src/constants/DefaultTrackingOptions.ts","../node_modules/@luxottica/virtual-mirror/src/helpers/ParameterHelper.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/Initialize.ts","../node_modules/@luxottica/virtual-mirror/src/app/mirror/VmWebCam.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/Pause.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/RenderMirror.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/Resume.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/SetTransitionOverrideColor.ts","../node_modules/@luxottica/virtual-mirror/src/Catalogue.ts","../node_modules/@luxottica/virtual-mirror/src/VirtualMirror.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/GetBipaVersion.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/SaveBipaEntry.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/SetTransitionOpacity.ts","../node_modules/@luxottica/virtual-mirror/src/app/functions/IsBrowserSupported.ts","../node_modules/@luxottica/vm-eventbus/src/EventBus.ts","../node_modules/@luxottica/vm-glasses/src/constants/Environment.ts","../node_modules/@luxottica/vm-glasses/src/config/GlassesApiConfig.ts","../node_modules/@luxottica/vm-glasses/src/config/CatalogueApiConfig.ts","../node_modules/@luxottica/vm-glasses/src/helpers/UpcAvailabilityResponse/NotAvailable.ts","../node_modules/@luxottica/vm-glasses/src/helpers/UpcAvailabilityResponse/Standard.ts","../node_modules/@luxottica/vm-glasses/src/CatalogService.ts","../node_modules/@luxottica/vm-glasses/src/helpers/UpcAvailabilityResponse/QATool.ts","../node_modules/@luxottica/vm-glasses/src/Catalog.ts","../node_modules/@luxottica/vm-glasses/src/AssetDecoder.ts","../node_modules/@luxottica/vm-glasses/src/remotelog/AppViewSessionKeys.ts","../node_modules/@luxottica/vm-glasses/src/constants/AssetNames.ts","../node_modules/@luxottica/vm-glasses/src/constants/GltfDefault.ts","../node_modules/@luxottica/vm-glasses/src/constants/MockAssetData.ts","../node_modules/@luxottica/vm-glasses/src/error/GenericError.ts","../node_modules/@luxottica/vm-glasses/src/error/GlassesDownloadError.ts","../node_modules/@luxottica/vm-glasses/src/error/GlassesDownloadForbiddenError.ts","../node_modules/@luxottica/vm-glasses/src/error/GlassesNotFoundError.ts","../node_modules/@luxottica/vm-glasses/src/helpers/AssetHelper.ts","../node_modules/@luxottica/vm-glasses/src/GlassesExtractor.ts","../node_modules/@luxottica/vm-glasses/src/ZipDownloader.ts","../node_modules/@luxottica/vm-glasses/src/GlassesDownloader.ts","../node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/ImageLoader.ts","../node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockStreamTrack.ts","../node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockBridgeMedia.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/AbstractNativeBridge.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeBridge.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeStreamTrack.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeBridgeMedia.ts","../node_modules/@luxottica/vm-webcam/src/domain/adapter/UserMedia.ts","../node_modules/@luxottica/vm-webcam/src/domain/mockWebcam/MockVideoStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/nativeWebcam/NativeVideoStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/adapter/WebCamVideoStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/adapter/WebCamStream.ts","../node_modules/@luxottica/vm-webcam/src/domain/WebCamConstraints.ts","../node_modules/@luxottica/vm-webcam/src/error/WebCamAbstractError.ts","../node_modules/@luxottica/vm-webcam/src/error/WebCamAccessNotFoundError.ts","../node_modules/@luxottica/vm-webcam/src/error/WebCamAccessRejectedError.ts","../node_modules/@luxottica/vm-webcam/src/remotelog/AppViewSessionKeys.ts","../node_modules/@luxottica/vm-webcam/src/error/WebCamAccessSystemError.ts","../node_modules/@luxottica/vm-webcam/src/WebCam.ts","../node_modules/pubsub-js/src/pubsub.js","../node_modules/uuid/index.js","../node_modules/uuid/lib/bytesToUuid.js","../node_modules/uuid/lib/rng-browser.js","../node_modules/uuid/v1.js","../node_modules/uuid/v4.js"],"sourcesContent":["export enum VideoStatus {\n LOADING = 'LOADING',\n PLAYING = 'PLAYING', \n STOPPED = 'STOPPED'\n}","class Timer {\n\n private startTime: number;\n private currentDuration: number;\n private currentTimer: number;\n\n public start(\n duration: number,\n onComplete: () => void\n ) {\n this.stop();\n this.startTime = Date.now();\n this.currentDuration = duration;\n this.currentTimer = window.setTimeout(onComplete, duration);\n }\n\n public stop() {\n window.clearTimeout(this.currentTimer);\n this.startTime = undefined;\n this.currentDuration = undefined;\n this.currentTimer = undefined;\n }\n\n public get active() {\n return this.currentTimer !== undefined;\n }\n\n public get currentTime() {\n return (this.currentDuration) ? Math.min(Date.now() - this.startTime, this.currentDuration) : undefined;\n }\n\n public get timeRemaining() {\n return (this.currentDuration) ? (this.currentDuration - (Date.now() - this.startTime)) : undefined;\n }\n}\n\nexport {\n Timer\n};\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { NativeStream, WebCam } from '@luxottica/vm-webcam';\nimport { name, version } from '../../package.json';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'WebCamHelper');\n\nconst webCam = new WebCam();\n\nconst WebcamHelper = {\n openWebcam: (\n width: number,\n height: number\n ) => {\n logger.debug('Try to open webcam {}x{}', width, height);\n return webCam.tryToOpenWebCam(width, height, 'user');\n },\n\n createStream: (\n options: {\n target: string;\n id?: string;\n className?: string;\n }, \n stream: MediaStream | NativeStream\n ) => {\n return webCam.createStreamObject(options, stream);\n },\n\n closeStream: () => {\n return webCam.closeCurrentMediaStream();\n }\n};\n\nexport {\n WebcamHelper\n};\n","import { GuidanceCommand } from '@luxottica/vm-posetracker-faceweb';\nimport * as React from 'react';\nimport { CallbackHelper } from '../helpers/CallbackHelper';\nimport { LocalizationHelper } from '../helpers/LocalizationHelper';\nimport './NudgingGuide.scss';\n\ninterface NudgingGuideProps {\n guidance: GuidanceCommand;\n glasses?: boolean;\n vto?: boolean;\n}\n\nexport class NudgingGuide extends React.PureComponent<\n NudgingGuideProps\n> {\n\n componentDidUpdate(): void {\n CallbackHelper.onNudging(this.props.guidance, this.getText(this.props.guidance, this.props.glasses, this.props.vto));\n }\n\n public render() {\n if (this.props.guidance === undefined || this.props.guidance === GuidanceCommand.NONE) {\n return <>;\n } else {\n return (\n
\n {this.getText(this.props.guidance, this.props.glasses, this.props.vto)}\n
\n );\n }\n }\n\n private getText(\n guidance: GuidanceCommand,\n glasses?: boolean,\n vto?: boolean\n ): string {\n if (glasses) {\n return LocalizationHelper.getString('guidance', 'glasses');\n }\n\n switch (guidance) {\n case GuidanceCommand.UNKNOWN:\n return LocalizationHelper.getString('guidance', 'unknown');\n case GuidanceCommand.MOVE_CLOSER:\n return LocalizationHelper.getString('guidance', 'move_closer');\n case GuidanceCommand.MOVE_FARTHER:\n return LocalizationHelper.getString('guidance', 'move_farther');\n case GuidanceCommand.STAY_STILL:\n let stringStayStill: string;\n vto ? stringStayStill = LocalizationHelper.getString('guidance', 'stay_still_video') : stringStayStill = LocalizationHelper.getString('guidance', 'stay_still');\n return stringStayStill;\n case GuidanceCommand.LOOK_UP:\n return LocalizationHelper.getString('guidance', 'look_up');\n case GuidanceCommand.LOOK_RIGHT:\n return LocalizationHelper.getString('guidance', 'look_right');\n case GuidanceCommand.LOOK_DOWN:\n return LocalizationHelper.getString('guidance', 'look_down');\n case GuidanceCommand.LOOK_LEFT:\n return LocalizationHelper.getString('guidance', 'look_left');\n case GuidanceCommand.TILT_LEFT:\n return LocalizationHelper.getString('guidance', 'tilt_left');\n case GuidanceCommand.TILT_RIGHT:\n return LocalizationHelper.getString('guidance', 'tilt_right');\n case GuidanceCommand.MOVE_UP:\n case GuidanceCommand.MOVE_RIGHT:\n case GuidanceCommand.MOVE_DOWN:\n case GuidanceCommand.MOVE_LEFT:\n default:\n return LocalizationHelper.getString('guidance', 'default');\n }\n }\n}\n","import * as React from 'react';\n\nimport './CheckIcon.scss';\n\ninterface CheckIconProps {\n enabled: boolean;\n size: number;\n}\n\nexport const CheckIcon = (props: CheckIconProps) => {\n\n return (\n
\n \n \n \n \n
\n );\n};","import { GuidanceCommand } from '@luxottica/vm-posetracker-faceweb';\nimport { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport * as React from 'react';\nimport { name, version } from '../../package.json';\nimport { CheckIcon } from './CheckIcon';\nimport './TrackingAreaPlaceholder.scss';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'TrackingAreaPlaceholder');\n\nexport interface TrackingAreaPlaceholderProps {\n areaSize: number;\n sourceWidth: number;\n sourceHeight: number;\n minimumFaceSizeRatio: number;\n mirrorVideoWidth: number;\n mirrorVideoHeight: number;\n guidance: GuidanceCommand;\n checkIcon: boolean;\n strokeWidth?: number;\n debug?: boolean;\n}\n\nexport class TrackingAreaPlaceholder extends React.PureComponent {\n\n private strokeWidth = 3;\n private strokeDashArray = '6, 7';\n\n // oval state classes\n private nudingClassUnknown = 'fa-nudging-unknown';\n private nudingClassDirections = 'fa-nudging-directions';\n private nudingClassStandstill = 'fa-nudging-stay-still';\n\n constructor(props: TrackingAreaPlaceholderProps) {\n super(props);\n logger.debug('render tracking area with size {}', this.props.areaSize);\n logger.debug('canvas crop size: {}x{}', this.props.sourceHeight, this.props.sourceWidth);\n logger.debug('svg ellipse 1 [cx={},cy={},rx={},ry={}]',\n this.svgEllipseCX(), this.svgEllipseCY(), this.svgEllipseRadiusX_UI(), this.svgEllipseRadiusY_UI());\n logger.debug(\n 'svg ellipse 2 [enabled={}] [cx={},cy={},rx={},ry={}]',\n this.props.debug,\n this.svgEllipseCX(),\n this.svgEllipseCY(),\n this.svgEllipseRadiusX_debug(),\n this.svgEllipseRadiusY_debug()\n );\n }\n\n public render() {\n\n if (this.props.guidance === undefined || this.props.guidance === GuidanceCommand.NONE) {\n return <>;\n } else {\n const styleName = this.getNudgingStyle(this.props.guidance);\n\n return (\n <>\n \n \n { /* this represent the face size according to the current poseTracker debug messages */\n this.props.debug &&\n }\n \n \n \n );\n }\n }\n\n private getNudgingStyle(\n guidance: GuidanceCommand\n ): string {\n if (guidance === GuidanceCommand.UNKNOWN) {\n return this.nudingClassUnknown;\n } else if (guidance === GuidanceCommand.STAY_STILL) {\n return this.nudingClassStandstill;\n } else {\n return this.nudingClassDirections;\n }\n }\n\n private svgEllipseCX(): number {\n return this.props.sourceWidth * 0.5;\n }\n\n private svgEllipseCY(): number {\n return this.props.sourceHeight * 0.5;\n }\n\n private svgEllipseRadiusX_UI(): number {\n return this.getFaceSizeUI.width / 2;\n }\n\n private svgEllipseRadiusY_UI(): number {\n return this.getFaceSizeUI.height / 2;\n }\n\n private svgEllipseRadiusX_debug(): number {\n return this.getFaceSize() / 2;\n }\n\n private svgEllipseRadiusY_debug(): number {\n return this.getFaceSize() / 2;\n }\n\n /*\n From Headtracker source code\n https://github.com/luxdeepblue/\n vto_wasm_headtracker/blob/2d6bef37d4eccd96579d55411965602c3da94a31/src/vto/head_tracker.cpp#L87-L97\n */\n private getFaceSize(): number {\n const smallestSide = Math.min(this.props.mirrorVideoWidth, this.props.mirrorVideoHeight);\n const faceSideSize = smallestSide * this.props.minimumFaceSizeRatio;\n return faceSideSize;\n }\n\n // We define an ellipse with diameters of: width: 1.0, height: 1.4\n // To calculate ellipse's diameters we check two fixed proportions against the minimumFaceSizeRatio\n private get getFaceSizeUI(): {\n width: number;\n height: number;\n } {\n const smallestSide: number = Math.min(this.props.mirrorVideoWidth, this.props.mirrorVideoHeight);\n const isLandscape: boolean = smallestSide === this.props.mirrorVideoHeight;\n const referenceSide = isLandscape ? this.props.mirrorVideoHeight * 0.5 : this.props.mirrorVideoWidth * 0.8;\n const faceSize = {\n width: referenceSide * Math.max(1, this.props.minimumFaceSizeRatio),\n height: referenceSide * Math.max(1.4, (this.props.minimumFaceSizeRatio * 1.4)),\n };\n return faceSize;\n }\n}\n","const toDataURL = (url: string) => {\r\n return fetch(url)\r\n .then(response => response.blob())\r\n .then(blob => {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = reject;\r\n reader.readAsDataURL(blob);\r\n });\r\n });\r\n};\r\n\r\nexport { toDataURL };\r\n","import uuid from 'uuid';\r\nimport { IMockStreamTrack, MockTrackSettings } from './IMockStreamTrack';\r\n\r\nclass MockStreamTrack implements IMockStreamTrack {\r\n public readonly id: string;\r\n public readonly label: string;\r\n private settings: MockTrackSettings;\r\n\r\n constructor() {\r\n this.id = uuid();\r\n this.label = 'mock-stream-track';\r\n this.settings = {};\r\n }\r\n\r\n public getSettings() {\r\n return this.settings;\r\n }\r\n \r\n public stop() {\r\n return;\r\n }\r\n}\r\n\r\nexport { MockStreamTrack };\r\n","import uuid from 'uuid';\r\nimport { IMockStream } from './IMockStream';\r\nimport { MockStreamTrack } from './MockStreamTrack';\r\n\r\nclass MockStream implements IMockStream {\r\n public readonly id: string;\r\n private tracks: MockStreamTrack[] = [];\r\n\r\n constructor(resolution?: any | undefined) {\r\n this.id = uuid();\r\n this.tracks.push(new MockStreamTrack());\r\n }\r\n public getTracks(): any[] {\r\n return this.tracks;\r\n }\r\n public getVideoTracks(): any[] {\r\n return this.tracks;\r\n }\r\n}\r\n\r\nexport { MockStream };\r\n","import { toDataURL } from './ImageLoader';\r\nimport { IMockBridgeMedia } from './IMockBridgeMedia';\r\nimport { MockStream } from './MockStream';\r\n\r\nclass MockBridgeMedia implements IMockBridgeMedia {\r\n\r\n public getUserMedia(constraints: MediaStreamConstraints): Promise {\r\n // const requiredResolution: any = this.getRequiredResolution(constraints);\r\n\r\n return new Promise ((resolve, reject) => {\r\n const videoSrc = localStorage.getItem('vm.mock.videoSrc');\r\n if (videoSrc === null) {\r\n reject(new Error('video src undefined'));\r\n } else {\r\n return toDataURL(\r\n videoSrc\r\n ).then((dataUrl) => {\r\n console.log('RESULT OK');\r\n resolve(new MockStream());\r\n }).catch((e) => {\r\n console.error(e);\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport { MockBridgeMedia };\r\n","// tslint:disable-next-line:interface-name\ndeclare interface NativeBridgeParameters {\n resolution: {\n width: number;\n height: number;\n };\n}\n\nabstract class AbstractNativeBridge {\n public static isNativeBridgePresent: () => boolean;\n public abstract onStartNativeCam: ((resolution: any, error: any) => void) | undefined;\n public abstract onCamFrame: ((base64: string) => void) | undefined;\n public abstract close: () => void;\n public abstract pause: () => void;\n public abstract resume: () => void;\n public abstract start: (requiredResolution: NativeBridgeParameters) => void;\n}\n\nexport { AbstractNativeBridge, NativeBridgeParameters };\n","import { AbstractNativeBridge, NativeBridgeParameters } from './AbstractNativeBridge';\n\ndeclare global {\n // tslint:disable-next-line:interface-name\n interface Window {\n webkit: any;\n NativeBridge: NativeBridge;\n }\n}\n\nclass NativeBridge extends AbstractNativeBridge {\n\n public static isNativeBridgePresent(): boolean {\n return (\n typeof window.webkit === 'object' &&\n typeof(window.webkit.messageHandlers) === 'object' &&\n typeof(window.webkit.messageHandlers.startNativeCam) === 'object'\n );\n }\n\n public onStartNativeCam: ((resolution: any, error: any) => void) | undefined;\n public onCamFrame: ((base64: string) => void) | undefined;\n\n public close = (): void => {\n window.webkit.messageHandlers.closeNativeCam.postMessage(undefined);\n }\n\n public start = (requiredResolution: NativeBridgeParameters): void => {\n window.webkit.messageHandlers.startNativeCam.postMessage(requiredResolution);\n }\n\n public pause = (): void => {\n // in old versions of native bridge there's no pause/resume support\n if (window.webkit.messageHandlers.pauseNativeCam) {\n window.webkit.messageHandlers.pauseNativeCam.postMessage(undefined);\n }\n }\n\n public resume = (): void => {\n // in old versions of native bridge there's no pause/resume support\n if (window.webkit.messageHandlers.resumeNativeCam) {\n window.webkit.messageHandlers.resumeNativeCam.postMessage(undefined);\n }\n }\n}\n\nexport { NativeBridge };\n","import uuid from 'uuid';\nimport { INativeStreamTrack, NativeTrackSettings } from './INativeStreamTrack';\n\nclass NativeStreamTrack implements INativeStreamTrack {\n public readonly id: string;\n public readonly label: string;\n private settings: NativeTrackSettings;\n\n constructor(resolution: {width: number, height: number}) {\n this.id = uuid();\n this.label = 'native-stream-track';\n this.settings = {\n height: resolution.height,\n width: resolution.width,\n };\n }\n public getSettings() {\n return this.settings;\n }\n public stop() {\n window.NativeBridge.close();\n }\n}\n\nexport { NativeStreamTrack };\n","import uuid from 'uuid';\r\nimport { INativeStream } from './INativeStream';\r\nimport { NativeStreamTrack } from './NativeStreamTrack';\r\n\r\nclass NativeStream implements INativeStream {\r\n public readonly id: string;\r\n private tracks: NativeStreamTrack[] = [];\r\n\r\n constructor(resolution?: any | undefined) {\r\n this.id = uuid();\r\n this.tracks.push(new NativeStreamTrack(resolution));\r\n }\r\n\r\n public getTracks(): any[] {\r\n return this.tracks;\r\n }\r\n\r\n public getVideoTracks(): any[] {\r\n return this.tracks;\r\n }\r\n}\r\n\r\nexport { NativeStream };\r\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../../package.json';\nimport { NativeBridgeParameters } from './AbstractNativeBridge.js';\nimport { INativeBridgeMedia } from './INativeBridgeMedia';\nimport { NativeBridge } from './NativeBridge';\nimport { NativeStream } from './NativeStream';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'NativeBridgeMedia');\n\nclass NativeBridgeMedia implements INativeBridgeMedia {\n private remoteLog = new RemoteLog();\n\n public getUserMedia(constraints: MediaStreamConstraints): Promise {\n logger.info('opening Native Camera with {}', JSON.stringify(constraints));\n\n const requiredResolution: any = this.getRequiredResolution(constraints);\n\n return new Promise ((resolve, reject) => {\n window.NativeBridge = new NativeBridge();\n window.NativeBridge.start(requiredResolution);\n window.NativeBridge.onStartNativeCam = (resolution: any, error: any) => {\n if (error) {\n const message = 'Error starting Native Camera -> ' + JSON.stringify(error);\n logger.error(message);\n this.remoteLog.sendAppViewSession({\n statusCode: 'webcam-stream-error',\n statusText: message,\n });\n reject(error);\n } else {\n logger.info('Started Native Camera');\n this.remoteLog.sendAppViewSession({\n statusCode: 'webcam-stream',\n statusText: 'Started Native Camera',\n });\n resolve(new NativeStream(resolution));\n }\n window.NativeBridge.onStartNativeCam = undefined;\n };\n });\n }\n\n private getRequiredResolution(constraints: MediaStreamConstraints): NativeBridgeParameters | null {\n // tslint:disable-next-line:no-unnecessary-initializer\n let requiredResolution: NativeBridgeParameters | null = null;\n\n if (constraints &&\n constraints.video &&\n typeof (constraints.video) !== 'boolean' &&\n constraints.video.width &&\n constraints.video.height) {\n const width = (typeof (constraints.video.width) === 'number') ?\n constraints.video!.width :\n constraints.video.width.ideal;\n\n const height = (typeof (constraints.video.height) === 'number') ?\n constraints.video!.height :\n constraints.video.height.ideal;\n\n requiredResolution = {\n resolution: {\n height: height!,\n width: width!,\n },\n };\n }\n return requiredResolution;\n }\n}\n\nexport { NativeBridgeMedia };\n","import { MockBridgeMedia } from '../mockWebcam/MockBridgeMedia';\r\nimport { NativeBridgeMedia } from '../nativeWebcam/NativeBridgeMedia';\r\nimport { IUserMedia } from './IUserMedia';\r\nimport { WebCamStream } from './WebCamStream';\r\n\r\nclass UserMedia implements IUserMedia {\r\n private userMedia: any;\r\n private readonly mockOptionName = 'vm.mock.video';\r\n\r\n constructor() {\r\n\r\n if (localStorage.getItem(this.mockOptionName) === 'true') { // mock enabled\r\n this.userMedia = new MockBridgeMedia();\r\n } else {\r\n this.userMedia = navigator.mediaDevices || new NativeBridgeMedia();\r\n }\r\n }\r\n\r\n public get(): MediaDevices | NativeBridgeMedia | MockBridgeMedia {\r\n return this.userMedia;\r\n }\r\n}\r\n\r\nexport { UserMedia };\r\n","import { toDataURL } from './ImageLoader';\r\nimport { MockStream } from './MockStream';\r\n\r\nclass MockVideoStream {\r\n\r\n private videoSrc: string;\r\n\r\n private imageElement: HTMLImageElement;\r\n private privateCurrentTime = 0;\r\n private mediaStream: MockStream;\r\n\r\n private playingListener: any[] = [];\r\n\r\n public get currentTime(): number {\r\n this.privateCurrentTime++;\r\n return this.privateCurrentTime;\r\n }\r\n\r\n public get videoWidth(): number {\r\n return this.imageElement?.naturalWidth;\r\n }\r\n\r\n public get videoHeight(): number {\r\n return this.imageElement?.naturalHeight;\r\n }\r\n\r\n public get defaultMuted(): boolean {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, defaultMuted will always return true');\r\n return true;\r\n }\r\n\r\n public set defaultMuted(value: boolean) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, is not possible to set mute a video stream');\r\n }\r\n\r\n public get width(): number {\r\n return this.imageElement.naturalWidth;\r\n }\r\n\r\n public set width(value: number) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, not possible to set image width');\r\n }\r\n\r\n public get height(): number {\r\n return this.imageElement.naturalHeight;\r\n }\r\n\r\n public set height(value: number) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, not possible to set image height');\r\n }\r\n\r\n constructor(\r\n options: {\r\n target: string,\r\n id?: string,\r\n className?: string,\r\n }\r\n ) {\r\n\r\n const videoSrc = localStorage.getItem('vm.mock.videoSrc');\r\n if (!!videoSrc) {\r\n this.videoSrc = videoSrc;\r\n } else {\r\n throw new Error('no video src defined');\r\n }\r\n\r\n const targetElement = document.getElementById(options.target);\r\n if (!targetElement) {\r\n throw new Error('Impossible to start mock video on undefined element -> ' + options.target);\r\n }\r\n\r\n this.mediaStream = new MockStream();\r\n this.imageElement = new Image();\r\n this.imageElement.id = options.id || '';\r\n this.imageElement.className = options.className || '';\r\n\r\n targetElement.appendChild(this.imageElement);\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public addEventListener(\r\n type: string,\r\n listener: EventListenerOrEventListenerObject | any,\r\n options?: boolean | AddEventListenerOptions | undefined\r\n ) {\r\n if (type === 'playing') {\r\n this.playingListener.push(listener);\r\n } else {\r\n listener();\r\n }\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public removeEventListener(\r\n type: string, listener: EventListenerOrEventListenerObject,\r\n options?: boolean | EventListenerOptions | undefined\r\n ) {\r\n if (type === 'playing') {\r\n this.playingListener = [];\r\n }\r\n }\r\n\r\n public play(): Promise {\r\n return new Promise((resolve, reject) => {\r\n this.waitForFrame().then(() => {\r\n for (const listener of this.playingListener) {\r\n listener();\r\n }\r\n resolve();\r\n }).catch(() => {\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n public pause(): void {\r\n console.debug('This is a mock context, not possible to pause');\r\n\r\n }\r\n\r\n public close(): void {\r\n console.debug('This is a mock context, not possible to close');\r\n }\r\n\r\n public get image() {\r\n return this.imageElement;\r\n }\r\n\r\n private waitForFrame(): Promise {\r\n return toDataURL(this.videoSrc).then((imgData) => {\r\n try {\r\n this.imageElement.setAttribute('src', imgData as string);\r\n } catch (error) {\r\n throw error;\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport { MockVideoStream };\r\n","import { NativeStream } from './NativeStream';\n\nclass NativeVideoStream {\n private imageElement: any;\n private privateCurrentTime = 0;\n private mediaStream: NativeStream;\n\n private playingListener: any[] = [];\n\n public get currentTime(): number {\n return this.privateCurrentTime;\n }\n\n public get videoWidth(): number {\n return this.imageElement.width;\n }\n\n public get videoHeight(): number {\n return this.imageElement.height;\n }\n\n public get defaultMuted(): boolean {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, defaultMuted will always return true');\n return true;\n }\n\n public set defaultMuted(value: boolean) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, is not possible to set mute a video stream');\n }\n\n public get width(): number {\n return this.imageElement.width;\n }\n\n public set width(value: number) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, not possible to set image width');\n }\n\n public get height(): number {\n return this.imageElement.height;\n }\n\n public set height(value: number) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, not possible to set image height');\n }\n\n constructor(options: {\n target: string,\n id?: string,\n className?: string,\n },\n mediaStream: NativeStream) {\n\n this.mediaStream = mediaStream;\n this.imageElement = new Image();\n\n this.imageElement.width = this.mediaStream.getVideoTracks()[0].getSettings().width;\n this.imageElement.height = this.mediaStream.getVideoTracks()[0].getSettings().height;\n\n window.NativeBridge.onCamFrame = (base64: string) => {\n this.imageElement.src = base64;\n };\n }\n\n // tslint:disable-next-line:max-line-length\n public addEventListener(type: string, listener: EventListenerOrEventListenerObject | any, options?: boolean | AddEventListenerOptions | undefined) {\n if (type === 'playing') {\n this.playingListener.push(listener);\n } else {\n listener();\n }\n }\n\n // tslint:disable-next-line:max-line-length\n public removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined) {\n if (type === 'playing') {\n this.playingListener = [];\n }\n // mock\n }\n\n public play(): Promise {\n return new Promise((resolve, reject) => {\n window.NativeBridge.resume();\n this.waitForFrame()\n .then(() => {\n this.startTimeCounter();\n for (const listener of this.playingListener) {\n listener();\n }\n resolve();\n })\n .catch(() => {\n reject();\n });\n });\n }\n\n public pause(): void {\n window.NativeBridge.pause();\n }\n\n public close(): void {\n window.NativeBridge.close();\n }\n\n public get image() {\n return this.imageElement;\n }\n\n private waitForFrame(): Promise {\n return new Promise((resolve, reject) => {\n this.imageElement.onload = () => {\n resolve();\n };\n this.imageElement.onerror = () => {\n reject();\n };\n });\n }\n\n private startTimeCounter() {\n this.imageElement.onload = () => { this.privateCurrentTime++; };\n }\n}\n\nexport { NativeVideoStream };\n","declare global {\n // tslint:disable-next-line:interface-name\n interface Element {\n setAttribute(name: string, value: null): void;\n }\n}\n\nclass WebCamVideoStream {\n private video: HTMLVideoElement;\n\n public get currentTime(): number {\n return this.video.currentTime;\n }\n\n public get videoWidth(): number {\n return this.video.videoWidth;\n }\n\n public get videoHeight(): number {\n return this.video.videoHeight;\n }\n\n public get defaultMuted(): boolean {\n return this.video.defaultMuted;\n }\n\n public set defaultMuted(value: boolean) {\n this.video.defaultMuted = value;\n }\n\n public get width(): number {\n return this.video.width;\n }\n\n public set width(value: number) {\n this.video.width = value;\n }\n\n public get height(): number {\n return this.video.height;\n }\n\n public set height(value: number) {\n this.video.height = value;\n }\n\n constructor(options: {\n target: string,\n id?: string,\n className?: string,\n },\n mediaStream: MediaStream) {\n\n const targetElement = document.getElementById(options.target);\n if (!targetElement) {\n throw new Error('Impossible to start video on undefined element -> ' + options.target);\n }\n this.video = document.createElement('video');\n this.video.id = options.id || '';\n this.video.className = options.className || '';\n this.video.muted = true;\n this.video.setAttribute('playsinline', null);\n this.video.srcObject = mediaStream;\n\n targetElement.appendChild(this.video);\n }\n\n // tslint:disable-next-line:max-line-length\n public addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined) {\n this.video.addEventListener(type, listener, options);\n }\n\n // tslint:disable-next-line:max-line-length\n public removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined) {\n this.video.removeEventListener(type, listener, options);\n }\n\n public play(): Promise {\n return this.video.play();\n }\n\n public pause(): void {\n this.video.pause();\n }\n\n public get image() {\n return this.video;\n }\n}\n\nexport { WebCamVideoStream };\n","import { MockVideoStream } from '../mockWebcam/MockVideoStream';\r\nimport { NativeStream } from '../nativeWebcam/NativeStream';\r\nimport { NativeVideoStream } from '../nativeWebcam/NativeVideoStream';\r\nimport { WebCamVideoStream } from './WebCamVideoStream';\r\n\r\nclass WebCamStream {\r\n private readonly mockOptionName = 'vm.mock.video';\r\n private privateStreamObject: WebCamVideoStream | NativeVideoStream | MockVideoStream;\r\n\r\n constructor( \r\n options: {\r\n target: string,\r\n id?: string,\r\n className?: string,\r\n },\r\n stream: MediaStream | NativeStream\r\n ) {\r\n if (this.isMockStream()) {\r\n this.privateStreamObject = new MockVideoStream(options);\r\n } else if (this.isMediaStream(stream)) {\r\n this.privateStreamObject = new WebCamVideoStream(options, stream as MediaStream);\r\n } else {\r\n this.privateStreamObject = new NativeVideoStream(options, stream as NativeStream);\r\n }\r\n }\r\n\r\n public get streamObject(): WebCamVideoStream | NativeVideoStream | MockVideoStream {\r\n return this.privateStreamObject;\r\n }\r\n\r\n public close() {\r\n if (this.privateStreamObject.constructor.name === WebCamVideoStream.name) {\r\n this.privateStreamObject.pause();\r\n } else {\r\n (this.privateStreamObject as NativeVideoStream).close();\r\n }\r\n }\r\n\r\n public isMockStream(): boolean {\r\n return localStorage.getItem(this.mockOptionName) === 'true';\r\n }\r\n\r\n public isNativeStream(): boolean {\r\n return this.privateStreamObject.constructor.name === NativeStream.name;\r\n }\r\n\r\n private isMediaStream(stream: MediaStream | NativeStream): boolean {\r\n return stream.constructor.name === MediaStream.name;\r\n }\r\n}\r\n\r\nexport { WebCamStream };\r\n","import { CameraFacingMode } from './CameraFacingMode';\n\nconst defaultContraints = {\n audio: false,\n video: {\n facingMode: 'user',\n height: { ideal: 720, max: 1080 },\n width: { ideal: 1280, max: 1920 },\n },\n};\n\nconst cameraBlackList = [\n 'Snap Camera',\n];\n\nclass WebCamConstraints {\n\n public static getConstraints(\n w: number,\n h: number,\n cameraFacingMode: CameraFacingMode,\n ): Promise {\n return WebCamConstraints.getDeviceIdConstraints().then((deviceIds) => {\n return {\n ...defaultContraints,\n audio: false,\n video: {\n deviceId: deviceIds,\n facingMode: cameraFacingMode,\n height: { ...defaultContraints.video.height, ideal: h },\n width: { ...defaultContraints.video.width, ideal: w },\n },\n };\n });\n }\n\n // Filter out blacklisted cameras, for example we don't use want to use Snap Camera\n // The method leverage on navigator.mediaDevices and\n // there are two possible reasons for navigator.mediaDevices to not available:\n // 1 - the browser does not support webcams\n // 2 - the browser got a NativeBridge available\n // both points are handled by errors and NativeBridge so should be safe to return undefined in such cases\n private static getDeviceIdConstraints(): Promise {\n return navigator.mediaDevices && navigator.mediaDevices.enumerateDevices().then((devices) => {\n return devices.filter((device) => {\n return device.kind === 'videoinput' && !cameraBlackList.includes(device.label);\n }).map((device) => device.deviceId);\n }) || Promise.resolve(undefined);\n }\n}\n\nexport { WebCamConstraints, defaultContraints };\n","abstract class WebCamAbstractError extends Error {\n public type: string;\n\n constructor(type: string, message: string, error?: Error) {\n super(message);\n this.type = type;\n this.name = type;\n this.message = message;\n this.stack = error?.stack;\n\n Object.setPrototypeOf(this, WebCamAbstractError.prototype);\n }\n}\n\nexport { WebCamAbstractError };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessNotFoundError extends WebCamAbstractError {\n public static type = 'WebCamAccessNotFoundError';\n\n constructor(error?: Error) {\n super(WebCamAccessNotFoundError.type, 'webcam not found', error);\n Object.setPrototypeOf(this, WebCamAccessNotFoundError.prototype);\n }\n}\n\nexport { WebCamAccessNotFoundError };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessRejectedError extends WebCamAbstractError {\n public static type = 'WebCamAccessRejectedError';\n\n constructor(error?: Error) {\n super(WebCamAccessRejectedError.type, 'webcam access was rejected', error);\n Object.setPrototypeOf(this, WebCamAccessRejectedError.prototype);\n }\n}\n\nexport { WebCamAccessRejectedError };\n","enum AppViewSessionKeys {\n WEBCAM_OK = 'vm-webcam-ok',\n WEBCAM_KO = 'vm-webcam-ko',\n WEBCAM_KO_REASON_MESS = 'vm-webcam-ko_reason_mess',\n WEBCAM_SIZE_W = '_webcam_size_w',\n WEBCAM_SIZE_H = '_webcam_size_h',\n WEBCAM_FRAMERATE = '_webcam_framerate',\n WEBCAM_OPENED = '_webcam_opened',\n WEBCAM_CLOSED = '_webcam_closed',\n WEBCAM_OPENING = '_webcam_opening',\n WEBCAM_OPENING_TIME = '_webcam_opening_time_s',\n WEBCAM_POWERED_TIME = '_webcam_powered_time_s',\n}\n\nexport { AppViewSessionKeys };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessSystemError extends WebCamAbstractError {\n public static type = 'WebCamAccessSystemError';\n\n constructor(error?: Error) {\n super(WebCamAccessSystemError.type, 'webcam access was rejected', error);\n Object.setPrototypeOf(this, WebCamAccessSystemError.prototype);\n }\n}\n\nexport { WebCamAccessSystemError };\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\r\nimport { name, version } from '../package.json';\r\nimport { UserMedia } from './domain/adapter/UserMedia';\r\nimport { WebCamStream } from './domain/adapter/WebCamStream';\r\nimport { CameraFacingMode } from './domain/CameraFacingMode';\r\nimport { MockStream } from './domain/mockWebcam/MockStream';\r\nimport { NativeStream } from './domain/nativeWebcam/NativeStream';\r\nimport { NativeStreamTrack } from './domain/nativeWebcam/NativeStreamTrack';\r\nimport { WebCamConstraints } from './domain/WebCamConstraints';\r\nimport { WebCamAbstractError } from './error/WebCamAbstractError';\r\nimport { WebCamAccessNotFoundError } from './error/WebCamAccessNotFoundError';\r\nimport { WebCamAccessRejectedError } from './error/WebCamAccessRejectedError';\r\nimport { WebCamAccessSystemError } from './error/WebCamAccessSystemError';\r\nimport { AppViewSessionKeys } from './remotelog/AppViewSessionKeys';\r\n\r\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'WebCam');\r\n\r\nclass WebCam {\r\n\r\n private remoteLog = new RemoteLog();\r\n\r\n private userMediaPromise: Promise | undefined;\r\n private userReqPermissionTime = 0;\r\n private userResPermissionTime = 0;\r\n\r\n public tryToOpenWebCam(\r\n w: number,\r\n h: number,\r\n cameraFacingMode: CameraFacingMode,\r\n ): Promise {\r\n return new Promise((resolve, reject) => {\r\n WebCamConstraints.getConstraints(w, h, cameraFacingMode).then((constraints) => {\r\n this.tryToOpen(constraints)\r\n .then((mediaStream) => resolve(mediaStream))\r\n .catch((reason) => {\r\n switch (reason.name) {\r\n case 'AbortError':\r\n case 'NotReadableError':\r\n reject(new WebCamAccessSystemError());\r\n case 'NotFoundError':\r\n case 'TypeError':\r\n case 'OverconstrainedError':\r\n reject(new WebCamAccessNotFoundError());\r\n case 'NotAllowedError':\r\n case 'SecurityError':\r\n reject(new WebCamAccessRejectedError());\r\n default:\r\n reject(new WebCamAccessSystemError());\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n public closeCurrentMediaStream(): void {\r\n if (this.userMediaPromise) {\r\n this.userMediaPromise.then((mediaStream) => {\r\n try {\r\n mediaStream.getTracks().forEach((track: MediaStreamTrack | NativeStreamTrack) => {\r\n const totalWebCamTime = this.streamOpenedTotalTime();\r\n logger.info('closing webcam mediastream {} track {} [after {} secs]',\r\n mediaStream.id, track.label, totalWebCamTime);\r\n track.stop();\r\n this.logCloseSucc(mediaStream.id, totalWebCamTime);\r\n });\r\n } catch (error) {\r\n logger.warn('error closing mediastream {} tracks', mediaStream.id);\r\n }\r\n }).catch((reason) => {\r\n logger.warn('error closing mediastream: {}', reason);\r\n });\r\n }\r\n }\r\n\r\n public listMediaDevices() {\r\n const devices = navigator.mediaDevices.enumerateDevices();\r\n devices.then((devicesInfo) => {\r\n devicesInfo.forEach((deviceInfo) => {\r\n logger.info('found {}: {}', deviceInfo.deviceId, deviceInfo.label);\r\n });\r\n });\r\n }\r\n\r\n public createStreamObject(\r\n options: { target: string, id?: string, className?: string },\r\n stream: MediaStream | NativeStream,\r\n ): WebCamStream {\r\n return new WebCamStream(options, stream);\r\n }\r\n\r\n private tryToOpen(\r\n constraints: MediaStreamConstraints,\r\n ): Promise {\r\n\r\n logger.info('try to open webcam fow with constraints {}', JSON.stringify(constraints));\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_OPENING,\r\n statusText: JSON.stringify(constraints),\r\n },\r\n );\r\n\r\n this.userReqPermissionTime = performance.now();\r\n this.userMediaPromise = new UserMedia().get().getUserMedia(constraints);\r\n\r\n this.userMediaPromise.then((mediaStream) => {\r\n this.userResPermissionTime = performance.now();\r\n\r\n const permissionWaitingTime = this.permissionWaitingTime();\r\n logger.info('webcam opened in {} secs [mediastream id: {}]', permissionWaitingTime, mediaStream.id);\r\n\r\n this.logOpenSucc(mediaStream.id, permissionWaitingTime);\r\n\r\n mediaStream.getVideoTracks().map((track) => {\r\n this.logTrackSettings(track);\r\n });\r\n\r\n }).catch((reason: any) => { // TODO: MediaStreamError has been depricated\r\n logger.warn('webcam not opened after {} secs ([{}] {})',\r\n this.permissionWaitingTime(), reason.name, reason.message);\r\n if (reason.constraintName) {\r\n logger.warn('failed constraint: {}' + reason.constraintName);\r\n }\r\n this.logOpenFail(reason);\r\n });\r\n\r\n return this.userMediaPromise;\r\n }\r\n\r\n private logCloseSucc(mediaStreamId: string, totalWebCamTime: number) {\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_CLOSED,\r\n statusText: mediaStreamId,\r\n },\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_POWERED_TIME,\r\n statusText: totalWebCamTime ? totalWebCamTime.toFixed(2) : 'n.a.',\r\n },\r\n );\r\n }\r\n\r\n private logOpenSucc(mediaStreamId: string, permissionWaitingTime: number) {\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK,\r\n statusText: mediaStreamId,\r\n },\r\n );\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_OPENING_TIME,\r\n statusText: permissionWaitingTime ? permissionWaitingTime.toFixed(2) : 'n.a.',\r\n },\r\n );\r\n }\r\n\r\n private logOpenFail(reason: any) { // TODO: MediaStreamError has been depricated\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_KO,\r\n statusText: reason.name,\r\n },\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_KO_REASON_MESS,\r\n statusText: reason.name + ': ' + reason.message,\r\n },\r\n );\r\n }\r\n\r\n private logTrackSettings(track: MediaStreamTrack | NativeStreamTrack) {\r\n if (track && track.getSettings()) {\r\n const deviceW = track.getSettings().width;\r\n const deviceH = track.getSettings().height;\r\n const wcamfps = track.getSettings().frameRate;\r\n logger.info('webcam mediastream track available \\'{}\\' [id {} - w {} - h {} - framerate {}]',\r\n track.label, track.id, deviceW, deviceH, wcamfps);\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_SIZE_W,\r\n statusText: deviceW ? deviceW.toString() : 'n.a.',\r\n }, {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_SIZE_H,\r\n statusText: deviceH ? deviceH.toString() : 'n.a.',\r\n }, {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_FRAMERATE,\r\n statusText: wcamfps ? Math.round(wcamfps).toString() : 'n.a.',\r\n },\r\n );\r\n }\r\n }\r\n\r\n private streamOpenedTotalTime(): number {\r\n return this.userResPermissionTime === 0 ? 0 : (performance.now() - this.userResPermissionTime) / 1000;\r\n }\r\n\r\n private permissionWaitingTime(): number {\r\n return this.userReqPermissionTime === 0 ? 0 : (performance.now() - this.userReqPermissionTime) / 1000;\r\n }\r\n\r\n}\r\n\r\nexport {\r\n WebCam,\r\n WebCamAbstractError,\r\n WebCamAccessNotFoundError,\r\n WebCamAccessRejectedError,\r\n WebCamAccessSystemError,\r\n WebCamStream,\r\n NativeStream,\r\n CameraFacingMode,\r\n};\r\n","/**\n * This method can be used to download and load in memory heavy parts of VM libraries, like for example the pose estimation webassembly\n * It does not return a promise even if internally it will produce some network calls.\n * You can call this method when your page is ready for the interactions.\n * @param environment 'STAGING' | 'ACCEPTANCE' | 'PRODUCTION'\n */\nexport const warmUp: (environment: MicroserviceEnvironment, key?: string) => void = (environment, key) => {\n if (!environment) {\n environment = 'PRODUCTION';\n }\n import('@luxottica/vm-posetracker-faceweb')\n .then(({PoseTracker}) => {\n PoseTracker.warmUp({environment: environment == 'PRODUCTION' ? 'PRODUCTION' : 'TEST'});\n });\n\n // this part tries to initialise and download huge part of automatic plugins (eg glasses removal)\n // we are betting that having the automatic plugins early initialised would lead to better loading time in some cases\n if (!key) { return; }\n import('../service/FeatureLicensingService')\n .then(({ FeatureLicensingService }) => {\n return FeatureLicensingService.initialize(\n key,\n environment\n );\n })\n .then(() => {\n import('./Plugins')\n .then(({PluginManager}) => {\n PluginManager.addAutomaticEffects();\n });\n });\n };\n","import { Features } from '../interfaces/Features';\n\nclass VtoError extends Error {\n public type: string;\n public adobeErrorParameters: AdobeErrorParameters;\n\n constructor(type: string, errorSource: ErrorSource, message: string) {\n super(message);\n this.type = type;\n this.message = message;\n this.adobeErrorParameters = {\n errorSource: errorSource,\n errorCode: `Vm - ${type}`,\n errorDetails: message\n };\n\n Object.setPrototypeOf(this, VtoError.prototype);\n }\n}\n\nclass InitializationError extends VtoError {\n public static type = 'InitializationError';\n\n constructor() {\n super(InitializationError.type, 'Client', 'failed to initialize component');\n Object.setPrototypeOf(this, InitializationError.prototype);\n }\n}\n\nclass NotInitializedError extends VtoError {\n public static type = 'NotInitializedError';\n\n constructor() {\n super(NotInitializedError.type, 'Client', 'VirtualMirror must be initialized before rendering');\n Object.setPrototypeOf(this, NotInitializedError.prototype);\n }\n}\n\nclass InvalidParametersError extends VtoError {\n public static type = 'InvalidParametersError';\n\n constructor(parameter: string, value: string) {\n super(InvalidParametersError.type, 'Client', `'${parameter}: ${value}' parameter is invalid`);\n Object.setPrototypeOf(this, InvalidParametersError.prototype);\n }\n}\n\nclass InvalidLocaleError extends VtoError {\n public static type = 'InvalidLocaleError';\n\n constructor(locale: string) {\n super(InvalidLocaleError.type, 'Client', `invalid locale: ${locale} - supported format: aa-BB`);\n Object.setPrototypeOf(this, InvalidLocaleError.prototype);\n }\n}\n\nclass RenderingError extends VtoError {\n public static type = 'RenderingError';\n\n constructor(readonly upc: string) {\n super(RenderingError.type, 'Client', `upc ${upc} failed to successfully render`);\n Object.setPrototypeOf(this, RenderingError.prototype);\n }\n}\n\nclass UpcSupportedError extends VtoError {\n public static type = 'UpcSupportedError';\n\n constructor(readonly upc: string) {\n super(UpcSupportedError.type, 'Server', `failed to determine if upc ${upc} is supported`);\n Object.setPrototypeOf(this, UpcSupportedError.prototype);\n }\n}\n\nclass UpcMissingError extends VtoError {\n public static type = 'UpcMissingError';\n\n constructor(readonly upc: string) {\n super(UpcMissingError.type, 'Server', `upc ${upc} could not be found`);\n Object.setPrototypeOf(this, UpcMissingError.prototype);\n }\n}\n\nclass MountComponentError extends VtoError {\n public static type = 'MountComponentError';\n\n constructor(divId: string) {\n super(MountComponentError.type, 'Client', `failed to mount component at divId: ${divId}`);\n Object.setPrototypeOf(this, MountComponentError.prototype);\n }\n}\n\nclass UnmountComponentError extends VtoError {\n public static type = 'UnmountComponentError';\n\n constructor(divId: string) {\n super(UnmountComponentError.type, 'Client', `failed to unmount component at divId: ${divId}`);\n Object.setPrototypeOf(this, UnmountComponentError.prototype);\n }\n}\n\nclass WebcamUnavailableError extends VtoError {\n public static type = 'WebcamUnavailableError';\n\n constructor() {\n super(WebcamUnavailableError.type, 'User', 'webcam support could not be found');\n this.adobeErrorParameters.errorCode = 'Vm - WebcamNotFoundError';\n Object.setPrototypeOf(this, WebcamUnavailableError.prototype);\n }\n}\n\nclass WebcamRejectedError extends VtoError {\n public static type = 'WebcamRejectedError';\n\n constructor() {\n super(WebcamRejectedError.type, 'User', 'webcam access was rejected by user');\n Object.setPrototypeOf(this, WebcamRejectedError.prototype);\n }\n}\n\nclass OpacityError extends VtoError {\n public static type = 'OpacityError';\n\n constructor(message: string) {\n super(OpacityError.type, 'Client', message);\n Object.setPrototypeOf(this, OpacityError.prototype);\n }\n}\n\nclass AnimationError extends VtoError {\n public static type = 'AnimationError';\n\n constructor(message: string) {\n super(AnimationError.type, 'Client', message);\n Object.setPrototypeOf(this, AnimationError.prototype);\n }\n}\n\nclass MissingAuthKeyError extends VtoError {\n public static type = 'MissingAuthKeyError';\n\n constructor() {\n super(MissingAuthKeyError.type, 'Client', 'Virtual Mirror requires a key to work');\n Object.setPrototypeOf(this, MissingAuthKeyError.prototype);\n }\n}\n\nclass FeatureInitializationError extends VtoError {\n public static type = 'FeatureInitializationError';\n\n constructor() {\n super(FeatureInitializationError.type, 'Client', 'Virtual Mirror feature service failed to initialize');\n Object.setPrototypeOf(this, FeatureInitializationError.prototype);\n }\n}\n\nclass FeatureUnavailableError extends VtoError {\n public static type = 'FeatureUnavailableError';\n\n constructor(feature: Features) {\n super(FeatureUnavailableError.type, 'Client', `feature ${feature} is not available for this client`);\n Object.setPrototypeOf(this, FeatureUnavailableError.prototype);\n }\n}\n\nclass FeatureUndefinedError extends VtoError {\n public static type = 'FeatureUndefinedError';\n\n constructor() {\n super(FeatureUndefinedError.type, 'Client', 'Can\\'t get auth for undefined feature');\n Object.setPrototypeOf(this, FeatureUndefinedError.prototype);\n }\n}\n\nclass FeatureServerError extends VtoError {\n public static type = 'FeatureServerError';\n\n constructor(e) {\n super(FeatureServerError.type, 'Server', e.message);\n Object.setPrototypeOf(this, FeatureServerError.prototype);\n }\n}\n\nexport {\n VtoError,\n InitializationError,\n InvalidParametersError,\n InvalidLocaleError,\n NotInitializedError,\n RenderingError,\n UpcSupportedError,\n UpcMissingError,\n MountComponentError,\n UnmountComponentError,\n WebcamUnavailableError,\n WebcamRejectedError,\n OpacityError,\n AnimationError,\n MissingAuthKeyError,\n FeatureInitializationError,\n FeatureUnavailableError,\n FeatureUndefinedError,\n FeatureServerError,\n};\n","import { InitializationOptions } from '../interfaces/InitializationTypes';\n\nexport const DefaultInitializationOptions: InitializationOptions = {\n key: undefined,\n analyticsConfig: {},\n brand: undefined,\n channel: undefined,\n storeId: undefined,\n locale: 'en-US',\n environment: 'PRODUCTION',\n sessionTimeout: false\n};\n","import { Features } from '../interfaces/Features';\n\nconst VM_SKIP_AKAMAI_LICENSING_FLAG = 'vm.akamai.licensing.skip';\n(window as any).VMAkamaiLicensingFlag = VM_SKIP_AKAMAI_LICENSING_FLAG;\n\nconst config = {\n STAGING: {\n get baseUrl() {\n if (overrideAkamai()) {\n return 'https://test-gateway-vtoprofile.luxdeepblue.com/services/vtomoduleprotection/public/v1/';\n } else {\n return 'https://test-gateway-vtoprofile.luxdeepblue.com/services/vtomoduleprotection/public/v1/';\n }\n },\n getAllFeaturesPath: 'get-functionalities/',\n getKeyAuthorizationPath: 'key-authorized/',\n },\n ACCEPTANCE: {\n get baseUrl() {\n // tslint:disable-next-line: no-console\n console.warn('backoffice for feature licensing development env will be changed soon');\n if (overrideAkamai()) {\n return 'https://acceptance-gateway-vtoprofile.luxdeepblue.com/services/vtomoduleprotection/public/v1/';\n } else {\n return 'https://vmcore-test.luxottica.com/services/vtomoduleprotection/public/v1/';\n }\n },\n getAllFeaturesPath: 'get-functionalities/',\n getKeyAuthorizationPath: 'key-authorized/',\n },\n PRODUCTION: {\n get baseUrl() {\n if (overrideAkamai()) {\n return 'https://gateway-vtoprofile.luxdeepblue.com/services/vtomoduleprotection/public/v1/';\n } else {\n return 'https://vmcore.luxottica.com/services/vtomoduleprotection/public/v1/';\n }\n },\n getAllFeaturesPath: 'get-functionalities/',\n getKeyAuthorizationPath: 'key-authorized/',\n }\n};\n\nconst defaultFeatures: Map = new Map([]);\n\nconst overrideAkamai = (): boolean => {\n if (!!window && !!window.localStorage) {\n return window.localStorage.getItem(VM_SKIP_AKAMAI_LICENSING_FLAG) === 'true';\n } else {\n return false;\n }\n};\n\nconst getFeatureConfig = (environment: MicroserviceEnvironment) => {\n return config[environment];\n};\n\nexport {\n getFeatureConfig,\n defaultFeatures,\n};\n","enum Features {\n VM_TRANSITIONS = 'VM_TRANSITIONS',\n VM_SCREENSHOT = 'VM_SCREENSHOT',\n VM_MOVE_GLASSES = 'VM_MOVE_GLASSES',\n VM_ANALYTICS = 'VM_ANALYTICS',\n VM_TAP_TO_PAUSE = 'VM_TAP_TO_PAUSE',\n VM_BIPA = 'VM_BIPA',\n VM_GET_BIPA_VERSION = 'VM_GET_BIPA_VERSION',\n VM_SAVE_BIPA_ENTRY = 'VM_SAVE_BIPA_ENTRY',\n VM_SIZE_IMPROVEMENT = 'VM_SIZE_IMPROVEMENT',\n VM_GLOBAL_DEBUG_METHODS = 'VM_GLOBAL_DEBUG_METHODS',\n VM_EFFECTS = 'VM_EFFECTS',\n VM_GLASSES_REMOVAL = 'VM_GLASSES_REMOVAL'\n}\n\nexport {\n Features,\n};\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { MicroserviceEnvironment } from '@luxottica/vto-microservices';\nimport { name, version } from '../../../package.json';\nimport { DefaultInitializationOptions } from '../../constants/DefaultInitializationOptions';\nimport { FeatureInitializationError, FeatureServerError, MissingAuthKeyError } from '../../errors/errors';\nimport { defaultFeatures, getFeatureConfig } from '../../helpers/FeatureConfigHelper';\nimport { Features } from '../../interfaces/Features';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'FeatureLicensingService');\n\nlet isInitialized = false;\nlet currentLicenseKey: string;\nlet currentEnvironment: MicroserviceEnvironment = DefaultInitializationOptions.environment;\nlet featureSupportCache: Map;\n\nconst featureListUrl = (): string => {\n if (currentLicenseKey === undefined) {\n throw new MissingAuthKeyError();\n }\n\n const config = getFeatureConfig(currentEnvironment);\n logger.debug('Getting feature list for key {} using config {}', currentLicenseKey, JSON.stringify(config));\n return `${config.baseUrl}${config.getAllFeaturesPath}${currentLicenseKey}`;\n};\n\nconst getFeatureMap = (): Promise> => {\n return new Promise((resolve, reject) => {\n try {\n const url = featureListUrl();\n resolve(url);\n } catch (e) {\n reject(e);\n }\n\n }).then((url: string) => {\n return fetch(url);\n\n }).then((res) => {\n return (res.ok) ? res.json() : Promise.reject(new FeatureServerError(`${res.status} - ${res.statusText}`));\n\n }).then((json: string[]) => {\n const featureMap = new Map();\n Object.values(Features).forEach((feature) => {\n featureMap.set(feature, json.includes(feature.toString()));\n });\n logger.debug('client feature list has been imported {}', [...featureMap.entries()]);\n return featureMap;\n\n }).catch((e) => {\n const error = (e instanceof MissingAuthKeyError || e instanceof FeatureServerError) ? e : new FeatureServerError(e.message);\n logger.error(error);\n throw error;\n });\n};\n\nconst reset = () => {\n isInitialized = false;\n return getFeatureMap().then((featureMap) => {\n featureSupportCache = featureMap;\n isInitialized = true;\n }).catch((e: Error) => {\n featureSupportCache = defaultFeatures;\n throw e;\n });\n};\n\nconst FeatureLicensingService = {\n initialize: (\n licenseKey: string,\n environment: MicroserviceEnvironment\n ): Promise => {\n\n let shouldReset = false;\n\n if (!isInitialized) {\n shouldReset = true;\n }\n\n if (!!licenseKey && licenseKey !== currentLicenseKey) {\n currentLicenseKey = licenseKey;\n shouldReset = true;\n }\n if (!!environment && environment !== currentEnvironment) {\n currentEnvironment = environment;\n shouldReset = true;\n }\n\n return (shouldReset) ? reset() : Promise.resolve();\n },\n\n isInitialized: (): boolean => { return isInitialized; },\n\n getKey: (): string => {\n return currentLicenseKey;\n },\n\n isFeatureAuthorized(...features: Features[]): boolean {\n if (!!features && !!featureSupportCache) {\n return features.every(feature => !!featureSupportCache.get(feature));\n } else {\n throw new FeatureInitializationError();\n }\n }\n};\n\nexport {\n FeatureLicensingService\n};\n","import { AnyAction, Store } from 'redux';\nimport { configureStore, RootState } from '../Store';\n\nlet VmStore: Store;\n\nconst vmIsInitialized = (): boolean => {\n return VmStore !== undefined && VmStore.getState().app.loading.INITIALIZATION === true;\n};\n\nconst configureVmStore = () => {\n VmStore = configureStore();\n};\n\nexport {\n VmStore,\n vmIsInitialized,\n configureVmStore\n};\n","export const SET_ENVIRONMENT = 'SET_ENVIRONMENT';\nexport const SET_AUTH = 'SET_AUTH';\nexport const RESET_AUTH = 'RESET_AUTH';\n\nexport const SET_LOADING_STATUS = 'SET_LOADING_STATUS';\nexport const SET_PRIVACY_OPTIONS = 'SET_PRIVACY_OPTIONS';\n\nexport const SET_USER = 'SET_USER';\n\nexport const SET_VIDEO_STATUS = 'SET_VIDEO_STATUS';\n\nexport const SET_MIRROR_OPTIONS = 'SET_MIRROR_OPTIONS';\nexport const SET_MIRROR_STATUS = 'SET_MIRROR_STATUS';\nexport const SET_MIRROR_GLASSES = 'SET_MIRROR_GLASSES';\nexport const SET_MIRROR_GLASSES_DATA = 'SET_MIRROR_GLASSES_DATA';\nexport const SET_MIRROR_GLASSES_STATUS = 'SET_MIRROR_GLASSES_STATUS';\nexport const SET_GLTF_MIRROR_GLASSES_STATUS = 'SET_GLTF_MIRROR_GLASSES_STATUS';\nexport const SET_MESH = 'SET_MESH';\nexport const SET_MESH_DATA = 'SET_MESH_DATA';\nexport const SET_MESH_STATUS = 'SET_MESH_STATUS';\n\nexport const ADD_PLUGIN = 'ADD_PLUGIN';\nexport const REMOVE_PLUGIN = 'REMOVE_PLUGIN';\nexport const CLEAR_ALL_PLUGINS = 'CLEAR_ALL_PLUGINS';\nexport const SET_PLUGINS_REQUIREMENTS = 'SET_PLUGINS_REQUIREMENTS';\n","import { Action, createAction, handleActions } from 'redux-actions';\nimport * as Actions from '../constants/actions';\nimport { PrivacyOptions } from '../interfaces/InitializationTypes';\n\nconst initialState: AppStoreState = {\n environment: 'PRODUCTION',\n loading: {\n WEBCAM_ACCESS: false,\n INITIALIZATION: false,\n POSETRACKER: false,\n RENDERING: false,\n GLASSES: false,\n MESH: false\n },\n privacy: { },\n auth: {\n accessToken: undefined,\n refreshToken: undefined\n }\n};\n\nexport const AppActions = {\n setEnvironment: createAction(Actions.SET_ENVIRONMENT),\n setAuth: createAction(Actions.SET_AUTH),\n resetAuth: createAction(Actions.RESET_AUTH),\n setPrivacyOptions: createAction(Actions.SET_PRIVACY_OPTIONS),\n setLoadingStatus: createAction<{type: AppLoadingType, status: boolean}>(Actions.SET_LOADING_STATUS),\n};\n\nexport const AppReducer = handleActions({\n\n [Actions.SET_ENVIRONMENT]: (state, action: Action): AppStoreState => {\n return (!!action.payload) ? {\n ...state,\n environment: action.payload\n } : {\n ...state\n };\n },\n\n [Actions.SET_AUTH]: (state, action: Action): AppStoreState => {\n if (!!action.payload.accessToken && !!action.payload.refreshToken) {\n return {\n ...state,\n auth: {\n accessToken: action.payload.accessToken,\n refreshToken: action.payload.refreshToken,\n }\n };\n } else {\n return {\n ...state\n };\n }\n },\n\n [Actions.RESET_AUTH]: (state): AppStoreState => {\n return {\n ...state,\n auth: {\n accessToken: undefined,\n refreshToken: undefined,\n }\n };\n },\n\n [Actions.SET_PRIVACY_OPTIONS]: (state, action: Action): AppStoreState => {\n return {\n ...state,\n privacy: {\n ...action.payload\n }\n };\n },\n\n [Actions.SET_LOADING_STATUS]: (state, action: Action<{type: AppLoadingType, status: boolean}>): AppStoreState => {\n return {\n ...state,\n loading: {\n ...state.loading,\n [action.payload.type]: action.payload.status\n }\n };\n },\n\n}, initialState);\n","import { MeshVideoData } from '@luxottica/vm-vtoserver-client';\nimport { Action, createAction, handleActions } from 'redux-actions';\nimport * as Actions from '../constants/actions';\nimport { MeshOptions, MirrorInternalOptions, VmPluginDescriptor } from '../interfaces/MirrorOptions';\nimport { VmPluginRequirements } from '../interfaces/PluginInterface';\n\nexport interface MirrorStoreState {\n glasses: MirrorB3dAsset | MirrorGltfAsset | {upc: string; status: AssetStatus};\n video: MirrorVideoData | {videoId: string; status: AssetStatus};\n mirrorOptions: MirrorInternalOptions;\n mirrorStatus: MirrorStatus;\n pluginList: VmPluginDescriptor[];\n pluginsRequirements: VmPluginRequirements;\n}\n\nconst initialState: MirrorStoreState = {\n glasses: undefined,\n video: undefined,\n mirrorStatus: 'LOADING',\n mirrorOptions: undefined,\n pluginList: [],\n pluginsRequirements: undefined,\n};\n\nexport const MirrorActions = {\n setMirrorOptions: createAction(Actions.SET_MIRROR_OPTIONS),\n setMirrorStatus: createAction(Actions.SET_MIRROR_STATUS),\n setMirrorGlasses: createAction<{ upc: string, type: GlassesType }>(Actions.SET_MIRROR_GLASSES),\n setMirrorGlassesData: createAction(Actions.SET_MIRROR_GLASSES_DATA),\n setMirrorGlassesStatus: createAction<{ upc: string, status: AssetStatus }>(Actions.SET_MIRROR_GLASSES_STATUS),\n setGltfMirrorGlassesStatus: createAction<{ upc: string, status: AssetStatus }>(Actions.SET_GLTF_MIRROR_GLASSES_STATUS),\n setMesh: createAction(Actions.SET_MESH),\n setMeshData: createAction(Actions.SET_MESH_DATA),\n setMeshStatus: createAction<{upc: string, status: AssetStatus}>(Actions.SET_MESH_STATUS),\n addPlugin: createAction(Actions.ADD_PLUGIN),\n removePlugin: createAction(Actions.REMOVE_PLUGIN),\n clearAllPlugins: createAction(Actions.CLEAR_ALL_PLUGINS),\n setPluginsRequirements: createAction(Actions.SET_PLUGINS_REQUIREMENTS),\n};\n\nexport const MirrorReducer = handleActions({\n\n [Actions.SET_PLUGINS_REQUIREMENTS]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n pluginsRequirements: action.payload\n };\n },\n\n [Actions.CLEAR_ALL_PLUGINS]: (state, action: Action): MirrorStoreState => {\n const newPluginList = state.pluginList.filter((plugin) => action.payload.includes(plugin.pluginId));\n return {\n ...state,\n pluginList: newPluginList\n };\n },\n\n [Actions.ADD_PLUGIN]: (state, action: Action): MirrorStoreState => {\n if (state.pluginList.map((plugin) => plugin.pluginId).includes(action.payload.pluginId)) {\n const index = state.pluginList.findIndex((plugin) => plugin.pluginId === action.payload.pluginId);\n const newPluginList = [...state.pluginList];\n newPluginList[index] = action.payload;\n return {\n ...state,\n pluginList: newPluginList\n };\n } else {\n return {\n ...state,\n pluginList: [\n ...state.pluginList,\n action.payload\n ]\n };\n }\n },\n\n [Actions.REMOVE_PLUGIN]: (state, action: Action): MirrorStoreState => {\n if (state.pluginList.map((plugin) => plugin.pluginId).includes(action.payload)) {\n const index = state.pluginList.findIndex((plugin) => plugin.pluginId === action.payload);\n const newPluginList = [...state.pluginList];\n newPluginList.splice(index, 1);\n return {\n ...state,\n pluginList: newPluginList\n };\n } else {\n return state;\n }\n },\n\n [Actions.SET_MIRROR_OPTIONS]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n mirrorOptions: action.payload,\n };\n },\n\n [Actions.SET_MIRROR_STATUS]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n mirrorStatus: action.payload,\n };\n },\n\n [Actions.SET_MIRROR_GLASSES]: (state, action: Action<{ upc: string, type: GlassesType }>): MirrorStoreState => {\n return {\n ...state,\n glasses: {\n upc: action.payload.upc,\n type: action.payload.type,\n status: 'LOADING'\n }\n };\n },\n\n [Actions.SET_MIRROR_GLASSES_DATA]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n glasses: action.payload,\n };\n },\n\n [Actions.SET_MIRROR_GLASSES_STATUS]: (state, action: Action<{upc: string, status: AssetStatus}>): MirrorStoreState => {\n return {\n ...state,\n glasses: {\n ...state.glasses,\n upc: action.payload.upc,\n status: action.payload.status\n },\n };\n },\n\n [Actions.SET_GLTF_MIRROR_GLASSES_STATUS]: (state, action: Action<{upc: string, status: AssetStatus}>): MirrorStoreState => {\n\n return (action.payload.upc === state.glasses.upc) ? {\n ...state,\n glasses: {\n ...state.glasses,\n upc: action.payload.upc,\n status: action.payload.status\n },\n } : {\n ...state\n };\n },\n\n [Actions.SET_MESH]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n video: {\n videoId: action.payload.videoId,\n pupillaryDistance: action.payload.pupillaryDistance,\n status: 'LOADING'\n }\n };\n },\n\n [Actions.SET_MESH_DATA]: (state, action: Action): MirrorStoreState => {\n return {\n ...state,\n video: {\n ...state.video,\n ...action.payload,\n status: 'READY'\n },\n };\n },\n\n [Actions.SET_MESH_STATUS]: (state, action: Action<{videoId: string, status: AssetStatus}>): MirrorStoreState => {\n return {\n ...state,\n video: {\n ...state.video,\n videoId: action.payload.videoId,\n status: action.payload.status\n },\n };\n },\n}, initialState);\n","import { Action, createAction, handleActions } from 'redux-actions';\nimport * as Actions from '../constants/actions';\n\nconst initialState: UserStoreState = {\n locale: 'en-US',\n region: undefined,\n source: undefined,\n brand: undefined,\n storeId: undefined,\n channel: undefined,\n};\n\nexport const UserActions = {\n setUser: createAction(Actions.SET_USER),\n};\n\nexport const UserReducer = handleActions({\n\n [Actions.SET_USER]: (state, action: Action) => {\n return {\n ...state,\n ...action.payload\n };\n },\n\n}, initialState);\n","import { combineReducers } from 'redux';\nimport { RootState } from '../Store';\nimport { AppReducer } from './appReducer';\nimport { MirrorReducer } from './mirrorReducer';\nimport { UserReducer } from './userReducer';\n\nexport default combineReducers({\n app: AppReducer,\n mirror: MirrorReducer,\n user: UserReducer,\n});\n","import { Catalog, CatalogConfiguration, GlassesEnvironment } from '@luxottica/vm-glasses';\nimport { FeatureLicensingService } from '../app/service/FeatureLicensingService';\nimport { Features } from '../interfaces/Features';\nimport { CallbackHelper } from './CallbackHelper';\n\nlet transitionLensMap: TransitionLenses = {};\nlet transitionOpacity = 0.0;\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\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 // why to download the catalog again to trigger a callback??????? this requires an explanation from Massimiliano\n onLensChange: (config: CatalogConfiguration, specificLens: string) => {\n Catalog.downloadTransitionLenses(config).then((colorMap) => {\n Object.keys(colorMap).map((colorName) => {\n transitionLensMap[colorName] = colorMap[colorName];\n });\n\n const lens = colorMap[specificLens] ? colorMap[specificLens] : undefined;\n CallbackHelper.onLensChange(lens);\n });\n },\n\n setTransitionOverrideColor: (color: TransitionLens) => {\n transitionLensMap.OVERRIDE = color;\n CallbackHelper.onLensChange(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 getTransitionColor: (colorName: string): TransitionLens => {\n return transitionLensMap?.[colorName];\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","enum AppViewSessionKeys {\n VM_OK = 'vm-ok',\n VM_KO = 'vm-ko',\n VM_INIT = '_init',\n VM_INIT_BRAND = '_init_brand',\n VM_INIT_CHANNEL = '_init_channel',\n VM_INIT_LOCALE = '_init_locale',\n VM_CLOSE = '_close',\n VM_FITMEBETTER = '_fitmebetter',\n VM_SCREENSHOT = '_screenshot',\n VM_RENDER = '_render',\n VM_RENDER_TIME = '_render_time_ms',\n VM_UPC_AVAILABILITY = '_upc_availability',\n}\n\nexport { AppViewSessionKeys };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { compose, createStore, Store } from 'redux';\nimport rootReducer from './reducers/combinedReducers';\nimport { MirrorStoreState } from './reducers/mirrorReducer';\n\nexport interface RootState {\n app: AppStoreState;\n user: UserStoreState;\n mirror: MirrorStoreState;\n}\n\nexport function configureStore(initialState?: RootState): Store {\n const composeEnhancers =\n typeof window === 'object' &&\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?\n (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n name: 'virtual-mirror'\n }) : compose;\n\n const enhancer = composeEnhancers();\n return createStore(rootReducer, initialState, enhancer) as Store;\n}\n","export const performanceEvents = {\n onEngineStarting : 'onEngineStarting',\n onFirstFrameRendered : 'onFirstFrameRendered',\n onNewAssetRequested : 'onNewAssetRequested',\n onWaitingForPose : 'onWaitingForPose',\n onFirstFrameStarted : 'onFirstFrameStarted',\n onAssetSwitchDone : 'onAssetSwitchDone',\n onNewTransitionRequested : 'onNewTransitionRequested',\n onNewTransitionRendered : 'onNewTransitionRendered',\n onFPSCount : 'onFPSCount'\n};\n\nexport const DOMDefaultTarget = () => document.querySelector('body');\n","import { VmStore } from '../app/VmCore';\nimport { DOMDefaultTarget } from '../constants/DOMEvents';\nimport { AuthenticationOptions, MirrorCallbacks, PrivacyCallbacks } from '../interfaces/InitializationTypes';\nimport { AppActions } from '../reducers/appReducer';\n\nexport * from '../constants/DOMEvents';\nexport {\n CallbackHelper,\n useBiometricBipa,\n setPrivacyCallbacks,\n setCallbacks\n};\n\nlet onFaceFoundSet = false;\n\nexport const dispatchEvent = (domEvent, details = {}) => {\n DOMDefaultTarget().dispatchEvent(new CustomEvent(domEvent, details));\n};\n\nconst setPrivacyCallbacks = (\n privacyCallbacks: PrivacyCallbacks\n) => {\n if (privacyCallbacks) {\n for (const callback in privacyCallbacks) {\n if (privacyCallbacks[callback]) {\n CallbackHelper[callback] = privacyCallbacks[callback];\n }\n }\n }\n};\n\nconst setCallbacks = (\n callbacks: MirrorCallbacks\n) => {\n CallbackHelper.onAuthUpdated = (authData: AuthenticationOptions) => {\n VmStore.dispatch(AppActions.setAuth(authData));\n callbacks?.onAuthUpdated?.(authData);\n };\n\n if (callbacks) {\n if (callbacks.onFaceFound) { \n onFaceFoundSet = true;\n CallbackHelper.onFaceFound = callbacks.onFaceFound;\n }\n if (callbacks.onLowEndDeviceDetected) { CallbackHelper.onLowEndDeviceDetected = callbacks.onLowEndDeviceDetected; }\n if (callbacks.onTransitionAnimation) { CallbackHelper.onTransitionAnimation = callbacks.onTransitionAnimation; }\n if (callbacks.onTransitionAnimationEnd) { CallbackHelper.onTransitionAnimationEnd = callbacks.onTransitionAnimationEnd; }\n if (callbacks.onLensChange) { CallbackHelper.onLensChange = callbacks.onLensChange; }\n }\n};\n\nconst useBiometricBipa = (): boolean => {\n return onFaceFoundSet;\n};\n\nconst CallbackHelper: MirrorCallbacks & PrivacyCallbacks = {\n onFaceFound: () => { return; },\n onLowEndDeviceDetected: () => { return; },\n onTransitionAnimation: () => { return; },\n onTransitionAnimationEnd: () => { return; },\n onLensChange: () => { return; },\n onAuthUpdated: () => { return; },\n onDisplayPage: () => { return; },\n onPrivacyAgree: () => { return; },\n onPrivacyFail: () => { return; },\n onPrivacyReject: () => { return; },\n onPrivacyPolicyClick: undefined,\n onTermsAndConditionsClick: undefined,\n onPrivacyDisplay: () => { return; },\n onMirrorExperience: () => { return; },\n};\n","import { AnimationError } from '../../errors/errors';\nimport { TransitionColorHelper } from '../../helpers/TransitionColorHelper';\nimport { vmIsInitialized, VmStore } from '../VmCore';\n\nconst animateOpacity = (duration = 1000): void => {\n if (!vmIsInitialized()) {\n return;\n }\n\n if (VmStore?.getState().mirror.mirrorStatus === 'TRACKING') {\n\n if (!(VmStore.getState().mirror.glasses as MirrorB3dAsset).transitionAvailable) {\n const error = new AnimationError('animateOpacity cannot be triggered when transition is not available for this asset');\n throw error;\n }\n\n if (duration === undefined || typeof duration !== 'number' || duration <= 0) {\n const error = new AnimationError('animateOpacity cannot be triggered when duration value is invalid');\n throw error;\n }\n\n TransitionColorHelper.startAnimation(duration);\n } else {\n const error = new AnimationError('animateOpacity cannot be triggered when mirror is not rendering');\n throw error;\n }\n};\n\nexport {\n animateOpacity\n};\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../package.json';\nimport { InitializationOptions } from '../interfaces/InitializationTypes';\nimport { SupportedFeatures } from '../interfaces/SupportedFeatures';\nimport { AppViewSessionKeys } from './AppViewSessionKeys';\n\nconst vmRemoteLog = new RemoteLog();\n\nconst createLogger = (loggerName: string) => {\n return RemoteLogConfig.getInstance().getLoggerInfo(name, version, loggerName);\n};\n\nconst sendBrowserSession = (supportedFeatures: SupportedFeatures) => {\n vmRemoteLog.sendBrowserSession({\n deviceResolution: {\n dpi: 0,\n h: window.screen.height,\n w: window.screen.width,\n },\n deviceWebcam: {\n enabled: supportedFeatures.webcamAccess,\n resolution: 0,\n },\n deviceWebgl: { version: 2 },\n });\n};\n\nconst sendError = (e) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: '99-error',\n statusText: e.message\n });\n};\n\nconst sendAppViewSession = {\n initialize: (options: InitializationOptions) => {\n vmRemoteLog.sendAppViewSession(\n {\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_INIT_BRAND,\n statusText: options.brand,\n },\n {\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_INIT_CHANNEL,\n statusText: options.channel,\n },\n {\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_INIT_LOCALE,\n statusText: options.locale,\n },\n );\n },\n\n initializeError: (options: InitializationOptions) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_KO + AppViewSessionKeys.VM_INIT,\n statusText: options.channel,\n });\n },\n\n upc: (upc: string) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_UPC_AVAILABILITY,\n statusText: upc,\n });\n },\n\n upcError: (upc: string) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_KO + AppViewSessionKeys.VM_UPC_AVAILABILITY,\n statusText: upc,\n });\n },\n \n orientationChange: (landscape: boolean) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: 'orientation change',\n statusText: landscape ? 'landscape' : 'portrait'\n });\n },\n\n fitMeBetter: () => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_FITMEBETTER,\n statusText: '',\n });\n },\n\n fitMeBetterError: () => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_KO + AppViewSessionKeys.VM_FITMEBETTER,\n statusText: '',\n });\n },\n\n close: (target: string) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_OK + AppViewSessionKeys.VM_CLOSE,\n statusText: target,\n });\n },\n\n closeError: (target: string) => {\n vmRemoteLog.sendAppViewSession({\n statusCode: AppViewSessionKeys.VM_KO + AppViewSessionKeys.VM_CLOSE,\n statusText: target,\n });\n },\n};\n\nexport {\n createLogger,\n sendBrowserSession,\n sendError,\n sendAppViewSession\n};","import { MicroserviceEnvironment } from '@luxottica/vto-microservices';\nimport { version } from '../../package.json';\nimport { FeatureLicensingService } from '../app/service/FeatureLicensingService';\nimport { FeatureInitializationError, VtoError } from '../errors/errors';\nimport { Features } from '../interfaces/Features';\nimport { AdobeConfig } from '../interfaces/InitializationTypes';\nimport { createLogger } from '../remotelog/VmLogger';\n\nlet adobeConfig: AdobeConfig;\nlet environment: 'DEVELOPMENT' | 'PRODUCTION';\n\nconst logger = createLogger('AdobeHelper');\n\nconst generateAdobeData = (\n eventParams: AdobeEventParameters,\n errorParams?: AdobeErrorParameters\n): AdobeData => {\n const adobeData = new Map();\n adobeData.set('AQB', '1');\n adobeData.set('ndh', '1');\n adobeData.set('ns', 'luxottica');\n adobeData.set('g', window.location.href);\n adobeData.set('r', document.referrer);\n adobeData.set('ch', 'VirtualMirror');\n adobeData.set('server', window.location.hostname);\n adobeData.set('c1', adobeConfig?.channel);\n adobeData.set('c2', adobeConfig?.storeId);\n adobeData.set('c3', adobeConfig?.brand);\n adobeData.set('c4', adobeConfig?.locale);\n adobeData.set('c5', eventParams.upc);\n adobeData.set('c6', adobeConfig?.storeRegion);\n adobeData.set('c7', adobeConfig?.storeCompany);\n adobeData.set('c8', adobeConfig?.globalStoreId);\n adobeData.set('c9', version);\n\n let lensSim;\n if (!!eventParams.lensName && FeatureLicensingService.isFeatureAuthorized(Features.VM_TRANSITIONS)) {\n lensSim = 'transition';\n } else if (!!eventParams.upc) {\n lensSim = 'standard';\n } else {\n lensSim = 'undefined';\n }\n adobeData.set('c11', lensSim);\n\n if (errorParams) {\n adobeData.set('v1', errorParams.errorSource);\n adobeData.set('v2', errorParams.errorCode);\n adobeData.set('v3', errorParams.errorDetails);\n adobeData.set('v5', eventParams.upc);\n }\n\n adobeData.set('events', eventParams.eventCode);\n adobeData.set('pageName', 'VirtualMirror');\n\n adobeData.set('AQE', '1');\n return adobeData;\n};\n\nconst sendAdobeRequest = (data: AdobeData) => {\n const adobeHost = (environment === 'PRODUCTION')\n ? 'https://luxottica.d2.sc.omtrdc.net/b/ss/lux-virtualmirror-prod/1?'\n : 'https://luxottica.d2.sc.omtrdc.net/b/ss/lux-virtualmirror-dev/1?';\n\n const query = Array.from(data.keys())\n .filter((key) => data.get(key) !== undefined)\n .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data.get(key)))\n .join('&');\n\n const adobeQuery = `${adobeHost}${query}`;\n\n logger.debug('sending adobe analytics event: {}', JSON.stringify({\n abobeHost: adobeHost,\n entries: [...data.entries()]\n }));\n\n return fetch(adobeQuery, {\n method: 'POST'\n }).catch((e) => {\n logger.warn('failed to post analytics event {}', JSON.stringify(e));\n });\n};\n\nconst AdobeHelper = {\n initialize: (config: AdobeConfig, msEnvironment: MicroserviceEnvironment) => {\n adobeConfig = config;\n environment = (msEnvironment === 'PRODUCTION') ? 'PRODUCTION' : 'DEVELOPMENT';\n },\n sendEvent: (eventParams: AdobeEventParameters) => {\n if (FeatureLicensingService.isFeatureAuthorized(Features.VM_ANALYTICS)) {\n try {\n const adobeData = generateAdobeData(eventParams);\n sendAdobeRequest(adobeData);\n } catch (e) {\n logger.error(e);\n }\n }\n },\n sendError: (vtoError: VtoError, upc?: string) => {\n if (!FeatureLicensingService.isInitialized()) {\n throw new FeatureInitializationError();\n }\n if (FeatureLicensingService.isFeatureAuthorized(Features.VM_ANALYTICS)) {\n try {\n if ([\n 'InitializationError',\n 'InvalidParametersError',\n 'UpcSupportedError',\n 'UpcMissingError',\n 'WebcamUnavailableError',\n 'WebcamRejectedError',\n 'MountComponentError',\n 'UnmountComponentError'\n ].includes(vtoError?.type)) {\n const adobeErrorData = generateAdobeData({\n eventCode: 'event8',\n upc: upc\n }, vtoError.adobeErrorParameters);\n sendAdobeRequest(adobeErrorData);\n }\n } catch (e) {\n logger.error(e);\n }\n }\n }\n};\n\nexport { AdobeHelper };\n","import { GrAction } from '@luxottica/vm-plugin-glasses-removal/build/types/src/interfaces/GlassesRemovalConfig';\nimport { InitializationError, WebcamRejectedError, WebcamUnavailableError } from '../errors/errors';\nimport { AnalyticsConfig } from '../interfaces/AnalyticsConfig';\nimport { AdobeConfig } from '../interfaces/InitializationTypes';\nimport { AdobeHelper } from './AdobeHelper';\n\nlet analyticsConfig: AnalyticsConfig;\nlet lastInteractionTime: number;\nlet sessionTimeoutMs: number;\nconst FIVE_MINUTES = 5 * 60 * 1000;\n\nconst setSessionTimeout = (sessionTimeout: boolean) => {\n sessionTimeoutMs = sessionTimeout ? FIVE_MINUTES : Infinity;\n};\n\nconst updateInteractionTime = () => {\n if (lastInteractionTime) {\n lastInteractionTime = Date.now();\n }\n};\n\n// below method should use this signature but does not work due to a typescript check\n// const sendEvent = (eventName: keyof AnalyticsConfig, ...params: any) => {\nconst sendEvent = (eventName: string, ...params: any) => {\n try {\n if (eventName in analyticsConfig) {\n if (analyticsConfig[eventName] !== undefined) {\n analyticsConfig[eventName]!(...params);\n }\n }\n } catch (e) {\n // tslint:disable-next-line: no-console\n console.error('Analytics Event Failed', eventName, e);\n }\n};\n\nconst AnalyticsHelper = {\n initialize: (\n environment: MicroserviceEnvironment,\n config: AnalyticsConfig = {},\n adobeConfig: AdobeConfig,\n ) => {\n updateInteractionTime();\n analyticsConfig = config;\n AdobeHelper.initialize(adobeConfig, environment);\n },\n onSessionStart: () => {\n if (!lastInteractionTime || (Date.now() - lastInteractionTime > sessionTimeoutMs)) {\n lastInteractionTime = Date.now();\n AdobeHelper.sendEvent({ eventCode: 'event1' });\n sendEvent('onSessionStart');\n }\n },\n onInitializeSuccess: () => {\n updateInteractionTime();\n sendEvent('onInitializeSuccess');\n },\n onInitializeError: () => {\n updateInteractionTime();\n AdobeHelper.sendError(new InitializationError());\n sendEvent('onInitializeError');\n },\n onRequestWebcam: () => {\n updateInteractionTime();\n AdobeHelper.sendEvent({\n eventCode: 'event2' });\n sendEvent('onRequestWebcam');\n },\n onWebcamAllowed: () => {\n updateInteractionTime();\n AdobeHelper.sendEvent({\n eventCode: 'event3' });\n sendEvent('onWebcamAllowed');\n },\n onWebcamDenied: () => {\n updateInteractionTime();\n AdobeHelper.sendError(new WebcamRejectedError());\n sendEvent('onWebcamDenied');\n },\n onWebcamUnavailable: () => {\n updateInteractionTime();\n AdobeHelper.sendError(new WebcamUnavailableError());\n sendEvent('onWebcamUnavailable');\n },\n onMirrorWasmFailure: () => {\n updateInteractionTime();\n sendEvent('onMirrorWasmFailure');\n },\n onGlassesOn: () => {\n updateInteractionTime() ;\n sendEvent('onGlassesOn');\n },\n onGlassesOff: () => {\n updateInteractionTime();\n sendEvent('onGlassesOff');\n },\n onRender: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n sendEvent('onRender', upcIdLens);\n },\n onRenderReady: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n AdobeHelper.sendEvent({\n eventCode: (!!upcIdLens) ? `event4:${upcIdLens}` : 'event4',\n upc: upcIdLens,\n lensName: lensName\n });\n sendEvent('onRenderReady', upcIdLens);\n },\n onMirrorRenderFailure: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n sendEvent('onMirrorRenderFailure', upcIdLens);\n },\n onFitGlasses: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n AdobeHelper.sendEvent({\n eventCode: (!!upcIdLens) ? `event5:${upcIdLens}` : 'event5',\n upc: upcIdLens,\n lensName: lensName\n });\n sendEvent('onFitGlasses');\n },\n onAdjustGlasses: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n AdobeHelper.sendEvent({\n eventCode: (!!upcIdLens) ? `event6:${upcIdLens}` : 'event6',\n upc: upcIdLens,\n lensName: lensName\n });\n sendEvent('onAdjustGlasses'); // TODO: should this have upc?\n },\n onCloseMirror: () => {\n updateInteractionTime();\n AdobeHelper.sendEvent({ eventCode: 'event7' });\n sendEvent('onCloseMirror');\n },\n onError: () => {\n updateInteractionTime();\n sendEvent('onError');\n },\n onScreenshot: (upc: string, lensName?: string) => {\n updateInteractionTime();\n const upcIdLens = upcLensName(upc, lensName);\n AdobeHelper.sendEvent({\n eventCode: (!!upcIdLens) ? `event9:${upcIdLens}` : 'event9',\n upc: upcIdLens,\n lensName: lensName\n });\n sendEvent('onScreenshot');\n },\n onGlassesRemovalStateChange: (info: GrAction) => {\n updateInteractionTime();\n sendEvent('onGlassesRemovalStateChange', info);\n }\n};\n\nconst upcLensName = (upc: string, lensName?: string) => {\n return (!!lensName) ? `${upc}_${lensName}` : upc;\n};\n\nexport {\n setSessionTimeout,\n AnalyticsHelper\n};\n","import ReactDOM from 'react-dom';\nimport { UnmountComponentError } from '../../errors/errors';\nimport { AdobeHelper } from '../../helpers/AdobeHelper';\nimport { AnalyticsHelper } from '../../helpers/AnalyticsHelper';\nimport { AppActions } from '../../reducers/appReducer';\nimport { createLogger, sendAppViewSession } from '../../remotelog/VmLogger';\nimport { VmStore } from '../VmCore';\n\nconst logger = createLogger('CloseMirror');\n\nconst resetLoadingStatus = () => {\n VmStore.dispatch(AppActions.setLoadingStatus({ type: 'WEBCAM_ACCESS', status: false }));\n VmStore.dispatch(AppActions.setLoadingStatus({ type: 'RENDERING', status: false }));\n VmStore.dispatch(AppActions.setLoadingStatus({ type: 'POSETRACKER', status: false }));\n};\n\n// we return a promise because it's easy to keep this backwards compatibility here\n// but sneaky on client code\nconst closeMirror = (target: string): Promise => {\n try {\n // reset all loading statuses, this will display the loading screen again on a new VM instance\n resetLoadingStatus();\n AnalyticsHelper.onCloseMirror();\n logger.debug('closing mirror for target div {}', target);\n const container = document.getElementById(target);\n\n if (ReactDOM.unmountComponentAtNode(container)) {\n logger.debug('closed mirror for target div {}', target);\n sendAppViewSession.close(target);\n\n } else {\n logger.debug('closing mirror for target div {} failed', target);\n sendAppViewSession.closeError(target);\n const unmountComponentError = new UnmountComponentError(target);\n AdobeHelper.sendError(unmountComponentError);\n return Promise.reject(unmountComponentError);\n }\n return Promise.resolve();\n } catch (e) {\n logger.debug('closing mirror for target div {} failed: {}', target, e.message);\n const unmountComponentError = new UnmountComponentError(target);\n try {\n AdobeHelper.sendError(unmountComponentError);\n } catch (e) {\n return Promise.reject(e);\n }\n return Promise.reject(unmountComponentError);\n }\n};\n\nexport {\n closeMirror\n};\n","import { loginRequest, LoginReturn } from '@luxottica/vto-microservices';\nimport { VmStore } from '../app/VmCore';\nimport { CallbackHelper } from './CallbackHelper';\n\nconst RequestHelper = {\n login: (environment: MicroserviceEnvironment): Promise => {\n return loginRequest({\n environment: environment,\n accessToken: VmStore.getState().app.auth.accessToken,\n refreshToken: VmStore.getState().app.auth.refreshToken,\n onAuthUpdated: CallbackHelper.onAuthUpdated,\n version: 1\n });\n }\n};\n\nexport {\n RequestHelper\n};\n","const Events = {\n PAUSE: 'vm_pause_event',\n RESUME: 'vm_resume_event',\n TOPIC_SCREENSHOT_REQ: 'TOPIC_SCREENSHOT_REQ',\n TOPIC_SCREENSHOT_RES: 'TOPIC_SCREENSHOT_RES',\n};\n\nexport {\n Events,\n};\n","import { GlScreenshot } from '@luxottica/vm-renderer-threejs';\nimport PubSub from 'pubsub-js';\nimport { Events } from '../../constants/Events';\nimport { FeatureUnavailableError } from '../../errors/errors';\nimport { AnalyticsHelper } from '../../helpers/AnalyticsHelper';\nimport { Features } from '../../interfaces/Features';\nimport { Screenshot } from '../../interfaces/Screenshot';\nimport { createLogger } from '../../remotelog/VmLogger';\nimport { FeatureLicensingService } from '../service/FeatureLicensingService';\nimport { VmStore } from '../VmCore';\n\nconst logger = createLogger('GetScreenshot');\n\nconst getScreenshot = (type = 'image/jpeg', quality = 0.9): Promise => {\n if (!FeatureLicensingService.isFeatureAuthorized(Features.VM_SCREENSHOT)) {\n return Promise.reject(new FeatureUnavailableError(Features.VM_SCREENSHOT));\n }\n \n let subscriber: (topicName: string, functionF: (mess: string, data: Screenshot) => void) => void;\n const promise = new Promise((resolve) => {\n subscriber = PubSub.subscribe(Events.TOPIC_SCREENSHOT_RES, (mess: string, data: GlScreenshot) => {\n AnalyticsHelper.onScreenshot(\n VmStore.getState().mirror.glasses.upc,\n VmStore.getState().mirror.mirrorOptions.transitionColor\n );\n logger.debug('message reveived from topic {}: total img bytes {}', mess, data.imgURI.length);\n resolve({ imgURI: data.imgURI, width: data.w, height: data.h });\n });\n logger.debug('subscription for {}: {}', Events.TOPIC_SCREENSHOT_RES, subscriber);\n });\n promise.then(() => {\n if (subscriber) {\n PubSub.unsubscribe(subscriber);\n logger.debug('unsubscribed for {}: {}', Events.TOPIC_SCREENSHOT_RES, subscriber);\n }\n });\n const isPublished = PubSub.publish(Events.TOPIC_SCREENSHOT_REQ, {type, quality});\n logger.debug('published screenshot request on {}: {}', Events.TOPIC_SCREENSHOT_REQ, isPublished);\n return promise;\n};\n\nexport {\n getScreenshot\n};\n","const defaultLocale = 'en-US';\nconst defaultLanguage = 'en';\n\nconst 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\nconst localeRegionMap = {\n US: {\n en: 'en-US',\n },\n EU: {\n en: 'en-EU',\n },\n AU: {\n en: 'en-AU',\n }\n};\n\nconst getLocaleRegionFallback = (region: string, language: string) => {\n const localesMap = {\n ...localeMap,\n ...localeRegionMap[region],\n };\n const locale = localesMap[language] || localeRegionMap[region].en;\n return locale;\n};\n\ndeclare interface MirrorTranslation {\n GENERIC_ERROR: {\n ERROR: string,\n BUTTON: string,\n SUBTEXT: string\n };\n PERMISSION_ERROR: {\n ERROR: string,\n SUBTEXT: string,\n };\n WEBCAM_ERROR: {\n ERROR: string,\n SUBTEXT: string,\n };\n MANUAL_START: {\n BUTTON: string,\n TEXT: string,\n };\n GUIDANCE: {\n UNKNOWN: string,\n DEFAULT: string,\n MOVE_CLOSER: string,\n MOVE_FARTHER: string,\n STAY_STILL: string,\n LOOK_UP: string,\n LOOK_RIGHT: string,\n LOOK_DOWN: string,\n LOOK_LEFT: string,\n TILT_LEFT: string,\n TILT_RIGHT: string,\n GLASSES?: string,\n };\n UI: {\n FIT_ME_BETTER?: string,\n USE_TWO_FINGERS: string,\n TAP_TO_FREEZE: string,\n DESKTOP_TAP_TO_FREEZE: string\n };\n}\n\ndeclare interface Translation {\n MIRROR: MirrorTranslation;\n}\n\nconst defaultTranslations: Translation = {\n\tMIRROR: {\n GENERIC_ERROR: {\n BUTTON: 'Continue',\n ERROR: 'An error occured',\n SUBTEXT: 'Please check your camera permissions and try to reload the page.'\n },\n PERMISSION_ERROR: {\n ERROR: 'You must allow access to your camera to use Virtual Mirror.',\n SUBTEXT: 'Click on your browser Share or Allow button 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 MANUAL_START: {\n BUTTON: 'Start the experience',\n TEXT: 'You are probably in Low Power Mode. The experience may be degraded.'\n },\n GUIDANCE: {\n DEFAULT: 'Place your head in the middle of the screen',\n GLASSES: 'Please remove your glasses',\n LOOK_DOWN: 'Look down',\n LOOK_LEFT: 'Look to your left',\n LOOK_RIGHT: 'Look to your right',\n LOOK_UP: 'Look up',\n MOVE_CLOSER: 'Move closer to the oval',\n MOVE_FARTHER: 'Move farther from the screen',\n STAY_STILL: 'Good, stay still while fitting glasses',\n TILT_LEFT: 'Tilt to your left',\n TILT_RIGHT: 'Tilt to your right',\n UNKNOWN: 'Is anyone there?'\n },\n UI: {\n DESKTOP_TAP_TO_FREEZE: 'Hold to freeze the screen or drag the pointer along the nose to adjust the frames',\n FIT_ME_BETTER: 'Fit me better',\n TAP_TO_FREEZE: 'Tap and hold to freeze the screen',\n USE_TWO_FINGERS: 'Use two fingers to adjust on the nose'\n },\n\t}\n};\n\nconst LocalizationDefaults = {\n locale: defaultLocale,\n language: defaultLanguage,\n translations: defaultTranslations,\n};\n\nexport {\n LocalizationDefaults,\n Translation,\n MirrorTranslation,\n getLocaleRegionFallback\n};\n","import { MicroserviceEnvironment } from '@luxottica/vto-microservices';\nimport { InvalidLocaleError } from '../errors/errors';\nimport { DeepPartial } from '../interfaces/DeepPartial';\nimport { createLogger } from '../remotelog/VmLogger';\nimport { LocalizationDefaults, MirrorTranslation, Translation, getLocaleRegionFallback } from './LocalizationDefaults';\n\nconst logger = createLogger('LocalizationHelper');\n\nexport class LocalizationHelper {\n\n private static baseUrl = 'https://d5nhc6q3o19l2.cloudfront.net';\n private static localeRegEx = new RegExp(/([a-z]{2})-([A-Z]{2}|[0-9]*)/);\n private static localeIsoRegEx = new RegExp(/([a-z]{2})-[A-Z]{2}/);\n private static formatLocaleRegEx = new RegExp(/([a-z]{2})-([A-Z|a-z]{2})/);\n\n private static localizedTranslations: Translation;\n private static overriddenTranslations: DeepPartial;\n\n private static translationType = 'MIRROR';\n\n public static getString(page: string, key: string): string {\n let text = '';\n\n try {\n text = LocalizationHelper.getStringFromTranslation(page, key, this.localizedTranslations);\n } catch (e) {\n logger.warn(`local translation not found for [${this.translationType}][${page}][${key}] using default`);\n try {\n text = LocalizationHelper.getStringFromTranslation(page, key, LocalizationDefaults.translations);\n } catch (e) {\n logger.warn(`default translation not found for [${this.translationType}][${page}][${key}]`);\n }\n }\n return text;\n }\n\n private static getStringFromTranslation(page: string, key: string, translation: Translation): string {\n const text = (this.overriddenTranslations)?.[this.translationType]?.[page]?.[key];\n\n return (!!text) ? text : translation[this.translationType][page][key];\n }\n\n public static setOverrides(translations: DeepPartial) {\n this.overriddenTranslations = {\n MIRROR: translations\n };\n }\n\n public static initializeRemote(\n environment: MicroserviceEnvironment,\n locale: string,\n region: string,\n bipaActive: boolean\n ) {\n return new Promise((resolve, reject) => {\n this.localizationPromise(environment, locale, region, bipaActive)\n .then((localeReturn) => {\n this.localizedTranslations = localeReturn.localTranslations;\n resolve(localeReturn.locale);\n }).catch((error) => {\n reject(error);\n });\n });\n }\n\n private static fetchLocalization = (\n environment: MicroserviceEnvironment,\n locale: string\n ): Promise => {\n\n let textEnv;\n switch (environment) {\n case 'STAGING':\n textEnv = 'dev';\n break;\n case 'ACCEPTANCE':\n textEnv = 'test';\n break;\n case 'PRODUCTION':\n textEnv = 'prod';\n break;\n default:\n break;\n }\n\n const localizationFileUrl = `${LocalizationHelper.baseUrl}/vmmv/v1/${textEnv}/ui/application_${locale}.json`;\n\n return fetch(localizationFileUrl)\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: MicroserviceEnvironment,\n locale: string,\n region: string,\n bipaActive: boolean\n ) => {\n return new Promise<{ locale: string, localTranslations: Translation }>((resolve) => {\n const formattedLocale = LocalizationHelper.cleanLocale(locale, region, bipaActive);\n let resolvedLocale = formattedLocale;\n const localeLanguage = LocalizationHelper.localeRegEx.exec(formattedLocale);\n const language = localeLanguage && localeLanguage[1] || LocalizationDefaults.language;\n\n if (!localeLanguage) {\n const localeError = new InvalidLocaleError(locale);\n logger.error(JSON.stringify(localeError));\n // tslint:disable-next-line: no-console\n console.warn(localeError);\n }\n\n let translationFound = false;\n LocalizationHelper.fetchLocalization(environment, formattedLocale)\n .then((translation) => {\n translationFound = true;\n resolve({\n locale: formattedLocale,\n localTranslations: translation\n });\n }).catch(() => {\n logger.warn(`failed to find localization for locale: ${formattedLocale}, trying with ${getLocaleRegionFallback(region, language)}`);\n }).then(() => {\n resolvedLocale = getLocaleRegionFallback(region, language);\n if (!translationFound) {\n return LocalizationHelper.fetchLocalization(environment, resolvedLocale);\n } else {\n throw Error('break');\n }\n }).then((fallbackTranslation) => {\n translationFound = true;\n resolve({\n locale: resolvedLocale,\n localTranslations: fallbackTranslation\n });\n }).catch(() => {\n if (!translationFound) {\n logger.warn(`failed to find localization language ${language} mapped as locale: ${resolvedLocale}`);\n }\n }).then(() => {\n if (!translationFound) {\n resolvedLocale = LocalizationDefaults.locale;\n return LocalizationHelper.fetchLocalization(environment, resolvedLocale);\n } else {\n throw Error('break');\n }\n }).then((englishTranslation) => {\n translationFound = true;\n resolve({\n locale: resolvedLocale,\n localTranslations: englishTranslation\n });\n }).catch(() => {\n if (!translationFound) {\n logger.warn(\n `failed to find localization for locale: ${resolvedLocale}, falling back to default ${LocalizationDefaults.locale}`\n );\n }\n return Promise.resolve();\n }).then(() => {\n if (!translationFound) {\n resolve({\n locale: resolvedLocale,\n localTranslations: LocalizationDefaults.translations\n });\n }\n });\n });\n };\n\n private static cleanLocale(\n locale: string,\n region: string,\n bipaActive: boolean\n ) {\n\n // virtual-mirror.luxottica.com uses navigator.language to detect locale\n // on iOS navigator.language returns 'it' instead of 'it-IT'\n // this tries to handle the value\n let formattedLocale = locale;\n if (bipaActive && region === 'US'\n && locale !== 'en-US'\n && locale !== 'es-US') {\n logger.warn('invalid locale for privacy policy, reverting to \\'en-US\\'');\n formattedLocale = 'en-US';\n\n } else if (!formattedLocale || formattedLocale.length === 2) {\n formattedLocale = getLocaleRegionFallback(region, formattedLocale) || 'en-US';\n }\n\n formattedLocale = formattedLocale.replace(LocalizationHelper.formatLocaleRegEx, (match, p1, p2) => {\n return [p1, p2.toUpperCase()].join('-');\n });\n return formattedLocale;\n }\n\n public static getDefaults() {\n return LocalizationDefaults.translations.MIRROR;\n }\n}","import { DeviceDetection } from '@luxottica/vm-devicedetection';\nimport { SupportedFeatures } from '../interfaces/SupportedFeatures';\nimport { AnalyticsHelper } from './AnalyticsHelper';\n\nexport class SupportedFeaturesHelper {\n public static getSupportedFeatures() {\n return new Promise((resolve, reject) => {\n const devicedetection = new DeviceDetection();\n return devicedetection.isVideoInputDeviceAvailable().then((available) => {\n if (!available) {\n AnalyticsHelper.onWebcamUnavailable();\n }\n resolve({\n wasmSupport: devicedetection.isWebAssemblySupported(),\n webcamAccess: devicedetection.isUserMediaSupported(),\n webcamAvailable: available,\n webglRendering: devicedetection.isWebGlSupported(),\n isWebView: devicedetection.isWebView(),\n });\n }).catch((error) => {\n reject(error);\n });\n });\n }\n}\n","import { VtoError } from '../errors/errors';\nimport { InitializationOptions } from '../interfaces/InitializationTypes';\nimport { SupportedFeatures } from '../interfaces/SupportedFeatures';\nimport { LocalizationHelper } from './LocalizationHelper';\nimport { SupportedFeaturesHelper } from './SupportedFeaturesHelper';\n\nexport class InitializationHelper {\n\n public static initialize(\n initOptions: InitializationOptions,\n privacyOptions: PrivacyOptions\n ): Promise<{\n userStore: UserStoreState,\n supportedFeatures: SupportedFeatures\n }> {\n return Promise.all([\n LocalizationHelper.initializeRemote(\n initOptions.environment,\n initOptions.locale,\n privacyOptions.region,\n privacyOptions.bipaActive),\n SupportedFeaturesHelper.getSupportedFeatures()\n ]).then((result) => {\n return {\n userStore: {\n locale: result[0],\n region: privacyOptions.region,\n source: privacyOptions.source,\n brand: initOptions.brand,\n storeId: initOptions.storeId,\n channel: initOptions.channel,\n },\n supportedFeatures: result[1]\n };\n }).catch((error: VtoError) => {\n throw error;\n });\n }\n}\n","class FpsCounter {\n private fpsQueue: number[];\n private processStartTime: number;\n public static fpsQueueLength = 30;\n\n constructor() {\n this.fpsQueue = new Array(FpsCounter.fpsQueueLength).fill(0);\n }\n\n public get fps() {\n return this.fpsQueue.reduce((sum, value) => sum + value) / this.fpsQueue.length;\n }\n\n private static calcFps(t0, t1): number {\n return (!(t0 && t1)) ? 0 : 1 / ((t1 - t0) / 1000);\n }\n\n public tick() {\n this.fpsQueue.shift();\n this.fpsQueue.push(FpsCounter.calcFps(this.processStartTime, performance.now()));\n this.processStartTime = performance.now();\n }\n}\n\nexport { FpsCounter };\n","import type { VtoServerEnvironment } from '@luxottica/vm-vtoserver-client';\nimport type { AssetEnvironmentOptions, EnvironmentName } from '../interfaces/MirrorOptions';\n\nconst DefaultAssetEnvironmentOptions: AssetEnvironmentOptions = {\n glasses: 'PROD' as EnvironmentName,\n video: 'PRODUCTION' as VtoServerEnvironment,\n};\n\nexport { DefaultAssetEnvironmentOptions };\n","import { AssetResolution, GlassesEnvironment } from '@luxottica/vm-glasses';\nimport { TrackingOptions } from '@luxottica/vm-posetracker-faceweb';\nimport { GlRenderDebugOptions } from '@luxottica/vm-renderer-threejs';\nimport { VtoServerEnvironment } from '@luxottica/vm-vtoserver-client';\n\ninterface MirrorOptions {\n width?: number;\n height?: number;\n transitionColor?: string;\n videoResolution?: number;\n glassesResolution?: AssetResolution;\n device?: DeviceOptions;\n nosePosition?: NosePositionOptions;\n rendering?: RenderingOptions;\n plugins?: PluginOptions;\n tracking?: TrackingOptions;\n fittingModel?: MeshOptions;\n environment?: AssetEnvironmentOptions;\n}\n\ninterface MirrorInternalOptions extends Required {\n glassesType: GlassesType;\n}\n\ninterface DeviceOptions {\n evaluationThreshold: number;\n}\n\ninterface MeshOptions {\n videoId?: string;\n pupillaryDistance?: number;\n}\n\ninterface VmPluginDescriptor {\n pluginId: string;\n pluginOptions: any; \n}\n\ninterface AssetEnvironmentOptions {\n glasses?: GlassesEnvironment;\n video?: VtoServerEnvironment;\n}\n\ninterface NosePositionOptions {\n enabled: boolean;\n touches?: number;\n}\n\nenum RevealFX {\n OFF = 'OFF',\n STANDARD = 'STANDARD',\n}\n\ninterface RenderingOptions {\n debug: GlRenderDebugOptions;\n revealFX?: RevealFX;\n}\n\ninterface PluginOptions {\n debug?: boolean;\n stopGlassesDetectionAfterMs?: number;\n}\n\nexport {\n AssetEnvironmentOptions,\n MirrorOptions,\n RenderingOptions,\n PluginOptions,\n MeshOptions,\n NosePositionOptions,\n GlassesEnvironment as EnvironmentName,\n RevealFX,\n MirrorInternalOptions,\n VmPluginDescriptor,\n};\n","import { PrivacyOptions } from '../interfaces/InitializationTypes';\n\nexport const DefaultPrivacyOptions: PrivacyOptions = {\n bipaActive: false,\n region: undefined,\n source: undefined,\n privacyPolicy: undefined,\n termsAndConditions: undefined,\n bipaPrefill: {\n firstName: undefined,\n lastName: undefined,\n email: undefined,\n },\n localizationText: undefined,\n};\n","import { RenderingOptions, RevealFX } from '../interfaces/MirrorOptions';\n\nconst DefaultRenderingOptions: RenderingOptions = {\n revealFX: RevealFX.OFF,\n debug: {\n checkError: false,\n hideGlasses: false,\n showMesh: false,\n meshColor: [0, 1, 0, 0.5],\n }\n};\n\nexport { DefaultRenderingOptions };\n","const DefaultTrackingOptions: TrackingOptions = {\n debug: false,\n inspect: false,\n recoveryLimit: 1,\n areaSize: 1,\n areaOffset: [0, 0],\n depthRange: [100, 2000],\n axisRange: [7, 50, 7],\n fittedPointsRatio: 0.25,\n fov: 52.0,\n minimumFaceSizeRatio: 0.3,\n edgeDetectionPercentage: [0.15, 0.1, 0.1, 0.1], // top, right, bottom, left\n standstill: {\n timeLimit: 1500,\n positionVariance: 50,\n axisVariance: 8,\n depthRange: [150, 500]\n },\n onPoseTrack: () => { return; },\n};\n\nexport { DefaultTrackingOptions };\n","// TODO: use @luxottica/vm-devicedetection instead of this\nimport { GlassesEnvironment } from '@luxottica/vm-glasses';\nimport device from 'current-device';\nimport { FpsCounter } from '../app/mirror/FpsCounter';\nimport { FeatureLicensingService } from '../app/service/FeatureLicensingService';\nimport { DefaultAssetEnvironmentOptions } from '../constants/DefaultEnvironmentOptions';\nimport { DefaultInitializationOptions } from '../constants/DefaultInitializationOptions';\nimport { DefaultPrivacyOptions } from '../constants/DefaultPrivacyOptions';\nimport { DefaultRenderingOptions } from '../constants/DefaultRenderingOptions';\nimport { DefaultTrackingOptions } from '../constants/DefaultTrackingOptions';\nimport { InvalidParametersError } from '../errors/errors';\nimport { Features } from '../interfaces/Features';\nimport { InitializationOptions, InitializationParams } from '../interfaces/InitializationTypes';\nimport { MeshOptions, MirrorInternalOptions, MirrorOptions, NosePositionOptions } from '../interfaces/MirrorOptions';\n\ndeclare global {\n // tslint:disable-next-line:interface-name\n interface Window {\n PointerEvent: any;\n TouchEvent: any;\n }\n}\n\nexport class ParameterHelper {\n\n public static mergeInitializationParams(\n params: InitializationParams\n ): Required {\n\n const initOptions: InitializationOptions = {\n ...DefaultInitializationOptions,\n ...params.options,\n };\n\n const privacyOptions: PrivacyOptions = {\n ...DefaultPrivacyOptions,\n ...params.privacy,\n };\n\n const initializationParams: Required = {\n options: initOptions,\n auth: {\n ...params.auth\n },\n privacy: privacyOptions,\n privacyCallbacks: params.privacyCallbacks\n };\n\n if (!!privacyOptions?.bipaActive) {\n if (!['US', 'AU', 'EU'].includes(privacyOptions.region)) {\n throw new InvalidParametersError('region', privacyOptions.region);\n }\n if (!privacyOptions.source) {\n throw new InvalidParametersError('source', privacyOptions.source);\n }\n }\n\n return initializationParams;\n }\n\n public static mergeMirrorOptions(\n target: string,\n glassesType: GlassesType,\n inputOptions: MirrorOptions\n ): Required {\n\n const options: MirrorOptions = (inputOptions) ? inputOptions : {};\n\n const size = (options.width && options.height) ? {\n width: options.width,\n height: options.height\n } : this.createOptionsForTarget(target);\n\n const faceRatio = this.calculateMinimumPointsRatio(size.width, size.height);\n const mirrorOptions: Required = {\n width: size.width,\n height: size.height,\n transitionColor: options.transitionColor,\n videoResolution: (options.videoResolution) ? options.videoResolution : 720,\n glassesResolution: (options.glassesResolution) ? options.glassesResolution : '512',\n glassesType: (glassesType) ? glassesType : 'B3D',\n device: {\n evaluationThreshold: (FpsCounter.fpsQueueLength / 10) * 1000,\n ...options.device\n },\n rendering: {\n revealFX: (options.rendering && options.rendering.revealFX) ?\n options.rendering.revealFX :\n DefaultRenderingOptions.revealFX,\n debug: {\n ...DefaultRenderingOptions.debug,\n ...((options.rendering) ? options.rendering.debug : {}),\n globalDebugMethods: FeatureLicensingService.isFeatureAuthorized(Features.VM_GLOBAL_DEBUG_METHODS),\n }\n },\n plugins: {\n debug: (options.plugins && options.plugins.debug) ? options.plugins.debug : false,\n stopGlassesDetectionAfterMs: (options.plugins && options.plugins.stopGlassesDetectionAfterMs) ? options.plugins.stopGlassesDetectionAfterMs : undefined,\n },\n nosePosition: {\n enabled: (\n options.nosePosition !== undefined &&\n options.nosePosition.enabled !== undefined &&\n typeof options.nosePosition.enabled === 'boolean')\n ? options.nosePosition.enabled : true,\n touches: this.calculateAutoPointerCount(\n options.nosePosition\n ),\n },\n tracking: {\n ...DefaultTrackingOptions,\n minimumFaceSizeRatio: faceRatio,\n ...options.tracking,\n standstill: {\n ...DefaultTrackingOptions.standstill,\n ...((options.tracking) ? options.tracking.standstill : {})\n },\n },\n fittingModel: this.calculateFittingModel(options.fittingModel),\n environment: {\n ...DefaultAssetEnvironmentOptions,\n ...((options.environment) ? options.environment : {})\n },\n };\n\n // IMPORTANT\n // This toUpperCase has been added to quick go in production on Jun 27th 2022 on Oakley configurator\n // The configutator wrongly return lowercase environments and now is too late to release a client side fix\n mirrorOptions.environment.glasses = mirrorOptions.environment.glasses.toUpperCase() as GlassesEnvironment;\n\n return mirrorOptions;\n }\n\n private static calculateAutoPointerCount(\n nosePosition: NosePositionOptions\n ): number {\n const enabled = (nosePosition?.enabled !== undefined) ? nosePosition.enabled : true;\n const touches = (nosePosition?.touches !== undefined) ? nosePosition.touches : -1;\n\n if (enabled && touches && [1, 2].includes(touches)) {\n return touches;\n } else {\n return (device.mobile() || device.tablet() || this.isTouchDevice()) ? 2 : 1;\n }\n }\n\n private static isTouchDevice() { // https://patrickhlauke.github.io/touch/touchscreen-detection/\n let result = false;\n if (window.PointerEvent && ('maxTouchPoints' in navigator)) {\n // if Pointer Events are supported, just check maxTouchPoints\n if (navigator.maxTouchPoints > 0) {\n result = true;\n }\n } else {\n // no Pointer Events...\n if (window.matchMedia && window.matchMedia('(any-pointer:coarse)').matches) {\n // check for any-pointer:coarse which mostly means touchscreen\n result = true;\n } else if (window.TouchEvent || ('ontouchstart' in window)) {\n // last resort - check for exposed touch events API / event handler\n result = true;\n }\n }\n return result;\n }\n\n private static calculateMinimumPointsRatio(\n width: number,\n height: number\n ): number {\n const estimatedRadius = 0.35;\n const estimatedTrackingArea = Math.PI * ((estimatedRadius * height) ** 2);\n const ratio = estimatedTrackingArea / (width * height);\n return ratio;\n }\n\n private static createOptionsForTarget(target: string): {\n width: number,\n height: number\n } {\n const targetElement = document.getElementById(target);\n let options = {\n width: 0,\n height: 0\n };\n if (!targetElement) {\n return options;\n }\n if (this.elementHasSize(targetElement)) {\n options = {\n height: targetElement.clientHeight,\n width: targetElement.clientWidth,\n };\n } else if (targetElement.parentElement && this.elementHasSize(targetElement.parentElement)) {\n options = {\n height: targetElement.parentElement.clientHeight,\n width: targetElement.parentElement.clientWidth,\n };\n }\n return options;\n }\n\n private static elementHasSize(element: HTMLElement) {\n return element.clientWidth > 0 && element.clientHeight > 0;\n }\n\n private static calculateFittingModel(meshOptions: MeshOptions): MeshOptions {\n return (meshOptions) ? {\n videoId: (meshOptions.videoId) ? meshOptions.videoId : undefined,\n pupillaryDistance: (meshOptions.pupillaryDistance) ? meshOptions.pupillaryDistance : 63\n } : {\n videoId: undefined,\n pupillaryDistance: 63\n };\n }\n\n public static glassesAreReady(glasses: MirrorB3dAsset | MirrorGltfAsset): boolean {\n if (!!glasses) {\n return glasses.status === 'READY';\n } else {\n return false;\n }\n }\n}\n","import { FeatureUnavailableError } from '../../errors/errors';\nimport { AnalyticsHelper, setSessionTimeout } from '../../helpers/AnalyticsHelper';\nimport { setCallbacks, setPrivacyCallbacks } from '../../helpers/CallbackHelper';\nimport { InitializationHelper } from '../../helpers/InitializationHelper';\nimport { ParameterHelper } from '../../helpers/ParameterHelper';\nimport { Features } from '../../interfaces/Features';\nimport { InitializationParams, InitializationReturns } from '../../interfaces/InitializationTypes';\nimport { AppActions } from '../../reducers/appReducer';\nimport { UserActions } from '../../reducers/userReducer';\nimport { createLogger, sendAppViewSession, sendError } from '../../remotelog/VmLogger';\nimport { FeatureLicensingService } from '../service/FeatureLicensingService';\nimport { configureVmStore, VmStore } from '../VmCore';\nimport { warmUp } from './WarmUp';\n\nconst logger = createLogger('Initialize');\n\nlet errorListenerAdded = false;\n\nconst initialize = (params: InitializationParams): Promise => {\n\n if (!params.options.environment) {\n params.options.environment = 'PRODUCTION';\n }\n\n if (!errorListenerAdded) {\n window.addEventListener('error', (event) => { sendError(event.error); });\n errorListenerAdded = true;\n }\n\n return FeatureLicensingService.initialize(\n params.options.key,\n params.options.environment\n ).then(() => {\n\n const validatedParams = ParameterHelper.mergeInitializationParams(params);\n if (validatedParams.privacy.bipaActive && !FeatureLicensingService.isFeatureAuthorized(Features.VM_BIPA)) {\n throw new FeatureUnavailableError(Features.VM_BIPA);\n }\n\n const options = validatedParams.options;\n\n AnalyticsHelper.initialize(\n options.environment,\n options.analyticsConfig, {\n brand: options.brand,\n channel: options.channel,\n locale: options.locale,\n storeId: options.storeId,\n storeRegion: options.storeRegion,\n storeCompany: options.storeCompany,\n globalStoreId: options.globalStoreId,\n }\n );\n setSessionTimeout(options.sessionTimeout);\n\n logger.debug('initializing virtual mirror [channel={},brand={},locale={},storeId={}]',\n options.channel, options.brand, options.locale, options.storeId);\n\n return Promise.all([\n InitializationHelper.initialize(validatedParams.options, validatedParams.privacy),\n Promise.resolve(options)\n ]);\n\n }).then((initReturn) => {\n if (VmStore === undefined) {\n configureVmStore();\n }\n\n setCallbacks(params.options.callbacks);\n setPrivacyCallbacks(params.privacyCallbacks);\n\n const userStore = initReturn[0].userStore;\n const supportedFeatures = initReturn[0].supportedFeatures;\n const options = initReturn[1];\n\n if (options.environment !== VmStore.getState().app.environment) {\n VmStore.dispatch(AppActions.resetAuth());\n }\n\n VmStore.dispatch(AppActions.setAuth({ accessToken: params.auth?.accessToken, refreshToken: params.auth?.accessToken }));\n VmStore.dispatch(AppActions.setEnvironment(options.environment));\n VmStore.dispatch(AppActions.setPrivacyOptions(params.privacy));\n VmStore.dispatch(AppActions.setLoadingStatus({ type: 'INITIALIZATION', status: true }));\n VmStore.dispatch(UserActions.setUser(userStore));\n\n logger.info('virtual mirror initialized with options {}', JSON.stringify(options));\n AnalyticsHelper.onInitializeSuccess();\n sendAppViewSession.initialize(options);\n\n // warm up the posetracker\n warmUp(options.environment, options.key);\n return {\n userId: undefined,\n locale: userStore.locale,\n supportedFeatures: supportedFeatures,\n };\n\n }).catch((e) => {\n logger.error('virtual mirror initialization failed with options {} [{}]', JSON.stringify(params.options), JSON.stringify(e));\n AnalyticsHelper.onInitializeError();\n sendAppViewSession.initializeError(params.options);\n throw e;\n });\n};\n\nexport {\n initialize\n};\n","import { DeviceDetection } from '@luxottica/vm-devicedetection';\nimport { WebCam, WebCamStream } from '@luxottica/vm-webcam';\nimport { createLogger } from '../../remotelog/VmLogger';\n\nconst logger = createLogger('VmWebCam');\n\nexport class VmWebCam {\n private webCam: WebCam;\n private webCamStream: WebCamStream;\n private static instance: VmWebCam;\n\n constructor() {\n this.webCam = new WebCam();\n }\n\n public static getInstance() {\n if (!VmWebCam.instance) {\n VmWebCam.instance = new VmWebCam();\n }\n return VmWebCam.instance;\n }\n\n public tryToOpenWebCam(w, h) {\n return this.webCam.tryToOpenWebCam(w, h, 'user');\n }\n\n public initStreamObject(options, stream) {\n this.webCamStream = this.createStreamObject(options, stream);\n }\n\n public closeCurrentMediaStream() {\n this.webCam.closeCurrentMediaStream();\n }\n\n public pause() {\n const deviceDetection = new DeviceDetection();\n if (!this.webCamStream.isNativeStream() && deviceDetection.isAppleiOS13()) {\n logger.warn('Can\\'t pause Webcam on iOS 13 device due a bug that would freeze video stream on resume playing');\n return;\n }\n this.webCamStream.streamObject.pause();\n }\n\n public play() {\n return this.webCamStream.streamObject.play();\n }\n\n public get stream() {\n return this.webCamStream;\n }\n\n private createStreamObject(options, stream) {\n return this.webCam.createStreamObject(options, stream);\n }\n}\n","import { EventBus } from '@luxottica/vm-eventbus';\nimport { Events } from '../../constants/Events';\nimport { VmWebCam } from '../mirror/VmWebCam';\nimport { vmIsInitialized } from '../VmCore';\n\nconst pause = (): void => {\n if (!vmIsInitialized()) {\n return;\n } else {\n VmWebCam.getInstance().pause();\n EventBus.publish(Events.PAUSE, {});\n }\n};\n\nexport {\n pause\n};\n","import { Catalog, CatalogConfiguration, GlassesEnvironment, UpcAvailability } from '@luxottica/vm-glasses';\nimport { DefaultAssetEnvironmentOptions } from '../../constants/DefaultEnvironmentOptions';\nimport { DefaultTrackingOptions } from '../../constants/DefaultTrackingOptions';\nimport { MountComponentError, NotInitializedError, UpcMissingError } from '../../errors/errors';\nimport { AdobeHelper } from '../../helpers/AdobeHelper';\nimport { AnalyticsHelper } from '../../helpers/AnalyticsHelper';\nimport { ParameterHelper } from '../../helpers/ParameterHelper';\nimport { MirrorInternalOptions } from '../../interfaces/MirrorOptions';\nimport { RenderMirrorParams } from '../../interfaces/RenderingTypes';\nimport { MirrorActions } from '../../reducers/mirrorReducer';\nimport { createLogger, sendAppViewSession } from '../../remotelog/VmLogger';\nimport { vmIsInitialized, VmStore } from '../VmCore';\nimport { TransitionColorHelper } from '../../helpers/TransitionColorHelper';\nimport { FeatureLicensingService } from '../service/FeatureLicensingService';\n\nconst logger = createLogger('RenderMirror');\n\nconst getUpcAvailability = (\n glassesConfig: CatalogConfiguration,\n upc: string\n): Promise => {\n return Catalog.getUpcAvailability(glassesConfig, upc);\n};\n\nconst isDistributorEnv = (glassesEnvironment: GlassesEnvironment): boolean => {\n return glassesEnvironment === GlassesEnvironment.DISTRIBUTOR_APPROVATION_PRODUCTION ||\n glassesEnvironment === GlassesEnvironment.DISTRIBUTOR_APPROVATION_STAGING ||\n glassesEnvironment === GlassesEnvironment.DISTRIBUTOR_VALIDATION_PRODUCTION ||\n glassesEnvironment === GlassesEnvironment.DISTRIBUTOR_VALIDATION_STAGING;\n};\n\nconst renderMirror = (\n params: RenderMirrorParams\n): Promise => {\n if (!vmIsInitialized()) {\n return Promise.reject(new NotInitializedError());\n }\n\n const { target, upc, options } = params;\n\n AnalyticsHelper.onSessionStart();\n\n // ALWAYS USE THIS OBJECT TO ACCESS GLASSES'S ENVIRONMENT NAME\n const glassesConfig: CatalogConfiguration = {\n // IMPORTANT\n // This toUpperCase has been added to quick go in production on Jun 27th 2022 on Oakley configurator\n // The configutator wrongly return lowercase environments and now is too late to release a client side fix\n env: (!!options?.environment?.glasses) ? options.environment.glasses.toUpperCase() as GlassesEnvironment : DefaultAssetEnvironmentOptions.glasses\n };\n\n return Promise.all([\n getUpcAvailability(glassesConfig, upc),\n // get new colors if the user is trying to render transitions lenses, trust the helper for the cache\n !!options && options.transitionColor && TransitionColorHelper.downloadTransitionColors({\n key: FeatureLicensingService.getKey(),\n env: glassesConfig.env\n })\n ]).then((result) => {\n const upcAvailability: UpcAvailability = result[0];\n // TODO: improve glasses type management\n const glassesType: GlassesType = upcAvailability.glassesType; // (options.glassesType) ? options.glassesType : 'B3D';\n const mergedOptions = ParameterHelper.mergeMirrorOptions(target, glassesType, options);\n \n // TODO: leave for mock env\n if (glassesConfig.env === GlassesEnvironment.MOCK) {\n logger.debug('rendering virtual mirror for upc {} on target {}', upc, target);\n sendAppViewSession.upc(upc);\n \n return renderMirrorPromise(target, upcAvailability, mergedOptions);\n\n } else {\n if (glassesType === 'B3D' && (upcAvailability.available[256] || upcAvailability.available[512] || isDistributorEnv(glassesConfig.env))\n || glassesType === 'GLTF' && (!!upcAvailability.lods.includes(1) || !!upcAvailability.lods.includes(2))) {\n logger.debug('rendering virtual mirror for upc {} on target {}', upc, target);\n sendAppViewSession.upc(upc);\n \n return renderMirrorPromise(target, upcAvailability, mergedOptions);\n \n } else {\n logger.warn('rendering virtual mirror not possible: upc {} isn\\'t supported', upc);\n sendAppViewSession.upcError(upc);\n const upcMissingError = new UpcMissingError(upc);\n AdobeHelper.sendError(upcMissingError, upc);\n throw upcMissingError;\n }\n }\n });\n};\n\nconst renderMirrorPromise = (\n target: string,\n upcAvailability: UpcAvailability,\n mirrorOptions: Required\n): Promise => {\n\n return new Promise((resolve, reject) => {\n import(/* webpackChunkName: \"MirrorAsyncRoot\" */ '../mirror/MirrorAsyncRoot')\n .then(({ MirrorAsyncRoot: MirrorAsyncRoot }) => {\n VmStore.dispatch(MirrorActions.setMirrorOptions(mirrorOptions));\n \n logger.debug('vm default tracking options: {}', JSON.stringify(DefaultTrackingOptions));\n logger.debug('vm mirror options: {}', JSON.stringify(mirrorOptions));\n logger.debug('mounting render mirror component on div {}', target);\n \n try {\n const container = document.getElementById(target);\n if (container) {\n MirrorAsyncRoot.mountMirror(\n container,\n VmStore,\n upcAvailability,\n resolve,\n reject,\n mirrorOptions);\n } else {\n const mountComponentError = new MountComponentError(target);\n AdobeHelper.sendError(mountComponentError);\n reject(mountComponentError);\n }\n } catch (e) {\n const mountComponentError = new MountComponentError(target);\n AdobeHelper.sendError(mountComponentError);\n reject(mountComponentError);\n }\n }).catch((e) => {\n logger.error(e);\n const mountComponentError = new MountComponentError(target);\n AdobeHelper.sendError(mountComponentError);\n reject(mountComponentError);\n });\n });\n};\n\nexport {\n renderMirror,\n};\n","import { EventBus } from '@luxottica/vm-eventbus';\nimport { Events } from '../../constants/Events';\nimport { NotInitializedError } from '../../errors/errors';\nimport { createLogger } from '../../remotelog/VmLogger';\nimport { VmWebCam } from '../mirror/VmWebCam';\nimport { vmIsInitialized } from '../VmCore';\n\nconst logger = createLogger('Resume');\n\nconst resume = (): Promise => {\n if (!vmIsInitialized()) {\n return Promise.reject(new NotInitializedError());\n } else {\n return VmWebCam.getInstance().play().then(() => {\n EventBus.publish(Events.RESUME, {});\n }).catch((e) => {\n logger.error(e);\n });\n }\n};\n\nexport {\n resume\n};\n","import { TransitionColorHelper } from '../../helpers/TransitionColorHelper';\nimport { createLogger } from '../../remotelog/VmLogger';\n\nconst logger = createLogger('SetTransitionOverrideColor');\n\nconst setTransitionOverrideColor = (transitionColor: TransitionLens): void => {\n logger.debug('setting new override color', transitionColor);\n TransitionColorHelper.setTransitionOverrideColor(transitionColor);\n};\n\nexport {\n setTransitionOverrideColor\n};\n","import { Catalog, CatalogConfiguration, GlassesEnvironment, UpcAvailability } from '@luxottica/vm-glasses';\nimport { MicroserviceEnvironment } from '@luxottica/vto-microservices';\nimport { FeatureLicensingService } from './app/service/FeatureLicensingService';\nimport { Features } from './interfaces/Features';\n\nclass Catalogue {\n\n private static config: CatalogConfiguration;\n\n private static featureLicensingInitialization;\n\n private constructor(env: GlassesEnvironment) {\n Catalogue.config = { env };\n }\n public static build(\n {catalogueEnvironment, featureLicensingEnv, key}:\n {\n catalogueEnvironment?: GlassesEnvironment,\n featureLicensingEnv?: MicroserviceEnvironment\n key: string\n }): Catalogue {\n\n this.featureLicensingInitialization = FeatureLicensingService.initialize(key, !!featureLicensingEnv ? featureLicensingEnv : 'PRODUCTION');\n\n return new Catalogue(!!catalogueEnvironment ? catalogueEnvironment : 'PROD' as GlassesEnvironment);\n }\n\n /**\n * Please do not use this method, use isUpcSupportedImproved() instead\n * @param upcs \n * @returns \n */\n public isUpcSupported(...upcs: string[]): { [upc: string]: Promise; } {\n const result: { [upc: string]: Promise; } = {};\n upcs.forEach(upc => {\n result[upc] = Catalog.getUpcAvailability(Catalogue.config, upc);\n });\n\n return result;\n }\n\n /**\n * This method optimise the network calls\n * @param upcs a spreaded array with all the upcs you want to check\n * @returns \n * \n * @example const catalogueUpcs = await VirtualMirrorCatalogue.build({\n key: 'YOUR-LICENSING-KEY',\n }).isUpcSupportedImproved(...upcs)\n \n console.log(catalogueUpcs[0].getUpc())\n console.log(catalogueUpcs[0].isTransition())\n console.log(catalogueUpcs[0].isAvailable())\n */\n public isUpcSupportedImproved(...upcs: string[]): Promise {\n return Catalog.getMultipleUpcAvailability(Catalogue.config, ...upcs);\n }\n\n public downloadTransitionColorCatalogue(): Promise<{\n [name: string]: TransitionLens;\n }> {\n return Catalogue.featureLicensingInitialization\n .then(() => {\n if (FeatureLicensingService.isFeatureAuthorized(Features.VM_TRANSITIONS)) {\n return Catalog.downloadTransitionLenses(Catalogue.config);\n } else {\n return Promise.resolve({});\n }\n });\n }\n}\n\nexport { Catalogue, UpcAvailability };\n","import { AgreementType, BipaFormData, BipaManager, BipaPage, PrivacyLocalization, PrivacyLocalizationKey } from '@luxottica/bipa-manager';\nimport { MicroserviceEnvironment } from '@luxottica/vto-microservices';\nimport { GlassesEnvironment, UpcAvailability, TransitionLens, TransitionLensState, TransitionLensStep, TransitionLensType } from '@luxottica/vm-glasses';\nimport { version } from '../package.json';\nimport { warmUp } from './app/functions/WarmUp';\nimport { animateOpacity } from './app/functions/AnimateOpacity';\nimport { isBrowserSupported } from './app/functions/IsBrowserSupported';\nimport { closeMirror } from './app/functions/CloseMirror';\nimport { getBipaVersion, GetBipaVersionResponse } from './app/functions/GetBipaVersion';\nimport { getScreenshot } from './app/functions/GetScreenshot';\nimport { initialize } from './app/functions/Initialize';\nimport { pause } from './app/functions/Pause';\nimport { renderMirror } from './app/functions/RenderMirror';\nimport { resume } from './app/functions/Resume';\nimport { saveBipaEntry, SaveBipaEntryParams } from './app/functions/SaveBipaEntry';\nimport { setTransitionOpacity } from './app/functions/SetTransitionOpacity';\nimport { setTransitionOverrideColor } from './app/functions/SetTransitionOverrideColor';\nimport { Catalogue } from './Catalogue';\nimport { performanceEvents } from './constants/DOMEvents';\nimport { UpcMissingError, UpcSupportedError, VtoError } from './errors/errors';\nimport { MirrorTranslation } from './helpers/LocalizationDefaults';\nimport { LocalizationHelper } from './helpers/LocalizationHelper';\nimport { DeepPartial } from './interfaces/DeepPartial';\nimport { InitializationOptions, InitializationParams, InitializationReturns, PrivacyOptions } from './interfaces/InitializationTypes';\nimport { AnimateOpacityParams, RenderMirrorParams, SetTransitionOpacityParams } from './interfaces/RenderingTypes';\nimport { Screenshot } from './interfaces/Screenshot';\nimport { SupportedFeatures } from './interfaces/SupportedFeatures';\n\nconst VirtualMirror = {\n\n plugins: undefined,\n\n version(): string {\n return 'v' + version;\n },\n\n /**\n * This method can be used to download and load in memory heavy parts of VM libraries, like for example the pose estimation webassembly\n * It does not return a promise even if internally it will produce some network calls.\n * You can call this method when your page is ready for the interactions.\n * \n * This method is also called internally by VirtualMirror.initialize()\n * \n * @param environment 'STAGING' | 'ACCEPTANCE' | 'PRODUCTION' - defaults to 'PRODUCTION'\n * @param key the license key, if you pass the license key here VM will try to warm up those components that usually are licensed\n */\n warmUp(environment?: MicroserviceEnvironment, key?: string): void {\n warmUp(environment, key);\n },\n\n initialize(params: InitializationParams): Promise {\n return initialize(params);\n },\n\n overrideLocalization(translation: DeepPartial): void {\n return LocalizationHelper.setOverrides(translation);\n },\n\n getMirrorDefaultLocalization(): MirrorTranslation {\n return LocalizationHelper.getDefaults();\n },\n\n // ***\n // BIPA FUNCTIONS\n // ***\n\n getBipaVersion(): Promise {\n return getBipaVersion();\n },\n\n saveBipaEntry(params: SaveBipaEntryParams): Promise {\n return saveBipaEntry(params);\n },\n\n resetBipaState(): void {\n document.cookie = `${BipaManager.getCookieName(AgreementType.BASIC)}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;\n document.cookie = `${BipaManager.getCookieName(AgreementType.BIOMETRIC)}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;\n },\n\n // ***\n // RENDER FUNCTIONS\n // ***\n\n renderMirror(params: RenderMirrorParams): Promise {\n return renderMirror(params);\n },\n\n pause(): void {\n return pause();\n },\n\n resume(): Promise {\n return resume();\n },\n\n /**\n * @deprecated The method should not be used and will be removed in the next major version 10.0.0\n */\n fitMeBetter(): Promise {\n console.error('Virtual Mirror does not expose Fit Me Better anymore. Please consider remove any reference to this method');\n return Promise.resolve();\n },\n\n getScreenshot(type = 'image/jpeg', quality = 0.9): Promise {\n return getScreenshot(type, quality);\n },\n\n setTransitionOpacity(params: SetTransitionOpacityParams): void {\n return setTransitionOpacity(params?.opacity);\n },\n\n setTransitionOverrideColor(TransitionLens: TransitionLens): void {\n return setTransitionOverrideColor(TransitionLens);\n },\n\n animateOpacity(params: AnimateOpacityParams = { duration: 1000 }): void {\n return animateOpacity(params?.duration);\n },\n\n closeMirror(params: { target: string }): Promise {\n return closeMirror(params?.target);\n },\n\n getPlugins() {\n if (!this.plugins) {\n return import('./app/functions/Plugins').then((plugins) => {\n this.plugins = plugins;\n return plugins;\n });\n }\n\n return Promise.resolve(this.plugins);\n },\n\n getPluginStatus(): Promise<{\n pluginId: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pluginOptions: any;\n }[]> {\n return this.getPlugins().then(({ PluginManager }) => {\n return PluginManager.getStatus();\n });\n },\n\n addPlugin(pluginId: string, pluginOptions?: any) {\n return this.getPlugins().then(({ PluginManager }) => {\n PluginManager.add({ pluginId, pluginOptions });\n });\n },\n\n removePlugin(pluginId: string) {\n return this.getPlugins().then(({ PluginManager }) => {\n PluginManager.remove(pluginId);\n });\n },\n\n /**\n * Check if your browser supports all the minimum technology to run Virtual Mirror\n * \n * @returns \n */\n isBrowserSupported(): Promise {\n return isBrowserSupported();\n },\n};\n\nexport {\n VirtualMirror,\n RenderMirrorParams,\n Catalogue as VirtualMirrorCatalogue,\n GlassesEnvironment,\n MicroserviceEnvironment,\n UpcAvailability,\n VtoError,\n VtoError as VmAbstractError,\n UpcMissingError,\n UpcSupportedError,\n Screenshot,\n SupportedFeatures,\n InitializationParams,\n InitializationOptions,\n InitializationReturns,\n PrivacyOptions,\n BipaPage,\n BipaFormData,\n PrivacyLocalization,\n PrivacyLocalizationKey,\n TransitionLens,\n TransitionLensType,\n TransitionLensState,\n TransitionLensStep,\n performanceEvents\n};\n","import { BipaManager } from '@luxottica/bipa-manager';\nimport { FeatureUnavailableError, NotInitializedError } from '../../errors/errors';\nimport { CallbackHelper } from '../../helpers/CallbackHelper';\nimport { RequestHelper } from '../../helpers/RequestHelper';\nimport { Features } from '../../interfaces/Features';\nimport { FeatureLicensingService } from '../service/FeatureLicensingService';\nimport { vmIsInitialized, VmStore } from '../VmCore';\n\ninterface GetBipaVersionResponse {\n version: number;\n description: string;\n text: string;\n}\n\nconst getBipaVersion = (): Promise => {\n if (!vmIsInitialized()) {\n return Promise.reject(new NotInitializedError());\n }\n\n if (!FeatureLicensingService.isFeatureAuthorized(Features.VM_GET_BIPA_VERSION)) {\n return Promise.reject(new FeatureUnavailableError(Features.VM_GET_BIPA_VERSION));\n }\n\n return RequestHelper.login(\n VmStore.getState().app.environment\n ).then(() => {\n return BipaManager.getBipaVersion({\n environment: VmStore.getState().app.environment,\n locale: VmStore.getState().user.locale,\n accessToken: VmStore.getState().app.auth.accessToken,\n refreshToken: VmStore.getState().app.auth.refreshToken,\n onAuthUpdated: CallbackHelper.onAuthUpdated\n });\n });\n};\n\nexport {\n getBipaVersion,\n GetBipaVersionResponse\n};\n","import { BipaManager } from '@luxottica/bipa-manager';\nimport { FeatureUnavailableError, NotInitializedError } from '../../errors/errors';\nimport { CallbackHelper } from '../../helpers/CallbackHelper';\nimport { RequestHelper } from '../../helpers/RequestHelper';\nimport { Features } from '../../interfaces/Features';\nimport { FeatureLicensingService } from '../service/FeatureLicensingService';\nimport { vmIsInitialized, VmStore } from '../VmCore';\n\ninterface SaveBipaEntryParams {\n firstName: string;\n lastName: string;\n email: string;\n bipaVersion: number;\n}\n\nconst saveBipaEntry = (\n params: SaveBipaEntryParams\n): Promise => {\n if (!vmIsInitialized()) {\n return Promise.reject(new NotInitializedError());\n }\n\n if (!FeatureLicensingService.isFeatureAuthorized(Features.VM_SAVE_BIPA_ENTRY)) {\n return Promise.reject(new FeatureUnavailableError(Features.VM_SAVE_BIPA_ENTRY));\n }\n\n return RequestHelper.login(\n VmStore.getState().app.environment\n ).then(() => {\n return BipaManager.saveBipaEntry({\n environment: VmStore.getState().app.environment,\n source: VmStore.getState().app.privacy.source,\n accessToken: VmStore.getState().app.auth.accessToken,\n refreshToken: VmStore.getState().app.auth.refreshToken,\n bipaVersion: params.bipaVersion,\n formData: {\n firstName: params.firstName,\n lastName: params.lastName,\n email: params.email\n },\n onAuthUpdated: CallbackHelper.onAuthUpdated\n });\n });\n};\n\nexport {\n saveBipaEntry,\n SaveBipaEntryParams\n};\n","import { NotInitializedError, OpacityError } from '../../errors/errors';\nimport { TransitionColorHelper } from '../../helpers/TransitionColorHelper';\nimport { vmIsInitialized } from '../VmCore';\n\nconst setTransitionOpacity = (opacity = 0): void => {\n if (!vmIsInitialized()) {\n throw new NotInitializedError();\n }\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","export const isBrowserSupported: () => Promise = () => {\n return import('../../helpers/SupportedFeaturesHelper')\n .then(({ SupportedFeaturesHelper }) => {\n return SupportedFeaturesHelper.getSupportedFeatures();\n })\n .then((supportedFeatures): Promise => {\n return Promise.resolve(\n supportedFeatures.wasmSupport &&\n supportedFeatures.webcamAccess &&\n supportedFeatures.webcamAvailable &&\n supportedFeatures.webglRendering\n );\n });\n};\n","import { RemoteLogConfig } from \"@luxottica/vm-remotelog\";\nimport mitt from \"mitt\";\nimport { name, version } from \"../package.json\";\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, \"EventBus\");\n\nclass EventBus {\n\n public static publish(evtName: string, evtData: any) {\n logger.debug(\"publishing event '{}': {}\", evtName, JSON.stringify(evtData));\n EventBus.emitter.emit(evtName, evtData);\n logger.debug(\"published event '{}': {}\", evtName, JSON.stringify(evtData));\n }\n\n public static register(evtName: string, evtHandler: any) {\n logger.debug(\"registering event '{}': {}\", evtName, JSON.stringify(evtHandler));\n EventBus.emitter.on(evtName, evtHandler);\n logger.debug(\"registered event '{}': {}\", evtName, JSON.stringify(evtHandler));\n }\n\n private static emitter: mitt.Emitter = mitt();\n\n constructor() {\n logger.info(\"event bus initialized: {}\", EventBus.emitter.constructor.name);\n }\n\n}\n\nexport { EventBus };\n","enum GlassesEnvironment {\n PROD = 'PROD',\n PROD_LEGACY = 'PROD_LEGACY',\n TEST = 'TEST',\n TEST_LEGACY = 'TEST_LEGACY',\n TEST_TRANSITIONS = 'TEST_TRANSITIONS',\n QA_GLTF_PROD = 'QA_GLTF_PROD',\n QA_GLTF_TEST = 'QA_GLTF_TEST',\n QA_B3D_PROD = 'QA_B3D_PROD',\n QA_B3D_TEST = 'QA_B3D_TEST',\n MOCK = 'MOCK',\n // environments for distributor developments\n DISTRIBUTOR_VALIDATION_STAGING = 'DISTRIBUTOR_VALIDATION_STAGING',\n DISTRIBUTOR_APPROVATION_STAGING = 'DISTRIBUTOR_APPROVATION_STAGING',\n DISTRIBUTOR_VALIDATION_PRODUCTION = 'DISTRIBUTOR_VALIDATION_PRODUCTION',\n DISTRIBUTOR_APPROVATION_PRODUCTION = 'DISTRIBUTOR_APPROVATION_PRODUCTION',\n}\n\nexport {\n GlassesEnvironment\n};\n","import { GlassesEnvironment } from '../constants/Environment';\n\ninterface EnvironmentConfig {\n name: string;\n catalogHost: string;\n transitionsEndpoint: string;\n b3dHost: string;\n gltfHost: string;\n gltfPointer: string;\n customDistributorHost: string;\n customDistributorGetPermutation: string;\n customDistributorKey: string;\n assetType: 'ZIPPED' | 'SEPARATE';\n}\n\nconst hosts: {\n [key in GlassesEnvironment]: EnvironmentConfig;\n} = {\n MOCK: {\n name: 'PROD',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://luxdeepblue.github.io/vm-test-artifacts/api/transition/v3/vocabulary',\n b3dHost: 'https://vmcore.luxottica.com',\n gltfHost: 'https://mobile-catalogue-3d-model-test.s3-accelerate.amazonaws.com/public/vto-poc',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'HnqGNWeO.Px2v1cUrm3ffk6gC0OOdTgJRoaOfxClC',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'SEPARATE'\n },\n PROD: {\n name: 'PROD',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://vmcore.luxottica.com',\n gltfHost: 'https://vmcore.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'HnqGNWeO.Px2v1cUrm3ffk6gC0OOdTgJRoaOfxClC',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'SEPARATE'\n },\n PROD_LEGACY: {\n name: 'PROD_LEGACY',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://vto-3d-assets.luxdeepblue.com',\n gltfHost: 'https://vmcore.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'HnqGNWeO.Px2v1cUrm3ffk6gC0OOdTgJRoaOfxClC',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n TEST: {\n name: 'TEST',\n catalogHost: 'https://vmcore-test.luxottica.com',\n transitionsEndpoint: 'https://test-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://vmcore-test.luxottica.com',\n gltfHost: 'https://vmcore-test.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://staging-distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'bMhq6JPO.nLtuIsJU61lazsX3pnj10iH0wv2Dr7KA',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n TEST_LEGACY: {\n name: 'TEST_LEGACY',\n catalogHost: 'https://test-api-vtocatalogue.luxdeepblue.com',\n transitionsEndpoint: 'https://test-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://vto-3d-assets-test.luxdeepblue.com',\n gltfHost: 'https://vmcore-test.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://staging-distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'bMhq6JPO.nLtuIsJU61lazsX3pnj10iH0wv2Dr7KA',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'SEPARATE'\n },\n\n /* \n * Used to point to a static transitions lenses catalog for easier developments\n */\n TEST_TRANSITIONS: {\n name: 'TEST',\n catalogHost: 'https://vmcore-test.luxottica.com',\n transitionsEndpoint: 'https://luxdeepblue.github.io/vm-test-artifacts/api/transition/v3/vocabulary',\n b3dHost: 'https://vmcore-test.luxottica.com',\n gltfHost: 'https://vmcore-test.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf',\n customDistributorHost: 'https://staging-distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'bMhq6JPO.nLtuIsJU61lazsX3pnj10iH0wv2Dr7KA',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n QA_GLTF_PROD: {\n name: 'QA_PROD',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://s3.amazonaws.com/vto-3d-assets-qa',\n gltfHost: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/upc/v1',\n gltfPointer: '/pointers/gltf?qa=true',\n customDistributorHost: 'https://distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'HnqGNWeO.Px2v1cUrm3ffk6gC0OOdTgJRoaOfxClC',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n QA_GLTF_TEST: {\n name: 'QA_TEST',\n catalogHost: 'https://test-api-vtocatalogue.luxdeepblue.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://s3.amazonaws.com/vto-3d-assets-qa-test',\n gltfHost: 'https://vmcore-test.luxottica.com/api/upc/v1',\n gltfPointer: '/pointers/gltf?qa=true',\n customDistributorHost: 'https://staging-distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'bMhq6JPO.nLtuIsJU61lazsX3pnj10iH0wv2Dr7KA',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n QA_B3D_PROD: {\n name: 'QA_PROD',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://s3.amazonaws.com/vto-3d-assets-qa',\n gltfHost: 'https://gw-api-vtocatalogue.luxdeepblue.com/api/upc/v1',\n gltfPointer: '/pointers/gltf?qa=true',\n customDistributorHost: 'https://distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'HnqGNWeO.Px2v1cUrm3ffk6gC0OOdTgJRoaOfxClC',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n QA_B3D_TEST: {\n name: 'QA_TEST',\n catalogHost: 'https://test-api-vtocatalogue.luxdeepblue.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://s3.amazonaws.com/vto-3d-assets-qa-test',\n gltfHost: 'https://test-api-vtocatalogue.luxdeepblue.com/api/upc/v1',\n gltfPointer: '/pointers/gltf?qa=true',\n customDistributorHost: 'https://staging-distributor-distributor.luxdeepblue.com',\n customDistributorKey: 'bMhq6JPO.nLtuIsJU61lazsX3pnj10iH0wv2Dr7KA',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n // environments for distributor developments\n DISTRIBUTOR_VALIDATION_STAGING: {\n name: 'DISTRIBUTOR_VALIDATION_STAGING',\n catalogHost: 'https://test-api-vtocatalogue.luxdeepblue.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://distributor-assets-staging.s3.amazonaws.com/validation',\n gltfHost: '',\n gltfPointer: '',\n customDistributorHost: '',\n customDistributorKey: '',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n DISTRIBUTOR_APPROVATION_STAGING: {\n name: 'DISTRIBUTOR_APPROVATION_STAGING',\n catalogHost: 'https://test-api-vtocatalogue.luxdeepblue.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://distributor-assets-staging.s3.amazonaws.com/approvation',\n gltfHost: '',\n gltfPointer: '',\n customDistributorHost: '',\n customDistributorKey: '',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n DISTRIBUTOR_VALIDATION_PRODUCTION: {\n name: 'DISTRIBUTOR_VALIDATION_PRODUCTION',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://distributor-assets-production.s3.amazonaws.com/validation',\n gltfHost: '',\n gltfPointer: '',\n customDistributorHost: '',\n customDistributorKey: '',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n },\n DISTRIBUTOR_APPROVATION_PRODUCTION: {\n name: 'DISTRIBUTOR_APPROVATION_PRODUCTION',\n catalogHost: 'https://vmcore.luxottica.com',\n transitionsEndpoint: 'https://qa-gw-api-vtocatalogue.luxdeepblue.com/api/transition/v3/vocabulary',\n b3dHost: 'https://distributor-assets-production.s3.amazonaws.com/approvation',\n gltfHost: '',\n gltfPointer: '',\n customDistributorHost: '',\n customDistributorKey: '',\n customDistributorGetPermutation: '/api/getPermutation?token=',\n assetType: 'ZIPPED'\n }\n};\n\nconst getEnvironmentConfig = (env: GlassesEnvironment | undefined): EnvironmentConfig => {\n return (env) ? hosts[env] : hosts.PROD;\n};\n\nexport { getEnvironmentConfig, EnvironmentConfig };\n","import { CatalogConfiguration } from '../interfaces/CatalogConfiguration';\nimport { getEnvironmentConfig } from './GlassesApiConfig';\n\n// const upcsAvailabilityAuthenticatedApi = '/authenticated/upc/{upcs}/availability';\nconst upcsAvailabilityApi = '/api/upc/v3/{upcs}/availability';\n\nconst CatalogueApiConfig = {\n getUpcsAvailabilityApiEndpoint(config: CatalogConfiguration, upcString: string): string {\n const envConfig = getEnvironmentConfig(config.env);\n\n //TODO: remove after prod api is complete\n if (config.env.includes('TEST')) {\n return `${envConfig.catalogHost}${upcsAvailabilityApi}`.replace('{upcs}', upcString);\n } else {\n return (!!config.key) ?\n `${envConfig.catalogHost}${upcsAvailabilityApi}`.replace('{upcs}', upcString)\n :\n `${envConfig.catalogHost}${upcsAvailabilityApi}`.replace('{upcs}', upcString);\n }\n },\n\n getTransitionEndpoint(config: CatalogConfiguration): string {\n const envConfig = getEnvironmentConfig(config.env);\n return envConfig.transitionsEndpoint;\n }\n};\n\nexport { CatalogueApiConfig };\n","import { UpcAvailability } from '../../interfaces/UpcAvailability';\n\nexport const notAvailableResponse = (upc: string): UpcAvailability => {\n return {\n upc: upc,\n available: { 256: false, 512: false },\n transitions: { 256: false, 512: false },\n lods: [],\n glassesType: undefined,\n getUpc: () => upc,\n isAvailable: () => false,\n isTransition: () => false,\n };\n};\n","import { CatalogConfiguration } from '../../interfaces/CatalogConfiguration';\nimport { GlassesType, UpcAvailability } from '../../interfaces/UpcAvailability';\n\nconst getGlassesType = (lods: number[], config: CatalogConfiguration, isAvailable: boolean): GlassesType | undefined => {\n // TODO: remove this. To support MOCK env is necessary to return GLTF as glasses type in case the upc is not supported\n return (lods.includes(1) || config.env === 'MOCK' && !isAvailable) ? 'GLTF' : 'B3D';\n};\n\nexport const standardResponse = (catalogResponse: CatalogResponse, upc: string, config: CatalogConfiguration): UpcAvailability => {\n\n const lods = (!!catalogResponse?.lods) ? catalogResponse.lods : [];\n \n const isAvailable = catalogResponse.resolutions.includes('PX_256') || catalogResponse.resolutions.includes('PX_512') || lods.length > 0;\n\n const isTransition = catalogResponse.transitionsResolutions.includes('PX_256')\n || catalogResponse.transitionsResolutions.includes('PX_512');\n \n const glassesType = getGlassesType(lods, config, isAvailable);\n\n return {\n upc: upc,\n available: {\n '256': catalogResponse.resolutions.includes('PX_256'),\n '512': catalogResponse.resolutions.includes('PX_512')\n },\n transitions: {\n '256': catalogResponse.transitionsResolutions.includes('PX_256'),\n '512': catalogResponse.transitionsResolutions.includes('PX_512'),\n },\n lods,\n glassesType,\n getUpc: () => upc,\n isAvailable: () => isAvailable,\n isTransition: () => isTransition,\n };\n};\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { UpcAvailability } from './interfaces/UpcAvailability';\nimport { name, version } from '../package.json';\nimport { TransitionLens } from './interfaces/TransitionLens';\nimport { CatalogConfiguration } from './interfaces/CatalogConfiguration';\nimport { CatalogueApiConfig } from './config/CatalogueApiConfig';\nimport { notAvailableResponse } from './helpers/UpcAvailabilityResponse/NotAvailable';\nimport { qaToolAvailability, qaToolMultipleAvailability } from './helpers/UpcAvailabilityResponse/QATool';\nimport { standardResponse } from './helpers/UpcAvailabilityResponse/Standard';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'CatalogService');\n\nconst fetchCatalogResponse = (\n config: CatalogConfiguration,\n upc: string\n): Promise => {\n\n const apiEndpoint = CatalogueApiConfig.getUpcsAvailabilityApiEndpoint(config, upc);\n const requestInit: RequestInit = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n ...(config.key && { 'x-api-key': config.key })\n },\n mode: 'cors',\n referrerPolicy: 'unsafe-url',\n };\n return fetch(apiEndpoint, requestInit);\n};\n\nconst CatalogService = {\n getUpcAvailability(\n config: CatalogConfiguration,\n upc: string\n ): Promise {\n\n // inside the QA tool there's no UPC availability API for unpublished assets\n if (config.env.includes('QA')) {\n return Promise.resolve(qaToolAvailability(upc, config));\n }\n\n // otherwise we fetch the answer from remote\n return fetchCatalogResponse(config, upc)\n .then((response)=> {\n if (response.ok) {\n return response.json();\n }\n throw new Error(`catalog failed to respond. Response status: ${response.status}`);\n\n }).then((json: CatalogResponses) => {\n if (!!json[upc]) {\n return standardResponse(json[upc], upc, config);\n }\n return notAvailableResponse(upc);\n });\n },\n\n /**\n * \n * @param config \n * @param upc \n * @returns an array with all the availabilites already extracted from the promise\n */\n getMultipleUpcAvailability(\n config: CatalogConfiguration,\n upc: string\n ): Promise {\n\n // inside the QA tool there's no UPC availability API for unpublished assets\n if (config.env.includes('QA')) {\n return Promise.resolve(qaToolMultipleAvailability(upc, config));\n }\n\n // otherwise we fetch the answer from remote\n return fetchCatalogResponse(config, upc)\n .then((response)=> {\n if (response.ok) {\n return response.json();\n }\n throw new Error(`catalog failed to respond. Response status: ${response.status}`);\n\n }).then((json: CatalogResponses) => {\n\n const upcs = upc.split(',');\n const response: UpcAvailability[] = [];\n upcs.forEach((upc) => {\n if (!!json[upc]) {\n response.push(standardResponse(json[upc], upc, config));\n return;\n }\n response.push(notAvailableResponse(upc));\n });\n\n return response;\n });\n },\n\n downloadTransitionLenses(\n config: CatalogConfiguration,\n ): Promise<{ [name: string]: TransitionLens }> {\n\n const apiEndpoint = CatalogueApiConfig.getTransitionEndpoint(config);\n return fetch(apiEndpoint).then((response) => {\n return response.json();\n }).then((json: (TransitionLens & {name: string})[]) => {\n try {\n const result: {\n [name: string]: TransitionLens\n } = {};\n\n (json).forEach((color) => {\n result[color.name] = color;\n });\n return result;\n\n } catch (e) {\n logger.error(e);\n }\n return {};\n });\n }\n};\n\nexport {\n CatalogService,\n};\n","import { CatalogConfiguration } from '../../interfaces/CatalogConfiguration';\nimport { UpcAvailability } from '../../interfaces/UpcAvailability';\n\n // inside the QA tool every asset is considered fully available\nexport const qaToolAvailability = (upc: string, config: CatalogConfiguration): UpcAvailability => {\n return {\n upc: upc,\n available: { 256: true, 512: true },\n transitions: { 256: true, 512: true },\n lods: [0, 1, 2],\n getUpc: () => upc,\n // we need somehow to split between b3d and gltf files somehow\n glassesType: config.env.includes('GLTF') ? 'GLTF' : 'B3D',\n isAvailable: () => true,\n isTransition: () => true,\n };\n};\n\nexport const qaToolMultipleAvailability = (upc: string, config: CatalogConfiguration): UpcAvailability[] => {\n return upc.split(',').map((upc) => {\n return {\n upc: upc,\n available: { 256: true, 512: true },\n transitions: { 256: true, 512: true },\n lods: [0, 1, 2],\n getUpc: () => upc,\n // we need somehow to split between b3d and gltf files somehow\n glassesType: config.env.includes('GLTF') ? 'GLTF' : 'B3D',\n isAvailable: () => true,\n isTransition: () => true,\n };\n });\n};","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { UpcAvailability } from './interfaces/UpcAvailability';\nimport { name, version } from '../package.json';\nimport { TransitionLens } from './interfaces/TransitionLens';\nimport { CatalogConfiguration } from './interfaces/CatalogConfiguration';\nimport { CatalogService } from './CatalogService';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'Catalog');\n\nconst Catalog = {\n getUpcAvailability(\n config: CatalogConfiguration,\n upc: string\n ): Promise {\n\n logger.debug('getUpcAvailability for {}', upc);\n return CatalogService.getUpcAvailability(config, upc);\n },\n\n /**\n * This method optimise the network calls\n * @param config { env: GlassesEnvironment; key?: string; } < please always pass your key, it will become mandatory soon\n * @param upcs you can spread out an array of upcs\n * @returns \n */\n getMultipleUpcAvailability(\n config: CatalogConfiguration,\n ...upcs: string[]\n ): Promise {\n\n const upcList = upcs.reduce((previous, current) => {\n return current+','+previous;\n });\n\n logger.debug('getUpcAvailability for {}', upcs);\n return CatalogService.getMultipleUpcAvailability(config, upcList);\n },\n\n // getUpcsAvailability(\n // config: CatalogConfiguration,\n // ...upcs: string[]\n // ): Promise<{ [upc: string]: UpcAvailability }> {\n // return CatalogService.getUpcsAvailability(config, ...upcs);\n // },\n\n downloadTransitionLenses(\n config: CatalogConfiguration\n ): Promise<{ [name: string]: TransitionLens }> {\n\n logger.debug('downloadTransitionLenses');\n return CatalogService.downloadTransitionLenses(config);\n }\n};\n\nexport {\n Catalog,\n};\n","import JSZip from 'jszip';\nimport { BasicGLTFAsset } from './interfaces/BasicGLTFAsset';\n\nexport const AssetDecoder = {\n getArrayBuffer(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve(reader.result as ArrayBuffer);\n };\n reader.readAsArrayBuffer(blob);\n });\n },\n\n getZippedImage(imagePromise: JSZip.JSZipObject): Promise {\n return imagePromise\n .async('blob')\n .then((blob: Blob) => {\n return AssetDecoder.getImage(blob);\n });\n },\n\n getImage(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n img.crossOrigin = '*';\n\n img.onload = () => {\n URL.revokeObjectURL(url);\n resolve(img);\n };\n\n img.onerror = (e) => {\n reject(e);\n };\n\n img.src = url;\n });\n },\n\n getImageBase64(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve('' + reader.result);\n };\n reader.readAsDataURL(blob);\n });\n },\n\n getZippedGLTF(upc: string, gltfPromise: JSZip.JSZipObject): Promise {\n return gltfPromise\n .async('blob')\n .then((blob: Blob) => {\n return AssetDecoder.getGLTFAsset(upc, blob);\n });\n },\n\n getGLTFAsset(upc: string, blob: Blob): Promise {\n return this.getArrayBuffer(blob)\n .then((arrayBuffer) => {\n return Promise.resolve({\n upc,\n arrayBuffer,\n });\n });\n },\n};\n","enum AppViewSessionKeys {\n GLASSES_OK = 'vm-glasses-ok',\n GLASSES_KO = 'vm-glasses-ko',\n GLASSES_DOWNLOAD_SUCCESS_UPC = '_download_success_upc',\n GLASSES_DOWNLOAD_FAILURE_UPC = '_download_failure_upc',\n GLASSES_DOWNLOAD_SUCCESS_TIME = '_download_success_time_ms',\n GLASSES_DOWNLOAD_FAILURE_TIME = '_download_failure_time_ms',\n GLASSES_DOWNLOAD_FALLBACK_SUCCESS_UPC = '_download_fallback_success_upc',\n GLASSES_DOWNLOAD_FALLBACK_FAILURE_UPC = '_download_fallback_failure_upc',\n GLASSES_DOWNLOAD_FALLBACK_SUCCESS_TIME = '_download_fallback_success_time_ms',\n GLASSES_DOWNLOAD_FALLBACK_FAILURE_TIME = '_download_fallback_failure_time_ms',\n}\n\nexport { AppViewSessionKeys };\n","const assetNames = {\n b3d: 'glasses.b3d',\n transparency: 'mult.jpg',\n shadow: 'shadow-crop.jpg',\n lensMap: 'lens-map.png',\n lensBounds: 'bounds.glb',\n glassesLandmarks: 'landmarks.glb',\n color: (index: string | number) => `color-${index}.jpg`,\n};\n\nexport {\n assetNames,\n};\n","/* \nThis has been written during the mocking phase, during the integration of\nLuxottica's GTLF format. Probably will be useful with third parites glasses.\n*/\n\nexport const gltfDefaults = {\n nosepad_type: 'integrated',\n fitting: 'standard',\n flare: 0.025,\n};\n","const MockAssetData: {\n [key: string]: {\n nosepad_type: string,\n flare: number,\n fitting: string,\n lodNumber: number,\n misc: boolean,\n }\n} = {\n 'RB2140ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.023,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'RB2140ROSETTA002': {\n 'nosepad_type': 'integrated',\n 'flare': 0.023,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'RB3025ROSETTA001': {\n 'nosepad_type': 'floating',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': true\n },\n 'OO9406ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.024,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'THIRDPARTYROSETTA-NOGROUP': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'THIRDPARTYROSETTA-WGROUP': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'dbyd_dbsu5003_8719154814969': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'unofficial_unsf0146_8719154842764': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'unofficial_unsu0094_8719154843136': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'dbyd_dbsm0029_8719154744198': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'fb-quality': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'fb-standard': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'costa00000001': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'goccia00000001': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'frogskins00000001': {\n 'nosepad_type': 'undefined',\n 'flare': 0.025,\n 'fitting': 'fast',\n 'lodNumber': 1,\n 'misc': false\n },\n 'A03116ROSETTA003': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'DG4315BROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'HC6149ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'OO9013ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n '06A2003VROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'OO9102ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'PO3210SROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'RB3016ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n '06S4010ROSETTA001': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n 'OO9406ROSETTA002': {\n 'nosepad_type': 'integrated',\n 'flare': 0.025,\n 'fitting': 'standard',\n 'lodNumber': 2,\n 'misc': false\n },\n};\n\nexport {\n MockAssetData,\n};\n","abstract class GenericError extends Error {\n\n private readonly type: string;\n\n public readonly genericError: boolean = true;\n\n constructor(type: string, message: string) {\n super(`${type}: ${message}`);\n this.type = type;\n this.message = message;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n public getType() {\n return this.type;\n }\n\n}\n\nexport { GenericError };\n","import { GenericError } from './GenericError';\n\nclass GlassesDownloadError extends GenericError {\n constructor(readonly upc: string) {\n super('GlassesDownloadError', `glasses for upc ${upc} download failed`);\n }\n}\n\nexport { GlassesDownloadError };\n","import { GenericError } from './GenericError';\n\nclass GlassesDownloadForbiddenError extends GenericError {\n constructor(readonly upc: string) {\n super('GlassesDownloadForbiddenError', `glasses archive for upc ${upc} download forbidden`);\n }\n}\n\nexport { GlassesDownloadForbiddenError };\n","import { GenericError } from './GenericError';\n\nclass GlassesNotFoundError extends GenericError {\n constructor(readonly upc: string) {\n super('GlassesNotFoundError', `glasses archive for upc ${upc} not found`);\n }\n}\n\nexport { GlassesNotFoundError };\n","const isDistributorAsset = (upc: string): boolean => {\n return upc.startsWith('TKN~');\n};\n\nconst isQADistributorAsset = (upc: string): boolean => {\n // sample QA distributor UPC: 0OO9290CP-FRAME_SR005\n const dash = upc.split('-').length > 1;\n const underscore = upc.split('_').length > 1;\n\n return dash && underscore;\n};\n\nconst distributorBasename = (upc: string): string => {\n // sample distributor UPC: 0OO9290CP-FRAME_SR005\n return upc.split('-')[0];\n};\n\n // distributor can use tokens with a / (slash) in the name\n // the / is escaped by VM clients, all the distributor APIs works with the escaped character %2F\n // eg: TKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F13AA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n // inside the asset zip this slash is replaced with a dash -\nconst distributorFolderName = (upc: string): string => {\n return upc.replace(/(%2F)/gm, '-');\n};\n\nexport { isDistributorAsset, isQADistributorAsset, distributorBasename,\n distributorFolderName\n};\n","import { RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport JSZip from 'jszip';\nimport { name, version } from '../package.json';\nimport { AssetDecoder } from './AssetDecoder';\nimport { AssetResolution } from './interfaces/AssetResolution';\nimport { assetNames } from './constants/AssetNames';\nimport { B3dAsset } from './interfaces/B3dAsset';\nimport { distributorFolderName } from './helpers/AssetHelper';\nimport { BasicGLTFAsset } from './interfaces/BasicGLTFAsset';\nimport { GlassesDownloadError } from './error/GlassesDownloadError';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'GlassesExtractor');\n\nconst ALL_TEXTURES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\n\nclass GlassesExtractor {\n\n public unzip(\n upc: string,\n glassesZip: Blob,\n resolution: AssetResolution,\n singleTexture: number | undefined,\n ): Promise {\n const colorIndexes = (typeof singleTexture === 'number') ? [singleTexture] : ALL_TEXTURES;\n\n return this.unzipGlasses(\n upc,\n glassesZip,\n colorIndexes,\n resolution);\n }\n\n private unzipGlasses(\n upc: string,\n glassesZip: Blob,\n colorIndexes: number[],\n resolution: AssetResolution\n ): Promise {\n const time1 = performance.now();\n let time2 = 0;\n const jszip = new JSZip();\n return jszip.loadAsync(\n glassesZip\n ).then(() => {\n logger.debug('glasses zip [upc={}] loaded in {} ms', upc, performance.now() - time1);\n time2 = performance.now();\n return this.extractFilesFromZipArchive(jszip, upc, colorIndexes);\n }).then((glassesExtracted: Array) => {\n logger.debug('glasses zip [upc={}] opened in {} ms', upc, performance.now() - time2);\n const glasses = this.createGlassesDataFromExtractedArchive(upc, glassesExtracted, resolution, colorIndexes);\n return glasses;\n });\n }\n\n private extractFilesFromZipArchive(jszip: JSZip, zipUpc: string, colorIndexes: number[]): Promise> {\n const promises: Promise[] = [];\n const folderName: string = distributorFolderName(zipUpc);\n promises.push(this.extractB3D(jszip, folderName));\n promises.push(\n this.extractMult(jszip, folderName),\n this.extractShadow(jszip, folderName),\n this.extractLensMap(jszip, folderName),\n this.extractBoundingBoxes(jszip, folderName),\n this.extractLandmarks(jszip, folderName),\n );\n\n this.extractColors(jszip, folderName, colorIndexes).forEach((promise) => {\n promises.push(promise);\n });\n return Promise.all(promises);\n }\n\n private extractColors(jszip: JSZip, folderName: string, colorIndexes: number[]) {\n const promises: Array> = [];\n colorIndexes.map((i) => {\n const time1 = performance.now();\n const zipFolder = jszip.folder(folderName);\n if (!zipFolder) {\n throw new GlassesDownloadError(`${folderName} folder does not exists`);\n }\n const file = zipFolder.file(assetNames.color(i));\n if (!file) {\n throw new GlassesDownloadError(`${assetNames.color(i)} file does not exists`);\n }\n const colorPromise = AssetDecoder.getZippedImage(file);\n colorPromise.then((color) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('texture {} extracted in {} ms from upc {}: (length={})', i, ttime, folderName, color.src.length);\n });\n promises.push(colorPromise);\n });\n return promises;\n }\n\n private extractMult(jszip: JSZip, folderName: string) {\n const zipFolder = jszip.folder(folderName);\n if (!zipFolder) {\n throw new GlassesDownloadError(`${folderName} folder does not exists`);\n }\n const file = zipFolder.file(assetNames.transparency);\n if (!file) {\n throw new GlassesDownloadError(`${assetNames.transparency} file does not exists`);\n }\n const multPromise = AssetDecoder.getZippedImage(file);\n const time1 = performance.now();\n multPromise.then((mult) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('mult extracted in {} ms from upc {}: (length={})', ttime, folderName, mult.src.length);\n });\n return multPromise;\n }\n\n private extractShadow(jszip: JSZip, folderName: string) {\n const zipFolder = jszip.folder(folderName);\n if (!zipFolder) {\n throw new GlassesDownloadError(`${folderName} folder does not exists`);\n }\n const file = zipFolder.file(assetNames.shadow);\n if (!file) {\n throw new GlassesDownloadError(`${assetNames.shadow} file does not exists`);\n }\n const shadowPromise = AssetDecoder.getZippedImage(file);\n const time1 = performance.now();\n shadowPromise.then((shadow) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('shadow extracted in {} ms from upc {}: (length={})', ttime, folderName, shadow.src.length);\n });\n return shadowPromise;\n }\n\n // lensmaps, boundig boxes, and landmarks are optional and are not always present in zip file\n private extractLensMap(jszip: JSZip, folderName: string) {\n const zipFolder = jszip.folder(folderName);\n if (!zipFolder) {\n throw new GlassesDownloadError(`${folderName} folder does not exists`);\n }\n const lensmapFile = zipFolder.file(assetNames.lensMap);\n if (!!lensmapFile) {\n const lensmapPromise = AssetDecoder.getZippedImage(lensmapFile);\n const time1 = performance.now();\n lensmapPromise.then((lensmap: any) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('lens map extracted in {} ms from upc {}: (length={})', ttime, folderName, lensmap.byteLength);\n });\n return lensmapPromise;\n }\n return Promise.resolve(undefined);\n }\n\n // lensmaps, boundig boxes, and landmarks are optional and are not always present in zip file\n private extractBoundingBoxes(jszip: JSZip, folderName: string) {\n const zipFolder = jszip.folder(folderName);\n if (!zipFolder) {\n throw new GlassesDownloadError(`${folderName} folder does not exists`);\n }\n const lensBoundsFile = zipFolder.file(assetNames.lensBounds);\n if (!!lensBoundsFile) {\n const lensBoundsPromise = AssetDecoder.getZippedGLTF(folderName, lensBoundsFile);\n const time1 = performance.now();\n lensBoundsPromise.then((bounds: any) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('lens bounds extracted in {} ms from upc {}: (length={})', ttime, folderName, bounds.byteLength);\n });\n return lensBoundsPromise;\n }\n return Promise.resolve(undefined);\n }\n\n // lensmaps, boundig boxes, and landmarks are optional and are not always present in zip file\n private extractLandmarks(jszip: JSZip, folderName: string) {\n const landmarksFile = jszip.folder(folderName)!.file(assetNames.glassesLandmarks);\n if (!!landmarksFile) {\n const landmarksPromise = AssetDecoder.getZippedGLTF(folderName, landmarksFile);\n const time1 = performance.now();\n landmarksPromise.then((landmarks: any) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('landmarks extracted in {} ms from upc {}: (length={})', ttime, folderName, landmarks.byteLength);\n });\n return landmarksPromise;\n }\n return Promise.resolve(undefined);\n }\n\n private extractB3D(jszip: JSZip, folderName: string) {\n const b3dPromise = jszip.folder(folderName)!.file(assetNames.b3d)!.async('arraybuffer');\n const time1 = performance.now();\n b3dPromise.then((b3d: any) => {\n const time2 = performance.now();\n const ttime = time2 - time1;\n logger.debug('model extracted in {} ms from upc {}: (length={})', ttime, folderName, b3d.byteLength);\n });\n return b3dPromise;\n }\n\n private createGlassesDataFromExtractedArchive(\n upc: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n glassesExtracted: any[],\n resolution: AssetResolution,\n textureIndexes: number[]\n ): B3dAsset {\n logger.debug('creating glasses from {} items...', glassesExtracted.length);\n const glasses: B3dAsset = {\n objModel: glassesExtracted[0],\n transparency: glassesExtracted[1],\n shadow: glassesExtracted[2],\n lensMap: glassesExtracted[3],\n lensBoundingBox: glassesExtracted[4],\n glassesLandmarks: glassesExtracted[5],\n textures: glassesExtracted.slice(6, 6 + textureIndexes.length),\n upc,\n resolution,\n };\n return glasses;\n }\n\n}\n\nexport { GlassesExtractor };\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../package.json';\nimport { EnvironmentConfig } from './config/GlassesApiConfig';\nimport { GlassesExtractor } from './GlassesExtractor';\nimport { GlassesDownloadError } from './error/GlassesDownloadError';\nimport { GlassesDownloadForbiddenError } from './error/GlassesDownloadForbiddenError';\nimport { GlassesNotFoundError } from './error/GlassesNotFoundError';\nimport { AssetResolution } from './interfaces/AssetResolution';\nimport { B3dAsset } from './interfaces/B3dAsset';\nimport { AppViewSessionKeys } from './remotelog/AppViewSessionKeys';\nimport { distributorBasename, isDistributorAsset, isQADistributorAsset } from './helpers/AssetHelper';\nimport { GenericError } from './error/GenericError';\n/* import { GlassesAsset } from \"./GlassesAsset\"; */\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'ZipDownloader');\n\n/*\n\nSome sample tokens for custom glasses coming from the distributor\n\navailable\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500681_GRIDFK~NULL~50\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500633_GRIDFK~NULL~50\n\nnot available (uses fallback)\nTKN~0RB3592CP~1RB3592061_001...55~NULL~1TE3941A00_A1812.AA~1LSRB3592_2540..AB~NULL~RBCP..55\nTKN~0RB3592CP~1RB3592061_001...50~NULL~1TE3941A00_A1814.AA~1LSRB3592_1766..AA~NULL~RBCP..50\n\nwith slashes (%2F)\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F13AA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F8GAA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RX6465CP~1RX6465061_2945..51~NULL~1TE4183A00_X523%2FHAA~2064-DE~NULL~RBCP..51~K-MC5~K-RB0\n\n*/\n\n/*\n\nSome sample tokens for custom glasses coming from the distributor\n\navailable\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500681_GRIDFK~NULL~50\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500633_GRIDFK~NULL~50\n\nnot available (uses fallback)\nTKN~0RB3592CP~1RB3592061_001...55~NULL~1TE3941A00_A1812.AA~1LSRB3592_2540..AB~NULL~RBCP..55\nTKN~0RB3592CP~1RB3592061_001...50~NULL~1TE3941A00_A1814.AA~1LSRB3592_1766..AA~NULL~RBCP..50\n\nwith slashes (%2F)\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F13AA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F8GAA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RX6465CP~1RX6465061_2945..51~NULL~1TE4183A00_X523%2FHAA~2064-DE~NULL~RBCP..51~K-MC5~K-RB0\n\n*/\n\n/*\n\nSome sample tokens for custom glasses coming from the distributor\n\navailable\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500681_GRIDFK~NULL~50\nTKN~0RB2140CP~2RB2140P61_902...AA~2AP3031111_954...AA~NULL~1RB00500633_GRIDFK~NULL~50\n\nnot available (uses fallback)\nTKN~0RB3592CP~1RB3592061_001...55~NULL~1TE3941A00_A1812.AA~1LSRB3592_2540..AB~NULL~RBCP..55\nTKN~0RB3592CP~1RB3592061_001...50~NULL~1TE3941A00_A1814.AA~1LSRB3592_1766..AA~NULL~RBCP..50\n\nwith slashes (%2F)\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F13AA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RB4165CP~2RB4165061_601%2F71AB~2AJ1212111_710%2F8GAA~NULL~2LSRB4165_1770..AB~NULL~RBCP..55\n\nTKN~0RX6465CP~1RX6465061_2945..51~NULL~1TE4183A00_X523%2FHAA~2064-DE~NULL~RBCP..51~K-MC5~K-RB0\n\n*/\n\nclass ZipDownloader {\n private remoteLog: RemoteLog = new RemoteLog();\n private static instance: ZipDownloader;\n\n public static getInstance(): ZipDownloader {\n if (!this.instance) {\n this.instance = new ZipDownloader();\n }\n return this.instance;\n }\n\n public downloadZippedGlasses(\n upc: string,\n resolution: AssetResolution,\n singleTexture: number | undefined,\n envConfig: EnvironmentConfig\n ): Promise {\n return new Promise((resolve, reject) => {\n this.tryToDownload(upc, resolution, envConfig)\n .then((blob) => {\n resolve(new GlassesExtractor().unzip(upc, blob, resolution, singleTexture));\n }).catch((e) => {\n logger.error(e);\n reject(new GlassesDownloadError(upc));\n });\n });\n }\n\n private tryToDownload(upc: string, resolution: AssetResolution, envConfig: EnvironmentConfig) {\n const time1 = performance.now();\n\n let glassesUrl: string;\n let requestOptions: RequestInit;\n\n const customDistributorAsset = isDistributorAsset(upc);\n const qaDistributorAsset = isQADistributorAsset(upc);\n\n if (customDistributorAsset) {\n // custom assets requests requires a token, these asset are distributed through a system\n // that automatically generates combinations of custom assets if not available\n glassesUrl = this.getCustomUrl(upc, envConfig);\n requestOptions = {\n headers: {\n 'x-api-key': envConfig.customDistributorKey\n }\n };\n\n } else if (qaDistributorAsset) {\n // this URL is used locally by people that creates the pieces that\n // are combined by above distributor\n glassesUrl = this.getDistributorUrl(upc, envConfig);\n\n } else {\n // this is the classic b3d asset cdn\n glassesUrl = this.getUrl(upc, resolution, envConfig);\n }\n\n let triedLegacyCustom = true;\n const fetchGlasses = (): Promise => {\n return fetch(glassesUrl, requestOptions)\n .then((response: Response) => {\n if (response.ok) {\n logger.debug('glasses archive {} downloaded', response.url);\n const time2 = performance.now();\n const ttime = time2 - time1;\n this.traceDownloadSuccess(upc, ttime);\n return response.blob();\n } else {\n logger.error('glasses download {} failed: [{} {}]',\n response.url, response.status, response.statusText);\n const time2 = performance.now();\n const ttime = time2 - time1;\n this.traceDownloadFailure(upc, ttime);\n switch (response.status) {\n case 403:\n throw new GlassesDownloadForbiddenError(upc);\n case 404:\n throw new GlassesNotFoundError(upc);\n default:\n throw new GlassesDownloadError(upc);\n }\n }\n })\n .catch((reason: GenericError) => {\n logger.error('glasses download {} error {}', glassesUrl, reason);\n\n // if we are downloading a custom asset (TKN) is worth try to download it from legacy bucket\n if (customDistributorAsset && triedLegacyCustom) {\n triedLegacyCustom = false;\n\n logger.debug('try to download the custom asset from legacy bucket');\n glassesUrl = this.getLegacyUrl(upc, '256', envConfig);\n\n // remove the token from the request because it breaks S3 bucket\n requestOptions = {};\n\n return fetchGlasses();\n } else {\n // is possible that the catched error is already been initialised by above promise\n if (reason.genericError) {\n throw reason;\n }\n throw new GlassesDownloadError(glassesUrl);\n }\n });\n };\n\n return new Promise((resolve, reject) => {\n fetchGlasses()\n .then((blob) => {\n if (!!blob) {\n resolve(blob);\n }\n reject(new GlassesDownloadError(`${upc} returned empty blob`));\n })\n .catch((reason: GenericError) => {\n logger.error('glasses download {} error {}', glassesUrl, reason);\n reject(reason);\n });\n });\n }\n\n private getUrl(upc: string, resolution: AssetResolution, envConfig: EnvironmentConfig): string {\n return `${envConfig.b3dHost}/${resolution}/${upc}.zip`;\n }\n\n private getLegacyUrl(upc: string, resolution: AssetResolution, envConfig: EnvironmentConfig): string {\n return `${envConfig.b3dHost}/${resolution}/${upc}.zip`;\n }\n\n private getCustomUrl(tkn: string, envConfig: EnvironmentConfig): string {\n return `${envConfig.customDistributorHost}${envConfig.customDistributorGetPermutation}${tkn}`;\n }\n\n private getDistributorUrl(upc: string, envConfig: EnvironmentConfig): string {\n const baseName = distributorBasename(upc);\n return `${envConfig.b3dHost}/${baseName}/${upc}.zip`;\n }\n\n private traceDownloadSuccess(upc: string, ttime: number) {\n this.remoteLog.sendAppViewSession(\n {\n statusCode: AppViewSessionKeys.GLASSES_OK + AppViewSessionKeys.GLASSES_DOWNLOAD_SUCCESS_UPC,\n statusText: upc,\n }, {\n statusCode: AppViewSessionKeys.GLASSES_OK + AppViewSessionKeys.GLASSES_DOWNLOAD_SUCCESS_TIME,\n statusText: ttime.toString(),\n },\n );\n }\n\n private traceDownloadFailure(upc: string, ttime: number) {\n this.remoteLog.sendAppViewSession(\n {\n statusCode: AppViewSessionKeys.GLASSES_KO + AppViewSessionKeys.GLASSES_DOWNLOAD_FAILURE_UPC,\n statusText: upc,\n }, {\n statusCode: AppViewSessionKeys.GLASSES_KO + AppViewSessionKeys.GLASSES_DOWNLOAD_FAILURE_TIME,\n statusText: ttime.toString(),\n },\n );\n }\n\n}\n\nexport {\n ZipDownloader,\n};\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../package.json';\nimport { AssetDecoder } from './AssetDecoder';\nimport { EnvironmentConfig, getEnvironmentConfig } from './config/GlassesApiConfig';\nimport { assetNames } from './constants/AssetNames';\nimport { GlassesEnvironment } from './constants/Environment';\nimport { gltfDefaults } from './constants/GltfDefault';\nimport { MockAssetData } from './constants/MockAssetData';\nimport { GlassesDownloadError } from './error/GlassesDownloadError';\nimport { GlassesDownloadForbiddenError } from './error/GlassesDownloadForbiddenError';\nimport { GlassesNotFoundError } from './error/GlassesNotFoundError';\nimport { isDistributorAsset } from './helpers/AssetHelper';\nimport { AssetResolution } from './interfaces/AssetResolution';\nimport { B3dAsset } from './interfaces/B3dAsset';\nimport { GltfAssetPointer, GltfLodUrls, GltfResponse, MiscUrl } from './interfaces/GltfAsset';\nimport { AppViewSessionKeys } from './remotelog/AppViewSessionKeys';\nimport { ZipDownloader } from './ZipDownloader';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'GlassesDownloader');\n\n// temporary mock function for GLTF misc/DC assets\nconst miscUrls = (envConfig: EnvironmentConfig, upc: string): MiscUrl => {\n return {\n boundsUrl: `${envConfig.gltfHost}/${upc}/webGL/${upc}_misc/bounds.glb`,\n landmarksUrl: `${envConfig.gltfHost}/${upc}/webGL/${upc}_misc/landmarks.glb`,\n };\n};\n\nclass GlassesDownloader {\n\n private remoteLog: RemoteLog = new RemoteLog();\n\n public downloadGltfGlasses(options: {\n upc: string,\n glassesEnvironment: GlassesEnvironment,\n landmarksAndBBox?: boolean\n }): Promise {\n \n if (options.glassesEnvironment === GlassesEnvironment.MOCK) {\n return Promise.resolve(this.getMockGltfGlassesUrl(options));\n } else {\n const envConfig = getEnvironmentConfig(options.glassesEnvironment);\n const gltfUrl = `${envConfig.gltfHost}/${options.upc}${envConfig.gltfPointer}`;\n\n return fetch(gltfUrl).then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n return Promise.reject(new GlassesDownloadError(`${options.upc} - ${response.status}`));\n }\n }).then((json: GltfResponse) => {\n const assetData = json[options.upc];\n\n // at the moment this is the only way we can understand if the catalog gave us an empty response\n // TODO: ask backend team to improve the answer\n if (!assetData.LOD1 && !assetData.LOD2) {\n return Promise.reject(new GlassesDownloadError(`${options.upc} - missing fundamental LOD`));\n }\n\n const result: GltfAssetPointer = {\n upc: options.upc,\n gltfLodUrls: {},\n nosepadType: assetData.nosepadType,\n fitting: assetData.fitting,\n flare: assetData.flare,\n ...(!!assetData.misc && !!options.landmarksAndBBox && { misc: assetData.misc })\n };\n\n if (!!assetData.LOD0) { result.gltfLodUrls.lod0 = { ...assetData.LOD0 }; }\n if (!!assetData.LOD1) { result.gltfLodUrls.lod1 = { ...assetData.LOD1 }; }\n if (!!assetData.LOD2) { result.gltfLodUrls.lod2 = { ...assetData.LOD2 }; }\n\n return result;\n });\n }\n }\n\n private getMockGltfGlassesUrl(options: {\n upc: string,\n glassesEnvironment: GlassesEnvironment,\n landmarksAndBBox?: boolean\n }): GltfAssetPointer {\n const envConfig = getEnvironmentConfig(options.glassesEnvironment);\n\n const assetNumLods = MockAssetData[options.upc].lodNumber;\n const gltfLodUrls: GltfLodUrls = {};\n \n if (assetNumLods === 1) {\n // asset without lods (third-party)\n gltfLodUrls.lod1 = {\n gltfUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD0/${options.upc}.gltf`,\n upcSiUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD0/${options.upc}_si.json`\n };\n } else {\n gltfLodUrls.lod1 = {\n gltfUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD1/${options.upc}.gltf`,\n upcSiUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD1/${options.upc}_si.json`\n };\n\n if (assetNumLods >= 2) {\n gltfLodUrls.lod2 = {\n gltfUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD2/${options.upc}.gltf`,\n upcSiUrl: `${envConfig.gltfHost}/${options.upc}/webGL/${options.upc}_LOD2/${options.upc}_si.json`\n };\n }\n }\n\n return {\n upc: options.upc,\n gltfLodUrls: gltfLodUrls,\n nosepadType: (!!MockAssetData[options.upc]?.nosepad_type) ? MockAssetData[options.upc].nosepad_type : gltfDefaults.nosepad_type,\n fitting: (!!MockAssetData[options.upc]?.fitting) ? MockAssetData[options.upc].fitting : gltfDefaults.fitting,\n flare: (!!MockAssetData[options.upc]?.flare) ? MockAssetData[options.upc].flare : gltfDefaults.flare,\n misc: !!MockAssetData[options.upc]?.misc &&\n options.landmarksAndBBox !== undefined &&\n options.landmarksAndBBox ?\n miscUrls(envConfig, options.upc) : undefined,\n };\n }\n\n public downloadGlasses(options: {\n upc: string,\n resolution: AssetResolution,\n glassesEnvironment: GlassesEnvironment,\n lensMap?: boolean,\n lensBoundingBoxes?: boolean,\n glassesLandmarks?: boolean,\n singleTexture?: number,\n }): Promise {\n const envConfig = getEnvironmentConfig(options.glassesEnvironment);\n\n if (this.shouldDownloadZip(options.upc, envConfig)) {\n return this.downloadZippedGlasses(\n options.upc,\n options.resolution,\n options.singleTexture,\n (options.lensMap) ? true : false,\n (options.lensBoundingBoxes) ? true : false,\n (options.glassesLandmarks) ? true : false,\n envConfig\n );\n } else {\n return this.downloadSeparatedGlasses(\n options.upc,\n options.resolution,\n options.singleTexture,\n (options.lensMap) ? true : false,\n (options.lensBoundingBoxes) ? true : false,\n (options.glassesLandmarks) ? true : false,\n envConfig\n );\n }\n }\n\n private shouldDownloadZip(upc: string, envConfig: EnvironmentConfig) {\n return isDistributorAsset(upc) || envConfig.assetType === 'ZIPPED';\n }\n\n private downloadZippedGlasses(\n upc: string,\n resolution: AssetResolution = '512',\n singleTexture: number | undefined,\n lensMap: boolean,\n lensBoundingBoxes: boolean,\n glassesLandmarks: boolean,\n envConfig: EnvironmentConfig\n ): Promise {\n\n // prepare lensmap url\n const lensMapUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.lensMap}`;\n const lensBoundsUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.lensBounds}`;\n const glassesLandmarksUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.glassesLandmarks}`;\n const qaToolEnv = ['QA_B3D_PROD', 'QA_GLTF_PROD', 'QA_B3D_TEST', 'QA_GLTF_TEST', 'QA_PROD', 'QA_TEST'];\n\n const qaTool = qaToolEnv.includes(envConfig.name);\n\n // download the zip and lensmap if present\n return Promise.all([\n ZipDownloader.getInstance().downloadZippedGlasses(upc, resolution, singleTexture, envConfig),\n (lensMap && !qaTool) ? this.downloadB3dAsset(lensMapUrl) : Promise.resolve(new Blob()),\n (lensBoundingBoxes && !qaTool) ? this.downloadB3dAsset(lensBoundsUrl) : Promise.resolve(new Blob()),\n (glassesLandmarks && !qaTool) ? this.downloadB3dAsset(glassesLandmarksUrl) : Promise.resolve(new Blob()),\n ]).then((responses) => {\n // load the glasses image\n return Promise.all([\n Promise.resolve(responses[0]),\n (responses[1].size > 0) ? AssetDecoder.getImage(responses[1]) : undefined,\n (responses[2].size > 0) ? AssetDecoder.getGLTFAsset(upc, responses[2]) : undefined,\n (responses[3].size > 0) ? AssetDecoder.getGLTFAsset(upc, responses[3]) : undefined,\n ]);\n }).then((glassesAndLensMap) => {\n // TODO is necessary to track download success?\n\n // compose the asset with lensmaps\n const glassesAsset = glassesAndLensMap[0];\n //if landmarks and bboxes option are false we set relative field undefined\n glassesAsset.lensBoundingBox = lensBoundingBoxes ? glassesAsset.lensBoundingBox : undefined;\n glassesAsset.glassesLandmarks = glassesLandmarks ? glassesAsset.glassesLandmarks : undefined;\n // NOTE: QA tool still uses zipped glasses, if we are outside QA tool new assets must be unzipped\n if (!qaTool) {\n glassesAsset.lensMap = glassesAndLensMap[1];\n glassesAsset.lensBoundingBox = glassesAndLensMap[2];\n glassesAsset.glassesLandmarks = glassesAndLensMap[3];\n }\n return Promise.resolve(glassesAsset);\n });\n }\n\n private downloadSeparatedGlasses(\n upc: string,\n resolution: AssetResolution,\n singleTexture: number | undefined,\n lensMap: boolean,\n lensBoundingBoxes: boolean,\n glassesLandmarks: boolean,\n envConfig: EnvironmentConfig\n ): Promise {\n\n // const normalizedUpc = normalizeSize(normalizeRemix(upc));\n\n const b3dUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.b3d}`;\n const transparencyUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.transparency}`;\n const shadowUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.shadow}`;\n const lensMapUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.lensMap}`;\n const lensBoundsUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.lensBounds}`;\n const glassesLandmarksUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.glassesLandmarks}`;\n\n const textureIndexes = (singleTexture !== undefined) ?\n [singleTexture] : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\n const textureUrls = textureIndexes.map((x) => {\n return `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.color(x)}`;\n });\n\n const time1 = performance.now();\n\n return Promise.all([\n this.downloadB3dAsset(b3dUrl),\n this.downloadB3dAsset(transparencyUrl),\n this.downloadB3dAsset(shadowUrl),\n (lensMap) ? this.downloadB3dAsset(lensMapUrl) : Promise.resolve(new Blob()),\n (lensBoundingBoxes) ? this.downloadB3dAsset(lensBoundsUrl) : Promise.resolve(new Blob()),\n (glassesLandmarks) ? this.downloadB3dAsset(glassesLandmarksUrl) : Promise.resolve(new Blob()),\n ...textureUrls.map((url) => this.downloadB3dAsset(url))\n ]).then((responses) => {\n return Promise.all([\n AssetDecoder.getArrayBuffer(responses[0]),\n AssetDecoder.getImage(responses[1]),\n AssetDecoder.getImage(responses[2]),\n (responses[3].size > 0) ? AssetDecoder.getImage(responses[3]) : undefined,\n (responses[4].size > 0) ? AssetDecoder.getGLTFAsset(upc, responses[4]) : undefined,\n (responses[5].size > 0) ? AssetDecoder.getGLTFAsset(upc, responses[5]) : undefined,\n Promise.all(responses.slice(6, responses.length).map((textureResponse) => {\n return AssetDecoder.getImage(textureResponse);\n }))\n ]);\n }).then((assetsResponses) => {\n this.traceDownloadSuccess(upc, performance.now() - time1);\n return {\n upc: upc,\n objModel: assetsResponses[0],\n transparency: assetsResponses[1],\n shadow: assetsResponses[2],\n lensMap: assetsResponses[3],\n lensBoundingBox: assetsResponses[4],\n glassesLandmarks: assetsResponses[5],\n textures: assetsResponses[6],\n resolution: resolution\n };\n }).catch((e) => {\n this.traceDownloadFailure(upc, performance.now() - time1);\n logger.error(e);\n return Promise.reject(e);\n });\n }\n\n // TODO, is this used anymore?\n private glassesArchiveUrls(\n upc: string,\n resolution: AssetResolution,\n singleTexture: number | undefined,\n lensMap: boolean,\n envConfig: EnvironmentConfig\n ): string[] {\n // const normalizedUpc = normalizeSize(normalizeRemix(upc));\n\n const b3dUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.b3d}`;\n const transparencyUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.transparency}`;\n const shadowUrl = `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.shadow}`;\n const lensMapUrl = (lensMap) ? `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.lensMap}` : '';\n\n const textureIndexes = (singleTexture !== undefined) ?\n [singleTexture] : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\n const textureUrls = textureIndexes.map((x) => {\n return `${envConfig.b3dHost}/${resolution}/${upc}/${assetNames.color(x)}`;\n });\n\n return [\n b3dUrl,\n transparencyUrl,\n shadowUrl,\n lensMapUrl,\n ...textureUrls\n ];\n }\n\n private downloadB3dAsset(glassesAssetUrl: string): Promise {\n return fetch(glassesAssetUrl)\n .then((response: Response) => {\n if (response.ok) {\n return response.blob();\n } else {\n logger.error('b3d asset {} failed: [{} {}]',\n response.url, response.status, response.statusText);\n switch (response.status) {\n case 403:\n return Promise.reject(new GlassesDownloadForbiddenError(glassesAssetUrl));\n case 404:\n return Promise.reject(new GlassesNotFoundError(glassesAssetUrl));\n default:\n return Promise.reject(new GlassesDownloadError(glassesAssetUrl));\n }\n }\n }).catch((e) => {\n logger.error(e);\n return Promise.reject(new GlassesDownloadError(glassesAssetUrl));\n });\n }\n\n // private downloadGltfAsset(glassesAssetUrl: string): Promise {\n // return fetch(glassesAssetUrl)\n // .then((response: Response) => {\n // if (response.ok) {\n // return response.arrayBuffer();\n // } else {\n // logger.error('gltf asset {} failed: [{} {}]',\n // response.url, response.status, response.statusText);\n // switch (response.status) {\n // case 403:\n // return Promise.reject(new GlassesDownloadForbiddenError(glassesAssetUrl));\n // case 404:\n // return Promise.reject(new GlassesNotFoundError(glassesAssetUrl));\n // default:\n // return Promise.reject(new GlassesDownloadError(glassesAssetUrl));\n // }\n // }\n // }).catch((e) => {\n // logger.error(e);\n // return Promise.reject(new GlassesDownloadError(glassesAssetUrl));\n // });\n // }\n\n private traceDownloadSuccess(upc: string, ttime: number) {\n this.remoteLog.sendAppViewSession(\n {\n statusCode: AppViewSessionKeys.GLASSES_OK + AppViewSessionKeys.GLASSES_DOWNLOAD_SUCCESS_UPC,\n statusText: upc,\n }, {\n statusCode: AppViewSessionKeys.GLASSES_OK + AppViewSessionKeys.GLASSES_DOWNLOAD_SUCCESS_TIME,\n statusText: ttime.toString(),\n },\n );\n }\n\n private traceDownloadFailure(upc: string, ttime: number) {\n this.remoteLog.sendAppViewSession(\n {\n statusCode: AppViewSessionKeys.GLASSES_KO + AppViewSessionKeys.GLASSES_DOWNLOAD_FAILURE_UPC,\n statusText: upc,\n }, {\n statusCode: AppViewSessionKeys.GLASSES_KO + AppViewSessionKeys.GLASSES_DOWNLOAD_FAILURE_TIME,\n statusText: ttime.toString(),\n },\n );\n }\n}\n\nexport {\n GlassesDownloader\n};\n","const toDataURL = (url: string) => {\r\n return fetch(url)\r\n .then(response => response.blob())\r\n .then(blob => {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = reject;\r\n reader.readAsDataURL(blob);\r\n });\r\n });\r\n};\r\n\r\nexport { toDataURL };\r\n","import uuid from 'uuid';\r\nimport { IMockStreamTrack, MockTrackSettings } from './IMockStreamTrack';\r\n\r\nclass MockStreamTrack implements IMockStreamTrack {\r\n public readonly id: string;\r\n public readonly label: string;\r\n private settings: MockTrackSettings;\r\n\r\n constructor() {\r\n this.id = uuid();\r\n this.label = 'mock-stream-track';\r\n this.settings = {};\r\n }\r\n\r\n public getSettings() {\r\n return this.settings;\r\n }\r\n \r\n public stop() {\r\n return;\r\n }\r\n}\r\n\r\nexport { MockStreamTrack };\r\n","import uuid from 'uuid';\r\nimport { IMockStream } from './IMockStream';\r\nimport { MockStreamTrack } from './MockStreamTrack';\r\n\r\nclass MockStream implements IMockStream {\r\n public readonly id: string;\r\n private tracks: MockStreamTrack[] = [];\r\n\r\n constructor(resolution?: any | undefined) {\r\n this.id = uuid();\r\n this.tracks.push(new MockStreamTrack());\r\n }\r\n public getTracks(): any[] {\r\n return this.tracks;\r\n }\r\n public getVideoTracks(): any[] {\r\n return this.tracks;\r\n }\r\n}\r\n\r\nexport { MockStream };\r\n","import { toDataURL } from './ImageLoader';\r\nimport { IMockBridgeMedia } from './IMockBridgeMedia';\r\nimport { MockStream } from './MockStream';\r\n\r\nclass MockBridgeMedia implements IMockBridgeMedia {\r\n\r\n public getUserMedia(constraints: MediaStreamConstraints): Promise {\r\n // const requiredResolution: any = this.getRequiredResolution(constraints);\r\n\r\n return new Promise ((resolve, reject) => {\r\n const videoSrc = localStorage.getItem('vm.mock.videoSrc');\r\n if (videoSrc === null) {\r\n reject(new Error('video src undefined'));\r\n } else {\r\n return toDataURL(\r\n videoSrc\r\n ).then((dataUrl) => {\r\n console.log('RESULT OK');\r\n resolve(new MockStream());\r\n }).catch((e) => {\r\n console.error(e);\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport { MockBridgeMedia };\r\n","// tslint:disable-next-line:interface-name\ndeclare interface NativeBridgeParameters {\n resolution: {\n width: number;\n height: number;\n };\n}\n\nabstract class AbstractNativeBridge {\n public static isNativeBridgePresent: () => boolean;\n public abstract onStartNativeCam: ((resolution: any, error: any) => void) | undefined;\n public abstract onCamFrame: ((base64: string) => void) | undefined;\n public abstract close: () => void;\n public abstract pause: () => void;\n public abstract resume: () => void;\n public abstract start: (requiredResolution: NativeBridgeParameters) => void;\n}\n\nexport { AbstractNativeBridge, NativeBridgeParameters };\n","import { AbstractNativeBridge, NativeBridgeParameters } from './AbstractNativeBridge';\n\ndeclare global {\n // tslint:disable-next-line:interface-name\n interface Window {\n webkit: any;\n NativeBridge: NativeBridge;\n }\n}\n\nclass NativeBridge extends AbstractNativeBridge {\n\n public static isNativeBridgePresent(): boolean {\n return (\n typeof window.webkit === 'object' &&\n typeof(window.webkit.messageHandlers) === 'object' &&\n typeof(window.webkit.messageHandlers.startNativeCam) === 'object'\n );\n }\n\n public onStartNativeCam: ((resolution: any, error: any) => void) | undefined;\n public onCamFrame: ((base64: string) => void) | undefined;\n\n public close = (): void => {\n window.webkit.messageHandlers.closeNativeCam.postMessage(undefined);\n }\n\n public start = (requiredResolution: NativeBridgeParameters): void => {\n window.webkit.messageHandlers.startNativeCam.postMessage(requiredResolution);\n }\n\n public pause = (): void => {\n // in old versions of native bridge there's no pause/resume support\n if (window.webkit.messageHandlers.pauseNativeCam) {\n window.webkit.messageHandlers.pauseNativeCam.postMessage(undefined);\n }\n }\n\n public resume = (): void => {\n // in old versions of native bridge there's no pause/resume support\n if (window.webkit.messageHandlers.resumeNativeCam) {\n window.webkit.messageHandlers.resumeNativeCam.postMessage(undefined);\n }\n }\n}\n\nexport { NativeBridge };\n","import uuid from 'uuid';\nimport { INativeStreamTrack, NativeTrackSettings } from './INativeStreamTrack';\n\nclass NativeStreamTrack implements INativeStreamTrack {\n public readonly id: string;\n public readonly label: string;\n private settings: NativeTrackSettings;\n\n constructor(resolution: {width: number, height: number}) {\n this.id = uuid();\n this.label = 'native-stream-track';\n this.settings = {\n height: resolution.height,\n width: resolution.width,\n };\n }\n public getSettings() {\n return this.settings;\n }\n public stop() {\n window.NativeBridge.close();\n }\n}\n\nexport { NativeStreamTrack };\n","import uuid from 'uuid';\r\nimport { INativeStream } from './INativeStream';\r\nimport { NativeStreamTrack } from './NativeStreamTrack';\r\n\r\nclass NativeStream implements INativeStream {\r\n public readonly id: string;\r\n private tracks: NativeStreamTrack[] = [];\r\n\r\n constructor(resolution?: any | undefined) {\r\n this.id = uuid();\r\n this.tracks.push(new NativeStreamTrack(resolution));\r\n }\r\n\r\n public getTracks(): any[] {\r\n return this.tracks;\r\n }\r\n\r\n public getVideoTracks(): any[] {\r\n return this.tracks;\r\n }\r\n}\r\n\r\nexport { NativeStream };\r\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\nimport { name, version } from '../../../package.json';\nimport { NativeBridgeParameters } from './AbstractNativeBridge.js';\nimport { INativeBridgeMedia } from './INativeBridgeMedia';\nimport { NativeBridge } from './NativeBridge';\nimport { NativeStream } from './NativeStream';\n\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'NativeBridgeMedia');\n\nclass NativeBridgeMedia implements INativeBridgeMedia {\n private remoteLog = new RemoteLog();\n\n public getUserMedia(constraints: MediaStreamConstraints): Promise {\n logger.info('opening Native Camera with {}', JSON.stringify(constraints));\n\n const requiredResolution: any = this.getRequiredResolution(constraints);\n\n return new Promise ((resolve, reject) => {\n window.NativeBridge = new NativeBridge();\n window.NativeBridge.start(requiredResolution);\n window.NativeBridge.onStartNativeCam = (resolution: any, error: any) => {\n if (error) {\n const message = 'Error starting Native Camera -> ' + JSON.stringify(error);\n logger.error(message);\n this.remoteLog.sendAppViewSession({\n statusCode: 'webcam-stream-error',\n statusText: message,\n });\n reject(error);\n } else {\n logger.info('Started Native Camera');\n this.remoteLog.sendAppViewSession({\n statusCode: 'webcam-stream',\n statusText: 'Started Native Camera',\n });\n resolve(new NativeStream(resolution));\n }\n window.NativeBridge.onStartNativeCam = undefined;\n };\n });\n }\n\n private getRequiredResolution(constraints: MediaStreamConstraints): NativeBridgeParameters | null {\n // tslint:disable-next-line:no-unnecessary-initializer\n let requiredResolution: NativeBridgeParameters | null = null;\n\n if (constraints &&\n constraints.video &&\n typeof (constraints.video) !== 'boolean' &&\n constraints.video.width &&\n constraints.video.height) {\n const width = (typeof (constraints.video.width) === 'number') ?\n constraints.video!.width :\n constraints.video.width.ideal;\n\n const height = (typeof (constraints.video.height) === 'number') ?\n constraints.video!.height :\n constraints.video.height.ideal;\n\n requiredResolution = {\n resolution: {\n height: height!,\n width: width!,\n },\n };\n }\n return requiredResolution;\n }\n}\n\nexport { NativeBridgeMedia };\n","import { MockBridgeMedia } from '../mockWebcam/MockBridgeMedia';\r\nimport { NativeBridgeMedia } from '../nativeWebcam/NativeBridgeMedia';\r\nimport { IUserMedia } from './IUserMedia';\r\nimport { WebCamStream } from './WebCamStream';\r\n\r\nclass UserMedia implements IUserMedia {\r\n private userMedia: any;\r\n private readonly mockOptionName = 'vm.mock.video';\r\n\r\n constructor() {\r\n\r\n if (localStorage.getItem(this.mockOptionName) === 'true') { // mock enabled\r\n this.userMedia = new MockBridgeMedia();\r\n } else {\r\n this.userMedia = navigator.mediaDevices || new NativeBridgeMedia();\r\n }\r\n }\r\n\r\n public get(): MediaDevices | NativeBridgeMedia | MockBridgeMedia {\r\n return this.userMedia;\r\n }\r\n}\r\n\r\nexport { UserMedia };\r\n","import { toDataURL } from './ImageLoader';\r\nimport { MockStream } from './MockStream';\r\n\r\nclass MockVideoStream {\r\n\r\n private videoSrc: string;\r\n\r\n private imageElement: HTMLImageElement;\r\n private privateCurrentTime = 0;\r\n private mediaStream: MockStream;\r\n\r\n private playingListener: any[] = [];\r\n\r\n public get currentTime(): number {\r\n this.privateCurrentTime++;\r\n return this.privateCurrentTime;\r\n }\r\n\r\n public get videoWidth(): number {\r\n return this.imageElement?.width;\r\n }\r\n\r\n public get videoHeight(): number {\r\n return this.imageElement?.height;\r\n }\r\n\r\n public get defaultMuted(): boolean {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, defaultMuted will always return true');\r\n return true;\r\n }\r\n\r\n public set defaultMuted(value: boolean) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, is not possible to set mute a video stream');\r\n }\r\n\r\n public get width(): number {\r\n return this.imageElement.width;\r\n }\r\n\r\n public set width(value: number) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, not possible to set image width');\r\n }\r\n\r\n public get height(): number {\r\n return this.imageElement.height;\r\n }\r\n\r\n public set height(value: number) {\r\n // tslint:disable-next-line:no-console\r\n console.debug('This is a mock context, not possible to set image height');\r\n }\r\n\r\n constructor(\r\n options: {\r\n target: string,\r\n id?: string,\r\n className?: string,\r\n }\r\n ) {\r\n\r\n const videoSrc = localStorage.getItem('vm.mock.videoSrc');\r\n if (!!videoSrc) {\r\n this.videoSrc = videoSrc;\r\n } else {\r\n throw new Error('no video src defined');\r\n }\r\n\r\n this.imageElement = new Image();\r\n this.mediaStream = new MockStream();\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public addEventListener(\r\n type: string,\r\n listener: EventListenerOrEventListenerObject | any,\r\n options?: boolean | AddEventListenerOptions | undefined\r\n ) {\r\n if (type === 'playing') {\r\n this.playingListener.push(listener);\r\n } else {\r\n listener();\r\n }\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public removeEventListener(\r\n type: string, listener: EventListenerOrEventListenerObject,\r\n options?: boolean | EventListenerOptions | undefined\r\n ) {\r\n if (type === 'playing') {\r\n this.playingListener = [];\r\n }\r\n }\r\n\r\n public play(): Promise {\r\n return new Promise((resolve, reject) => {\r\n this.waitForFrame().then(() => {\r\n for (const listener of this.playingListener) {\r\n listener();\r\n }\r\n resolve();\r\n }).catch(() => {\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n public pause(): void {\r\n console.debug('This is a mock context, not possible to pause');\r\n\r\n }\r\n\r\n public close(): void {\r\n console.debug('This is a mock context, not possible to close');\r\n }\r\n\r\n public get image() {\r\n return this.imageElement;\r\n }\r\n\r\n private waitForFrame(): Promise {\r\n return toDataURL(this.videoSrc).then((imgData) => {\r\n try {\r\n this.imageElement.setAttribute('src', imgData as string);\r\n } catch (error) {\r\n throw error;\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport { MockVideoStream };\r\n","import { NativeStream } from './NativeStream';\n\nclass NativeVideoStream {\n private imageElement: any;\n private privateCurrentTime = 0;\n private mediaStream: NativeStream;\n\n private playingListener: any[] = [];\n\n public get currentTime(): number {\n return this.privateCurrentTime;\n }\n\n public get videoWidth(): number {\n return this.imageElement.width;\n }\n\n public get videoHeight(): number {\n return this.imageElement.height;\n }\n\n public get defaultMuted(): boolean {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, defaultMuted will always return true');\n return true;\n }\n\n public set defaultMuted(value: boolean) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, is not possible to set mute a video stream');\n }\n\n public get width(): number {\n return this.imageElement.width;\n }\n\n public set width(value: number) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, not possible to set image width');\n }\n\n public get height(): number {\n return this.imageElement.height;\n }\n\n public set height(value: number) {\n // tslint:disable-next-line:no-console\n console.debug('This is a native context, not possible to set image height');\n }\n\n constructor(options: {\n target: string,\n id?: string,\n className?: string,\n },\n mediaStream: NativeStream) {\n\n this.mediaStream = mediaStream;\n this.imageElement = new Image();\n\n this.imageElement.width = this.mediaStream.getVideoTracks()[0].getSettings().width;\n this.imageElement.height = this.mediaStream.getVideoTracks()[0].getSettings().height;\n\n window.NativeBridge.onCamFrame = (base64: string) => {\n this.imageElement.src = base64;\n };\n }\n\n // tslint:disable-next-line:max-line-length\n public addEventListener(type: string, listener: EventListenerOrEventListenerObject | any, options?: boolean | AddEventListenerOptions | undefined) {\n if (type === 'playing') {\n this.playingListener.push(listener);\n } else {\n listener();\n }\n }\n\n // tslint:disable-next-line:max-line-length\n public removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined) {\n if (type === 'playing') {\n this.playingListener = [];\n }\n // mock\n }\n\n public play(): Promise {\n return new Promise((resolve, reject) => {\n window.NativeBridge.resume();\n this.waitForFrame()\n .then(() => {\n this.startTimeCounter();\n for (const listener of this.playingListener) {\n listener();\n }\n resolve();\n })\n .catch(() => {\n reject();\n });\n });\n }\n\n public pause(): void {\n window.NativeBridge.pause();\n }\n\n public close(): void {\n window.NativeBridge.close();\n }\n\n public get image() {\n return this.imageElement;\n }\n\n private waitForFrame(): Promise {\n return new Promise((resolve, reject) => {\n this.imageElement.onload = () => {\n resolve();\n };\n this.imageElement.onerror = () => {\n reject();\n };\n });\n }\n\n private startTimeCounter() {\n this.imageElement.onload = () => { this.privateCurrentTime++; };\n }\n}\n\nexport { NativeVideoStream };\n","declare global {\n // tslint:disable-next-line:interface-name\n interface Element {\n setAttribute(name: string, value: null): void;\n }\n}\n\nclass WebCamVideoStream {\n private video: HTMLVideoElement;\n\n public get currentTime(): number {\n return this.video.currentTime;\n }\n\n public get videoWidth(): number {\n return this.video.videoWidth;\n }\n\n public get videoHeight(): number {\n return this.video.videoHeight;\n }\n\n public get defaultMuted(): boolean {\n return this.video.defaultMuted;\n }\n\n public set defaultMuted(value: boolean) {\n this.video.defaultMuted = value;\n }\n\n public get width(): number {\n return this.video.width;\n }\n\n public set width(value: number) {\n this.video.width = value;\n }\n\n public get height(): number {\n return this.video.height;\n }\n\n public set height(value: number) {\n this.video.height = value;\n }\n\n constructor(options: {\n target: string,\n id?: string,\n className?: string,\n },\n mediaStream: MediaStream) {\n\n const targetElement = document.getElementById(options.target);\n if (!targetElement) {\n throw new Error('Impossible to start video on undefined element -> ' + options.target);\n }\n this.video = document.createElement('video');\n this.video.id = options.id || '';\n this.video.className = options.className || '';\n this.video.muted = true;\n this.video.setAttribute('playsinline', null);\n this.video.srcObject = mediaStream;\n\n targetElement.appendChild(this.video);\n }\n\n // tslint:disable-next-line:max-line-length\n public addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined) {\n this.video.addEventListener(type, listener, options);\n }\n\n // tslint:disable-next-line:max-line-length\n public removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined) {\n this.video.removeEventListener(type, listener, options);\n }\n\n public play(): Promise {\n return this.video.play();\n }\n\n public pause(): void {\n this.video.pause();\n }\n\n public get image() {\n return this.video;\n }\n}\n\nexport { WebCamVideoStream };\n","import { MockVideoStream } from '../mockWebcam/MockVideoStream';\r\nimport { NativeStream } from '../nativeWebcam/NativeStream';\r\nimport { NativeVideoStream } from '../nativeWebcam/NativeVideoStream';\r\nimport { WebCamVideoStream } from './WebCamVideoStream';\r\n\r\nclass WebCamStream {\r\n private readonly mockOptionName = 'vm.mock.video';\r\n private privateStreamObject: WebCamVideoStream | NativeVideoStream | MockVideoStream;\r\n\r\n constructor( \r\n options: {\r\n target: string,\r\n id?: string,\r\n className?: string,\r\n },\r\n stream: MediaStream | NativeStream\r\n ) {\r\n if (this.isMockStream()) {\r\n this.privateStreamObject = new MockVideoStream(options);\r\n } else if (this.isMediaStream(stream)) {\r\n this.privateStreamObject = new WebCamVideoStream(options, stream as MediaStream);\r\n } else {\r\n this.privateStreamObject = new NativeVideoStream(options, stream as NativeStream);\r\n }\r\n }\r\n\r\n public get streamObject(): WebCamVideoStream | NativeVideoStream | MockVideoStream {\r\n return this.privateStreamObject;\r\n }\r\n\r\n public close() {\r\n if (this.privateStreamObject.constructor.name === WebCamVideoStream.name) {\r\n this.privateStreamObject.pause();\r\n } else {\r\n (this.privateStreamObject as NativeVideoStream).close();\r\n }\r\n }\r\n\r\n public isMockStream(): boolean {\r\n return localStorage.getItem(this.mockOptionName) === 'true';\r\n }\r\n\r\n public isNativeStream(): boolean {\r\n return this.privateStreamObject.constructor.name === NativeStream.name;\r\n }\r\n\r\n private isMediaStream(stream: MediaStream | NativeStream): boolean {\r\n return stream.constructor.name === MediaStream.name;\r\n }\r\n}\r\n\r\nexport { WebCamStream };\r\n","import { CameraFacingMode } from './CameraFacingMode';\n\nconst defaultContraints = {\n audio: false,\n video: {\n facingMode: 'user',\n height: { ideal: 720, max: 720 },\n width: { ideal: 1280, max: 1280 },\n },\n};\n\nconst cameraBlackList = [\n 'Snap Camera',\n];\n\nclass WebCamConstraints {\n\n public static getConstraints(\n w: number,\n h: number,\n cameraFacingMode: CameraFacingMode,\n ): Promise {\n return WebCamConstraints.getDeviceIdConstraints().then((deviceIds) => {\n return {\n ...defaultContraints,\n audio: false,\n video: {\n deviceId: deviceIds,\n facingMode: cameraFacingMode,\n height: { ...defaultContraints.video.height, ideal: h },\n width: { ...defaultContraints.video.width, ideal: w },\n },\n };\n });\n }\n\n // Filter out blacklisted cameras, for example we don't use want to use Snap Camera\n // The method leverage on navigator.mediaDevices and\n // there are two possible reasons for navigator.mediaDevices to not available:\n // 1 - the browser does not support webcams\n // 2 - the browser got a NativeBridge available\n // both points are handled by errors and NativeBridge so should be safe to return undefined in such cases\n private static getDeviceIdConstraints(): Promise {\n return navigator.mediaDevices && navigator.mediaDevices.enumerateDevices().then((devices) => {\n return devices.filter((device) => {\n return device.kind === 'videoinput' && !cameraBlackList.includes(device.label);\n }).map((device) => device.deviceId);\n }) || Promise.resolve(undefined);\n }\n}\n\nexport { WebCamConstraints, defaultContraints };\n","abstract class WebCamAbstractError extends Error {\n public type: string;\n\n constructor(type: string, message: string, error?: Error) {\n super(message);\n this.type = type;\n this.name = type;\n this.message = message;\n this.stack = error?.stack;\n\n Object.setPrototypeOf(this, WebCamAbstractError.prototype);\n }\n}\n\nexport { WebCamAbstractError };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessNotFoundError extends WebCamAbstractError {\n public static type = 'WebCamAccessNotFoundError';\n\n constructor(error?: Error) {\n super(WebCamAccessNotFoundError.type, 'webcam not found', error);\n Object.setPrototypeOf(this, WebCamAccessNotFoundError.prototype);\n }\n}\n\nexport { WebCamAccessNotFoundError };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessRejectedError extends WebCamAbstractError {\n public static type = 'WebCamAccessRejectedError';\n\n constructor(error?: Error) {\n super(WebCamAccessRejectedError.type, 'webcam access was rejected', error);\n Object.setPrototypeOf(this, WebCamAccessRejectedError.prototype);\n }\n}\n\nexport { WebCamAccessRejectedError };\n","enum AppViewSessionKeys {\n WEBCAM_OK = 'vm-webcam-ok',\n WEBCAM_KO = 'vm-webcam-ko',\n WEBCAM_KO_REASON_MESS = 'vm-webcam-ko_reason_mess',\n WEBCAM_SIZE_W = '_webcam_size_w',\n WEBCAM_SIZE_H = '_webcam_size_h',\n WEBCAM_FRAMERATE = '_webcam_framerate',\n WEBCAM_OPENED = '_webcam_opened',\n WEBCAM_CLOSED = '_webcam_closed',\n WEBCAM_OPENING = '_webcam_opening',\n WEBCAM_OPENING_TIME = '_webcam_opening_time_s',\n WEBCAM_POWERED_TIME = '_webcam_powered_time_s',\n}\n\nexport { AppViewSessionKeys };\n","import { WebCamAbstractError } from './WebCamAbstractError';\n\nclass WebCamAccessSystemError extends WebCamAbstractError {\n public static type = 'WebCamAccessSystemError';\n\n constructor(error?: Error) {\n super(WebCamAccessSystemError.type, 'webcam access was rejected', error);\n Object.setPrototypeOf(this, WebCamAccessSystemError.prototype);\n }\n}\n\nexport { WebCamAccessSystemError };\n","import { RemoteLog, RemoteLogConfig } from '@luxottica/vm-remotelog';\r\nimport { name, version } from '../package.json';\r\nimport { UserMedia } from './domain/adapter/UserMedia';\r\nimport { WebCamStream } from './domain/adapter/WebCamStream';\r\nimport { CameraFacingMode } from './domain/CameraFacingMode';\r\nimport { MockStream } from './domain/mockWebcam/MockStream';\r\nimport { NativeStream } from './domain/nativeWebcam/NativeStream';\r\nimport { NativeStreamTrack } from './domain/nativeWebcam/NativeStreamTrack';\r\nimport { WebCamConstraints } from './domain/WebCamConstraints';\r\nimport { WebCamAbstractError } from './error/WebCamAbstractError';\r\nimport { WebCamAccessNotFoundError } from './error/WebCamAccessNotFoundError';\r\nimport { WebCamAccessRejectedError } from './error/WebCamAccessRejectedError';\r\nimport { WebCamAccessSystemError } from './error/WebCamAccessSystemError';\r\nimport { AppViewSessionKeys } from './remotelog/AppViewSessionKeys';\r\n\r\nconst logger = RemoteLogConfig.getInstance().getLoggerInfo(name, version, 'WebCam');\r\n\r\nclass WebCam {\r\n\r\n private remoteLog = new RemoteLog();\r\n\r\n private userMediaPromise: Promise | undefined;\r\n private userReqPermissionTime = 0;\r\n private userResPermissionTime = 0;\r\n\r\n public tryToOpenWebCam(\r\n w: number,\r\n h: number,\r\n cameraFacingMode: CameraFacingMode,\r\n ): Promise {\r\n return new Promise((resolve, reject) => {\r\n WebCamConstraints.getConstraints(w, h, cameraFacingMode).then((constraints) => {\r\n this.tryToOpen(constraints)\r\n .then((mediaStream) => resolve(mediaStream))\r\n .catch((reason) => {\r\n switch (reason.name) {\r\n case 'AbortError':\r\n case 'NotReadableError':\r\n reject(new WebCamAccessSystemError());\r\n case 'NotFoundError':\r\n case 'TypeError':\r\n case 'OverconstrainedError':\r\n reject(new WebCamAccessNotFoundError());\r\n case 'NotAllowedError':\r\n case 'SecurityError':\r\n reject(new WebCamAccessRejectedError());\r\n default:\r\n reject(new WebCamAccessSystemError());\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n public closeCurrentMediaStream(): void {\r\n if (this.userMediaPromise) {\r\n this.userMediaPromise.then((mediaStream) => {\r\n try {\r\n mediaStream.getTracks().forEach((track: MediaStreamTrack | NativeStreamTrack) => {\r\n const totalWebCamTime = this.streamOpenedTotalTime();\r\n logger.info('closing webcam mediastream {} track {} [after {} secs]',\r\n mediaStream.id, track.label, totalWebCamTime);\r\n track.stop();\r\n this.logCloseSucc(mediaStream.id, totalWebCamTime);\r\n });\r\n } catch (error) {\r\n logger.warn('error closing mediastream {} tracks', mediaStream.id);\r\n }\r\n }).catch((reason) => {\r\n logger.warn('error closing mediastream: {}', reason);\r\n });\r\n }\r\n }\r\n\r\n public listMediaDevices() {\r\n const devices = navigator.mediaDevices.enumerateDevices();\r\n devices.then((devicesInfo) => {\r\n devicesInfo.forEach((deviceInfo) => {\r\n logger.info('found {}: {}', deviceInfo.deviceId, deviceInfo.label);\r\n });\r\n });\r\n }\r\n\r\n public createStreamObject(\r\n options: { target: string, id?: string, className?: string },\r\n stream: MediaStream | NativeStream,\r\n ): WebCamStream {\r\n return new WebCamStream(options, stream);\r\n }\r\n\r\n private tryToOpen(\r\n constraints: MediaStreamConstraints,\r\n ): Promise {\r\n\r\n logger.info('try to open webcam fow with constraints {}', JSON.stringify(constraints));\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_OPENING,\r\n statusText: JSON.stringify(constraints),\r\n },\r\n );\r\n\r\n this.userReqPermissionTime = performance.now();\r\n this.userMediaPromise = new UserMedia().get().getUserMedia(constraints);\r\n\r\n this.userMediaPromise.then((mediaStream) => {\r\n this.userResPermissionTime = performance.now();\r\n\r\n const permissionWaitingTime = this.permissionWaitingTime();\r\n logger.info('webcam opened in {} secs [mediastream id: {}]', permissionWaitingTime, mediaStream.id);\r\n\r\n this.logOpenSucc(mediaStream.id, permissionWaitingTime);\r\n\r\n mediaStream.getVideoTracks().map((track) => {\r\n this.logTrackSettings(track);\r\n });\r\n\r\n }).catch((reason: any) => { // TODO: MediaStreamError has been depricated\r\n logger.warn('webcam not opened after {} secs ([{}] {})',\r\n this.permissionWaitingTime(), reason.name, reason.message);\r\n if (reason.constraintName) {\r\n logger.warn('failed constraint: {}' + reason.constraintName);\r\n }\r\n this.logOpenFail(reason);\r\n });\r\n\r\n return this.userMediaPromise;\r\n }\r\n\r\n private logCloseSucc(mediaStreamId: string, totalWebCamTime: number) {\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_CLOSED,\r\n statusText: mediaStreamId,\r\n },\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_POWERED_TIME,\r\n statusText: totalWebCamTime ? totalWebCamTime.toFixed(2) : 'n.a.',\r\n },\r\n );\r\n }\r\n\r\n private logOpenSucc(mediaStreamId: string, permissionWaitingTime: number) {\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK,\r\n statusText: mediaStreamId,\r\n },\r\n );\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_OPENING_TIME,\r\n statusText: permissionWaitingTime ? permissionWaitingTime.toFixed(2) : 'n.a.',\r\n },\r\n );\r\n }\r\n\r\n private logOpenFail(reason: any) { // TODO: MediaStreamError has been depricated\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_KO,\r\n statusText: reason.name,\r\n },\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_KO_REASON_MESS,\r\n statusText: reason.name + ': ' + reason.message,\r\n },\r\n );\r\n }\r\n\r\n private logTrackSettings(track: MediaStreamTrack | NativeStreamTrack) {\r\n if (track && track.getSettings()) {\r\n const deviceW = track.getSettings().width;\r\n const deviceH = track.getSettings().height;\r\n const wcamfps = track.getSettings().frameRate;\r\n logger.info('webcam mediastream track available \\'{}\\' [id {} - w {} - h {} - framerate {}]',\r\n track.label, track.id, deviceW, deviceH, wcamfps);\r\n this.remoteLog.sendAppViewSession(\r\n {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_SIZE_W,\r\n statusText: deviceW ? deviceW.toString() : 'n.a.',\r\n }, {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_SIZE_H,\r\n statusText: deviceH ? deviceH.toString() : 'n.a.',\r\n }, {\r\n statusCode: AppViewSessionKeys.WEBCAM_OK + AppViewSessionKeys.WEBCAM_FRAMERATE,\r\n statusText: wcamfps ? Math.round(wcamfps).toString() : 'n.a.',\r\n },\r\n );\r\n }\r\n }\r\n\r\n private streamOpenedTotalTime(): number {\r\n return this.userResPermissionTime === 0 ? 0 : (performance.now() - this.userResPermissionTime) / 1000;\r\n }\r\n\r\n private permissionWaitingTime(): number {\r\n return this.userReqPermissionTime === 0 ? 0 : (performance.now() - this.userReqPermissionTime) / 1000;\r\n }\r\n\r\n}\r\n\r\nexport {\r\n WebCam,\r\n WebCamAbstractError,\r\n WebCamAccessNotFoundError,\r\n WebCamAccessRejectedError,\r\n WebCamAccessSystemError,\r\n WebCamStream,\r\n NativeStream,\r\n CameraFacingMode,\r\n};\r\n","/**\n * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk\n * License: MIT - http://mrgnrdrck.mit-license.org\n *\n * https://github.com/mroderick/PubSubJS\n */\n\n(function (root, factory){\n 'use strict';\n\n var PubSub = {};\n\n if (root.PubSub) {\n PubSub = root.PubSub;\n console.warn(\"PubSub already loaded, using existing version\");\n } else {\n root.PubSub = PubSub;\n factory(PubSub);\n }\n // CommonJS and Node.js module support\n if (typeof exports === 'object'){\n if (module !== undefined && module.exports) {\n exports = module.exports = PubSub; // Node.js specific `module.exports`\n }\n exports.PubSub = PubSub; // CommonJS module 1.1.1 spec\n module.exports = exports = PubSub; // CommonJS\n }\n // AMD support\n /* eslint-disable no-undef */\n else if (typeof define === 'function' && define.amd){\n define(function() { return PubSub; });\n /* eslint-enable no-undef */\n }\n\n}(( typeof window === 'object' && window ) || this, function (PubSub){\n 'use strict';\n\n var messages = {},\n lastUid = -1,\n ALL_SUBSCRIBING_MSG = '*';\n\n function hasKeys(obj){\n var key;\n\n for (key in obj){\n if ( Object.prototype.hasOwnProperty.call(obj, key) ){\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns a function that throws the passed exception, for use as argument for setTimeout\n * @alias throwException\n * @function\n * @param { Object } ex An Error object\n */\n function throwException( ex ){\n return function reThrowException(){\n throw ex;\n };\n }\n\n function callSubscriberWithDelayedExceptions( subscriber, message, data ){\n try {\n subscriber( message, data );\n } catch( ex ){\n setTimeout( throwException( ex ), 0);\n }\n }\n\n function callSubscriberWithImmediateExceptions( subscriber, message, data ){\n subscriber( message, data );\n }\n\n function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){\n var subscribers = messages[matchedMessage],\n callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,\n s;\n\n if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {\n return;\n }\n\n for (s in subscribers){\n if ( Object.prototype.hasOwnProperty.call(subscribers, s)){\n callSubscriber( subscribers[s], originalMessage, data );\n }\n }\n }\n\n function createDeliveryFunction( message, data, immediateExceptions ){\n return function deliverNamespaced(){\n var topic = String( message ),\n position = topic.lastIndexOf( '.' );\n\n // deliver the message as it is now\n deliverMessage(message, message, data, immediateExceptions);\n\n // trim the hierarchy and deliver message to each level\n while( position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf('.');\n deliverMessage( message, topic, data, immediateExceptions );\n }\n\n deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);\n };\n }\n\n function hasDirectSubscribersFor( message ) {\n var topic = String( message ),\n found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));\n\n return found;\n }\n\n function messageHasSubscribers( message ){\n var topic = String( message ),\n found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),\n position = topic.lastIndexOf( '.' );\n\n while ( !found && position !== -1 ){\n topic = topic.substr( 0, position );\n position = topic.lastIndexOf( '.' );\n found = hasDirectSubscribersFor(topic);\n }\n\n return found;\n }\n\n function publish( message, data, sync, immediateExceptions ){\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n var deliver = createDeliveryFunction( message, data, immediateExceptions ),\n hasSubscribers = messageHasSubscribers( message );\n\n if ( !hasSubscribers ){\n return false;\n }\n\n if ( sync === true ){\n deliver();\n } else {\n setTimeout( deliver, 0 );\n }\n return true;\n }\n\n /**\n * Publishes the message, passing the data to it's subscribers\n * @function\n * @alias publish\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publish = function( message, data ){\n return publish( message, data, false, PubSub.immediateExceptions );\n };\n\n /**\n * Publishes the message synchronously, passing the data to it's subscribers\n * @function\n * @alias publishSync\n * @param { String } message The message to publish\n * @param {} data The data to pass to subscribers\n * @return { Boolean }\n */\n PubSub.publishSync = function( message, data ){\n return publish( message, data, true, PubSub.immediateExceptions );\n };\n\n /**\n * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe\n * @function\n * @alias subscribe\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { String }\n */\n PubSub.subscribe = function( message, func ){\n if ( typeof func !== 'function'){\n return false;\n }\n\n message = (typeof message === 'symbol') ? message.toString() : message;\n\n // message is not registered yet\n if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){\n messages[message] = {};\n }\n\n // forcing token as String, to allow for future expansions without breaking usage\n // and allow for easy use as key names for the 'messages' object\n var token = 'uid_' + String(++lastUid);\n messages[message][token] = func;\n\n // return token for unsubscribing\n return token;\n };\n\n PubSub.subscribeAll = function( func ){\n return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);\n };\n\n /**\n * Subscribes the passed function to the passed message once\n * @function\n * @alias subscribeOnce\n * @param { String } message The message to subscribe to\n * @param { Function } func The function to call when a new message is published\n * @return { PubSub }\n */\n PubSub.subscribeOnce = function( message, func ){\n var token = PubSub.subscribe( message, function(){\n // before func apply, unsubscribe message\n PubSub.unsubscribe( token );\n func.apply( this, arguments );\n });\n return PubSub;\n };\n\n /**\n * Clears all subscriptions\n * @function\n * @public\n * @alias clearAllSubscriptions\n */\n PubSub.clearAllSubscriptions = function clearAllSubscriptions(){\n messages = {};\n };\n\n /**\n * Clear subscriptions by the topic\n * @function\n * @public\n * @alias clearAllSubscriptions\n * @return { int }\n */\n PubSub.clearSubscriptions = function clearSubscriptions(topic){\n var m;\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n delete messages[m];\n }\n }\n };\n\n /**\n Count subscriptions by the topic\n * @function\n * @public\n * @alias countSubscriptions\n * @return { Array }\n */\n PubSub.countSubscriptions = function countSubscriptions(topic){\n var m;\n // eslint-disable-next-line no-unused-vars\n var token;\n var count = 0;\n for (m in messages) {\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {\n for (token in messages[m]) {\n count++;\n }\n break;\n }\n }\n return count;\n };\n\n\n /**\n Gets subscriptions by the topic\n * @function\n * @public\n * @alias getSubscriptions\n */\n PubSub.getSubscriptions = function getSubscriptions(topic){\n var m;\n var list = [];\n for (m in messages){\n if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){\n list.push(m);\n }\n }\n return list;\n };\n\n /**\n * Removes subscriptions\n *\n * - When passed a token, removes a specific subscription.\n *\n\t * - When passed a function, removes all subscriptions for that function\n *\n\t * - When passed a topic, removes all subscriptions for that topic (hierarchy)\n * @function\n * @public\n * @alias subscribeOnce\n * @param { String | Function } value A token, function or topic to unsubscribe from\n * @example // Unsubscribing with a token\n * var token = PubSub.subscribe('mytopic', myFunc);\n * PubSub.unsubscribe(token);\n * @example // Unsubscribing with a function\n * PubSub.unsubscribe(myFunc);\n * @example // Unsubscribing from a topic\n * PubSub.unsubscribe('mytopic');\n */\n PubSub.unsubscribe = function(value){\n var descendantTopicExists = function(topic) {\n var m;\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){\n // a descendant of the topic exists:\n return true;\n }\n }\n\n return false;\n },\n isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),\n isToken = !isTopic && typeof value === 'string',\n isFunction = typeof value === 'function',\n result = false,\n m, message, t;\n\n if (isTopic){\n PubSub.clearSubscriptions(value);\n return;\n }\n\n for ( m in messages ){\n if ( Object.prototype.hasOwnProperty.call( messages, m ) ){\n message = messages[m];\n\n if ( isToken && message[value] ){\n delete message[value];\n result = value;\n // tokens are unique, so we can just stop here\n break;\n }\n\n if (isFunction) {\n for ( t in message ){\n if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){\n delete message[t];\n result = true;\n }\n }\n }\n }\n }\n\n return result;\n };\n}));\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n"],"names":["VideoStatus","Timer","start","duration","onComplete","this","stop","startTime","Date","now","currentDuration","currentTimer","window","setTimeout","clearTimeout","undefined","Math","min","logger","RemoteLogConfig","getLoggerInfo","name","version","webCam","WebCam","WebcamHelper","openWebcam","width","height","debug","tryToOpenWebCam","createStream","options","stream","createStreamObject","closeStream","closeCurrentMediaStream","NudgingGuide","componentDidUpdate","CallbackHelper","props","guidance","getText","glasses","vto","render","GuidanceCommand","React","className","LocalizationHelper","CheckIcon","enabled","xmlns","size","viewBox","fill","cx","cy","r","fillOpacity","d","stroke","strokeWidth","TrackingAreaPlaceholder","constructor","strokeDashArray","nudingClassUnknown","nudingClassDirections","nudingClassStandstill","areaSize","sourceHeight","sourceWidth","svgEllipseCX","svgEllipseCY","svgEllipseRadiusX_UI","svgEllipseRadiusY_UI","svgEllipseRadiusX_debug","svgEllipseRadiusY_debug","styleName","getNudgingStyle","id","preserveAspectRatio","rx","ry","strokeDasharray","checkIcon","getFaceSizeUI","getFaceSize","mirrorVideoWidth","mirrorVideoHeight","minimumFaceSizeRatio","referenceSide","max","toDataURL","url","fetch","then","response","blob","Promise","resolve","reject","reader","FileReader","onloadend","result","onerror","readAsDataURL","MockStreamTrack","uuid","label","settings","MockStream","resolution","tracks","push","MockBridgeMedia","constraints","videoSrc","localStorage","getItem","dataUrl","console","log","e","error","Error","AbstractNativeBridge","NativeBridge","webkit","messageHandlers","closeNativeCam","postMessage","requiredResolution","startNativeCam","pauseNativeCam","resumeNativeCam","_typeof","NativeStreamTrack","close","NativeStream","NativeBridgeMedia","RemoteLog","info","JSON","stringify","getRequiredResolution","onStartNativeCam","message","_this","remoteLog","sendAppViewSession","statusCode","statusText","video","ideal","UserMedia","mockOptionName","userMedia","navigator","mediaDevices","MockVideoStream","targetElement","document","getElementById","target","mediaStream","imageElement","Image","appendChild","privateCurrentTime","_this$imageElement","naturalWidth","_this$imageElement2","naturalHeight","value","type","listener","playingListener","waitForFrame","imgData","_this2","setAttribute","NativeVideoStream","getVideoTracks","getSettings","onCamFrame","base64","src","resume","startTimeCounter","pause","_this3","onload","_this4","WebCamVideoStream","createElement","muted","srcObject","currentTime","videoWidth","videoHeight","defaultMuted","addEventListener","removeEventListener","play","WebCamStream","isMockStream","privateStreamObject","isMediaStream","MediaStream","defaultContraints","audio","facingMode","cameraBlackList","WebCamConstraints","w","h","cameraFacingMode","getDeviceIdConstraints","deviceIds","deviceId","enumerateDevices","devices","filter","device","kind","includes","map","WebCamAbstractError","stack","Object","setPrototypeOf","prototype","WebCamAccessNotFoundError","WebCamAccessRejectedError","AppViewSessionKeys","WebCamAccessSystemError","getConstraints","tryToOpen","reason","userMediaPromise","getTracks","forEach","track","totalWebCamTime","streamOpenedTotalTime","logCloseSucc","warn","devicesInfo","deviceInfo","WEBCAM_OK","WEBCAM_OPENING","userReqPermissionTime","performance","get","getUserMedia","userResPermissionTime","permissionWaitingTime","logOpenSucc","logTrackSettings","constraintName","logOpenFail","mediaStreamId","WEBCAM_CLOSED","WEBCAM_POWERED_TIME","toFixed","WEBCAM_OPENING_TIME","WEBCAM_KO","WEBCAM_KO_REASON_MESS","deviceW","deviceH","wcamfps","frameRate","WEBCAM_SIZE_W","toString","WEBCAM_SIZE_H","WEBCAM_FRAMERATE","round","warmUp","environment","key","PoseTracker","FeatureLicensingService","initialize","PluginManager","addAutomaticEffects","VtoError","errorSource","adobeErrorParameters","errorCode","errorDetails","InitializationError","NotInitializedError","InvalidParametersError","parameter","InvalidLocaleError","locale","_this5","RenderingError","upc","_this6","UpcSupportedError","_this7","UpcMissingError","_this8","MountComponentError","divId","_this9","UnmountComponentError","_this10","WebcamUnavailableError","_this11","WebcamRejectedError","_this12","OpacityError","_this13","AnimationError","_this14","MissingAuthKeyError","_this15","FeatureInitializationError","_this16","FeatureUnavailableError","feature","_this17","FeatureUndefinedError","_this18","FeatureServerError","_this19","DefaultInitializationOptions","analyticsConfig","brand","channel","storeId","sessionTimeout","VM_SKIP_AKAMAI_LICENSING_FLAG","VMAkamaiLicensingFlag","Features","config","STAGING","baseUrl","overrideAkamai","getAllFeaturesPath","getKeyAuthorizationPath","ACCEPTANCE","PRODUCTION","defaultFeatures","Map","getFeatureConfig","currentLicenseKey","featureSupportCache","VmStore","isInitialized","currentEnvironment","getFeatureMap","featureListUrl","res","ok","json","status","featureMap","values","set","entries","licenseKey","shouldReset","getKey","isFeatureAuthorized","features","every","SET_ENVIRONMENT","SET_AUTH","RESET_AUTH","SET_LOADING_STATUS","SET_PRIVACY_OPTIONS","SET_USER","SET_MIRROR_OPTIONS","SET_MIRROR_STATUS","SET_MIRROR_GLASSES","SET_MIRROR_GLASSES_DATA","SET_MIRROR_GLASSES_STATUS","SET_GLTF_MIRROR_GLASSES_STATUS","SET_MESH","SET_MESH_DATA","SET_MESH_STATUS","ADD_PLUGIN","REMOVE_PLUGIN","CLEAR_ALL_PLUGINS","SET_PLUGINS_REQUIREMENTS","initialState","loading","WEBCAM_ACCESS","INITIALIZATION","POSETRACKER","RENDERING","GLASSES","MESH","privacy","auth","accessToken","refreshToken","AppActions","setEnvironment","createAction","Actions","setAuth","resetAuth","setPrivacyOptions","setLoadingStatus","AppReducer","handleActions","state","action","payload","_objectSpread2","mirrorStatus","mirrorOptions","pluginList","pluginsRequirements","MirrorActions","setMirrorOptions","setMirrorStatus","setMirrorGlasses","setMirrorGlassesData","setMirrorGlassesStatus","setGltfMirrorGlassesStatus","setMesh","setMeshData","setMeshStatus","addPlugin","removePlugin","clearAllPlugins","setPluginsRequirements","MirrorReducer","newPluginList","plugin","pluginId","index","findIndex","splice","videoId","pupillaryDistance","region","source","UserActions","setUser","UserReducer","combineReducers","app","mirror","user","finalOpacity","animationStartTime","animationDuration","vmIsInitialized","getState","configureVmStore","enhancer","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","rootReducer","configureStore","performanceEvents","onEngineStarting","onFirstFrameRendered","onNewAssetRequested","onWaitingForPose","onFirstFrameStarted","onAssetSwitchDone","onNewTransitionRequested","onNewTransitionRendered","onFPSCount","onFaceFoundSet","useBiometricBipa","onFaceFound","onLowEndDeviceDetected","onTransitionAnimation","onTransitionAnimationEnd","onLensChange","onAuthUpdated","onDisplayPage","onPrivacyAgree","onPrivacyFail","onPrivacyReject","onPrivacyPolicyClick","onTermsAndConditionsClick","onPrivacyDisplay","onMirrorExperience","transitionLensMap","transitionOpacity","animationEnabled","animateForward","downloadTransitionsPromise","TransitionColorHelper","downloadTransitionColors","VM_TRANSITIONS","downloadPromise","env","Catalog","colorMap","keys","colorName","specificLens","lens","setTransitionOverrideColor","color","OVERRIDE","reset","startAnimation","forward","currentOpacity","computePartialAnimation","getTransitionColor","_transitionLensMap","setCurrentLensOpacity","inputOpacity","getCurrentLensOpacity","animationProgress","animateOpacity","transitionAvailable","adobeConfig","lastInteractionTime","sessionTimeoutMs","vmRemoteLog","createLogger","loggerName","VM_OK","VM_INIT_BRAND","VM_INIT_CHANNEL","VM_INIT_LOCALE","VM_KO","VM_INIT","VM_UPC_AVAILABILITY","VM_CLOSE","generateAdobeData","eventParams","errorParams","lensSim","adobeData","location","href","referrer","hostname","_adobeConfig","_adobeConfig2","_adobeConfig3","_adobeConfig4","_adobeConfig5","storeRegion","_adobeConfig6","storeCompany","_adobeConfig7","globalStoreId","lensName","eventCode","sendAdobeRequest","data","adobeHost","query","Array","from","encodeURIComponent","join","adobeQuery","abobeHost","method","AdobeHelper","msEnvironment","VM_ANALYTICS","vtoError","adobeErrorData","updateInteractionTime","sendEvent","eventName","params","arguments","AnalyticsHelper","onSessionStart","onInitializeSuccess","onInitializeError","onRequestWebcam","onWebcamAllowed","onWebcamDenied","onWebcamUnavailable","onMirrorWasmFailure","onGlassesOn","onGlassesOff","onRender","upcIdLens","upcLensName","onRenderReady","onMirrorRenderFailure","onFitGlasses","onAdjustGlasses","onCloseMirror","onError","onScreenshot","onGlassesRemovalStateChange","closeMirror","dispatch","container","ReactDOM","unmountComponentError","RequestHelper","loginRequest","Events","PAUSE","RESUME","TOPIC_SCREENSHOT_REQ","TOPIC_SCREENSHOT_RES","getScreenshot","subscriber","quality","VM_SCREENSHOT","promise","PubSub","mess","transitionColor","imgURI","length","isPublished","localeMap","de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","zh","localeRegionMap","US","EU","AU","getLocaleRegionFallback","language","LocalizationDefaults","translations","MIRROR","GENERIC_ERROR","BUTTON","ERROR","SUBTEXT","PERMISSION_ERROR","WEBCAM_ERROR","MANUAL_START","TEXT","GUIDANCE","DEFAULT","LOOK_DOWN","LOOK_LEFT","LOOK_RIGHT","LOOK_UP","MOVE_CLOSER","MOVE_FARTHER","STAY_STILL","TILT_LEFT","TILT_RIGHT","UNKNOWN","UI","DESKTOP_TAP_TO_FREEZE","FIT_ME_BETTER","TAP_TO_FREEZE","USE_TWO_FINGERS","_classCallCheck","_createClass","page","text","getStringFromTranslation","localizedTranslations","translationType","translation","overriddenTranslations","_this$overriddenTrans","_this$overriddenTrans2","_this$overriddenTrans3","bipaActive","localizationPromise","localeReturn","localTranslations","formattedLocale","replace","formatLocaleRegEx","match","p1","p2","toUpperCase","RegExp","textEnv","localizationFileUrl","cleanLocale","resolvedLocale","localeLanguage","localeRegEx","exec","localeError","translationFound","fetchLocalization","fallbackTranslation","englishTranslation","SupportedFeaturesHelper","devicedetection","DeviceDetection","isVideoInputDeviceAvailable","available","wasmSupport","isWebAssemblySupported","webcamAccess","isUserMediaSupported","webcamAvailable","webglRendering","isWebGlSupported","isWebView","InitializationHelper","initOptions","privacyOptions","all","initializeRemote","getSupportedFeatures","userStore","supportedFeatures","FpsCounter","fpsQueue","fpsQueueLength","reduce","sum","shift","calcFps","processStartTime","t0","t1","RevealFX","DefaultAssetEnvironmentOptions","DefaultPrivacyOptions","privacyPolicy","termsAndConditions","bipaPrefill","firstName","lastName","email","localizationText","DefaultRenderingOptions","revealFX","OFF","checkError","hideGlasses","showMesh","meshColor","DefaultTrackingOptions","inspect","recoveryLimit","areaOffset","depthRange","axisRange","fittedPointsRatio","fov","edgeDetectionPercentage","standstill","timeLimit","positionVariance","axisVariance","onPoseTrack","ParameterHelper","initializationParams","privacyCallbacks","glassesType","inputOptions","createOptionsForTarget","faceRatio","calculateMinimumPointsRatio","videoResolution","glassesResolution","evaluationThreshold","rendering","globalDebugMethods","VM_GLOBAL_DEBUG_METHODS","plugins","stopGlassesDetectionAfterMs","nosePosition","touches","calculateAutoPointerCount","tracking","fittingModel","calculateFittingModel","isTouchDevice","PointerEvent","maxTouchPoints","matchMedia","matches","TouchEvent","PI","elementHasSize","clientHeight","clientWidth","parentElement","element","meshOptions","errorListenerAdded","event","validatedParams","mergeInitializationParams","VM_BIPA","Infinity","initReturn","callbacks","authData","call","callback","setPrivacyCallbacks","_params$auth","_params$auth2","userId","VmWebCam","webCamStream","deviceDetection","isNativeStream","isAppleiOS13","streamObject","instance","getUpcAvailability","glassesConfig","renderMirror","_options$environment","upcAvailability","mergedOptions","mergeMirrorOptions","GlassesEnvironment","renderMirrorPromise","glassesEnvironment","lods","upcMissingError","MirrorAsyncRoot","mountMirror","mountComponentError","Catalogue","upcs","featureLicensingInitialization","catalogueEnvironment","featureLicensingEnv","VirtualMirror","overrideLocalization","setOverrides","getMirrorDefaultLocalization","getDefaults","getBipaVersion","VM_GET_BIPA_VERSION","BipaManager","saveBipaEntry","VM_SAVE_BIPA_ENTRY","bipaVersion","formData","resetBipaState","cookie","getInstance","EventBus","fitMeBetter","setTransitionOpacity","opacity","TransitionLens","getPlugins","getPluginStatus","getStatus","pluginOptions","add","remove","isBrowserSupported","emitter","evtName","evtData","emit","evtHandler","on","mitt","hosts","MOCK","catalogHost","transitionsEndpoint","b3dHost","gltfHost","gltfPointer","customDistributorHost","customDistributorKey","customDistributorGetPermutation","assetType","PROD","PROD_LEGACY","TEST","TEST_LEGACY","TEST_TRANSITIONS","QA_GLTF_PROD","QA_GLTF_TEST","QA_B3D_PROD","QA_B3D_TEST","DISTRIBUTOR_VALIDATION_STAGING","DISTRIBUTOR_APPROVATION_STAGING","DISTRIBUTOR_VALIDATION_PRODUCTION","DISTRIBUTOR_APPROVATION_PRODUCTION","getEnvironmentConfig","upcsAvailabilityApi","CatalogueApiConfig","upcString","envConfig","notAvailableResponse","transitions","getUpc","isAvailable","isTransition","standardResponse","catalogResponse","resolutions","transitionsResolutions","getGlassesType","fetchCatalogResponse","apiEndpoint","requestInit","headers","mode","referrerPolicy","CatalogService","qaToolAvailability","split","qaToolMultipleAvailability","getMultipleUpcAvailability","upcList","previous","current","downloadTransitionLenses","AssetDecoder","getArrayBuffer","readAsArrayBuffer","getZippedImage","imagePromise","async","getImage","URL","createObjectURL","img","crossOrigin","revokeObjectURL","getImageBase64","getZippedGLTF","gltfPromise","getGLTFAsset","arrayBuffer","assetNames","gltfDefaults","MockAssetData","GenericError","genericError","GlassesDownloadError","GlassesDownloadForbiddenError","GlassesNotFoundError","isDistributorAsset","startsWith","ALL_TEXTURES","GlassesExtractor","glassesZip","singleTexture","colorIndexes","unzipGlasses","time1","time2","jszip","JSZip","loadAsync","extractFilesFromZipArchive","glassesExtracted","createGlassesDataFromExtractedArchive","zipUpc","promises","folderName","extractB3D","extractMult","extractShadow","extractLensMap","extractBoundingBoxes","extractLandmarks","extractColors","i","zipFolder","folder","file","colorPromise","ttime","multPromise","mult","shadowPromise","shadow","lensmapFile","lensmapPromise","lensmap","byteLength","lensBoundsFile","lensBoundsPromise","bounds","landmarksFile","landmarksPromise","landmarks","b3dPromise","b3d","textureIndexes","objModel","transparency","lensMap","lensBoundingBox","glassesLandmarks","textures","slice","ZipDownloader","tryToDownload","unzip","catch","glassesUrl","requestOptions","customDistributorAsset","qaDistributorAsset","dash","underscore","isQADistributorAsset","getCustomUrl","getDistributorUrl","getUrl","triedLegacyCustom","fetchGlasses","traceDownloadSuccess","traceDownloadFailure","getLegacyUrl","tkn","baseName","distributorBasename","GLASSES_OK","GLASSES_DOWNLOAD_SUCCESS_UPC","GLASSES_DOWNLOAD_SUCCESS_TIME","GLASSES_KO","GLASSES_DOWNLOAD_FAILURE_UPC","GLASSES_DOWNLOAD_FAILURE_TIME","miscUrls","boundsUrl","landmarksUrl","GlassesDownloader","getMockGltfGlassesUrl","gltfUrl","assetData","LOD1","LOD2","gltfLodUrls","nosepadType","fitting","flare","misc","landmarksAndBBox","LOD0","lod0","lod1","lod2","assetNumLods","lodNumber","upcSiUrl","_a","nosepad_type","_b","_c","_d","shouldDownloadZip","downloadZippedGlasses","lensBoundingBoxes","downloadSeparatedGlasses","lensMapUrl","lensBoundsUrl","glassesLandmarksUrl","qaToolEnv","qaTool","downloadB3dAsset","Blob","responses","glassesAndLensMap","glassesAsset","b3dUrl","transparencyUrl","shadowUrl","textureUrls","x","textureResponse","assetsResponses","glassesAssetUrl","root","factory","messages","lastUid","ALL_SUBSCRIBING_MSG","hasKeys","obj","hasOwnProperty","throwException","ex","callSubscriberWithDelayedExceptions","callSubscriberWithImmediateExceptions","deliverMessage","originalMessage","matchedMessage","immediateExceptions","s","subscribers","callSubscriber","createDeliveryFunction","topic","String","position","lastIndexOf","substr","hasDirectSubscribersFor","Boolean","messageHasSubscribers","found","publish","sync","deliver","publishSync","subscribe","func","token","subscribeAll","subscribeOnce","unsubscribe","apply","clearAllSubscriptions","clearSubscriptions","m","indexOf","countSubscriptions","count","getSubscriptions","list","t","descendantTopicExists","isTopic","isToken","isFunction","module","exports","v1","require","v4","byteToHex","buf","offset","bth","getRandomValues","crypto","bind","msCrypto","rnds8","Uint8Array","rnds","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","b","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","tmh","n","ii"],"sourceRoot":""}