"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionReplayLocalConfig = exports.getDefaultConfig = void 0;
var tslib_1 = require("tslib");
var analytics_core_1 = require("@amplitude/analytics-core");
var constants_1 = require("../constants");
var logger_1 = require("../logger");
var getDefaultConfig = function () { return ({
    flushMaxRetries: 2,
    logLevel: analytics_core_1.LogLevel.Warn,
    loggerProvider: new analytics_core_1.Logger(),
    transportProvider: new analytics_core_1.FetchTransport(),
}); };
exports.getDefaultConfig = getDefaultConfig;
var SessionReplayLocalConfig = /** @class */ (function (_super) {
    tslib_1.__extends(SessionReplayLocalConfig, _super);
    function SessionReplayLocalConfig(apiKey, options) {
        var _this = this;
        var _a;
        var defaultConfig = (0, exports.getDefaultConfig)();
        _this = _super.call(this, tslib_1.__assign(tslib_1.__assign({ transportProvider: defaultConfig.transportProvider, loggerProvider: new logger_1.SafeLoggerProvider(options.loggerProvider || defaultConfig.loggerProvider) }, options), { apiKey: apiKey })) || this;
        _this.flushMaxRetries =
            options.flushMaxRetries !== undefined && options.flushMaxRetries <= defaultConfig.flushMaxRetries
                ? options.flushMaxRetries
                : defaultConfig.flushMaxRetries;
        _this.apiKey = apiKey;
        _this.sampleRate = options.sampleRate || constants_1.DEFAULT_SAMPLE_RATE;
        _this.serverZone = options.serverZone || constants_1.DEFAULT_SERVER_ZONE;
        _this.configServerUrl = options.configServerUrl;
        _this.trackServerUrl = options.trackServerUrl;
        _this.shouldInlineStylesheet = options.shouldInlineStylesheet;
        _this.version = options.version;
        _this.performanceConfig = options.performanceConfig;
        _this.storeType = (_a = options.storeType) !== null && _a !== void 0 ? _a : 'idb';
        if (options.privacyConfig) {
            _this.privacyConfig = options.privacyConfig;
        }
        if (options.debugMode) {
            _this.debugMode = options.debugMode;
        }
        if (options.experimental) {
            _this.experimental = options.experimental;
        }
        return _this;
    }
    return SessionReplayLocalConfig;
}(analytics_core_1.Config));
exports.SessionReplayLocalConfig = SessionReplayLocalConfig;
//# sourceMappingURL=local-config.js.map