import { __assign, __extends, __read, __spreadArray } from "tslib";
import { injectReportDialog, SDK_NAME, SDK_VERSION } from '@sentry/browser';
import { BaseClient, getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';
import { RendererBackend } from './backend';
/** Frontend implementation for Electron renderer backends. */
var RendererClient = /** @class */ (function (_super) {
    __extends(RendererClient, _super);
    /**
     * Creates a new Electron SDK instance.
     * @param options Configuration options for this SDK.
     */
    function RendererClient(options) {
        return _super.call(this, RendererBackend, options) || this;
    }
    /**
     * Uploads a native crash dump (Minidump) to Sentry.
     *
     * @param path The relative or absolute path to the minidump.
     * @param event Optional event payload to attach to the minidump.
     * @param scope The SDK scope used to upload.
     */
    RendererClient.prototype.captureMinidump = function () {
        logger.warn('captureMinidump is a noop on the renderer');
        return undefined;
    };
    /**
     * Basically calling {@link BrowserClient.showReportDialog}
     * @inheritdoc
     */
    RendererClient.prototype.showReportDialog = function (options) {
        if (options === void 0) { options = {}; }
        if (!options.eventId) {
            options.eventId = getCurrentHub().lastEventId();
        }
        injectReportDialog(options);
    };
    /**
     * @inheritDoc
     */
    RendererClient.prototype._prepareEvent = function (event, scope, hint) {
        event.platform = event.platform || 'javascript';
        event.sdk = __assign(__assign({}, event.sdk), { name: SDK_NAME, packages: __spreadArray(__spreadArray([], __read(((event.sdk && event.sdk.packages) || []))), [
                {
                    name: 'npm:@sentry/browser',
                    version: SDK_VERSION,
                },
            ]), version: SDK_VERSION });
        return _super.prototype._prepareEvent.call(this, event, scope, hint);
    };
    return RendererClient;
}(BaseClient));
export { RendererClient };
//# sourceMappingURL=client.js.map