import type { AppConfig, BrowserstackConfig } from './types.js'import type { Options } from '@wdio/types'import { v4 as uuidv4 } from 'uuid'import TestOpsConfig from './testOps/testOpsConfig.js'import { isUndefined } from './util.js'import { BStackLogger } from './bstackLogger.js'class BrowserStackConfig {static getInstance(options?: BrowserstackConfig & Options.Testrunner, config?: Options.Testrunner): BrowserStackConfig {if (!this._instance && options && config) {this._instance = new BrowserStackConfig(options, config)}return this._instance}public userName?: stringpublic accessKey?: stringpublic framework?: stringpublic buildName?: stringpublic buildIdentifier?: stringpublic testObservability: TestOpsConfigpublic percy: booleanpublic percyCaptureMode?: stringpublic accessibility: boolean | nullpublic app?: string | AppConfigprivate static _instance: BrowserStackConfigpublic appAutomate: booleanpublic automate: booleanpublic funnelDataSent: boolean = falsepublic percyBuildId?: number | nullpublic isPercyAutoEnabled = falsepublic sdkRunID: stringconstructor(options: BrowserstackConfig & Options.Testrunner, config: Options.Testrunner) {this.framework = config.frameworkthis.userName = config.userthis.accessKey = config.keythis.testObservability = new TestOpsConfig(options.testObservability !== false, !isUndefined(options.testObservability))this.percy = options.percy || falsethis.accessibility = options.accessibility !== undefined ? options.accessibility : nullthis.app = options.appthis.appAutomate = !isUndefined(options.app)this.automate = !this.appAutomatethis.buildIdentifier = options.buildIdentifierthis.sdkRunID = uuidv4()BStackLogger.info(`BrowserStack service started with id: ${this.sdkRunID}`)}sentFunnelData() {this.funnelDataSent = true}}export default BrowserStackConfig