"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomClusterRenderer = void 0;
var markerclusterer_1 = require("@googlemaps/markerclusterer");
var CustomClusterRenderer = /** @class */ (function () {
    function CustomClusterRenderer(options) {
        this.options = options;
        this.defaultRenderer = new markerclusterer_1.DefaultRenderer();
    }
    CustomClusterRenderer.prototype.render = function (cluster, stats, map) {
        var _a;
        var element = this.defaultRenderer.render(cluster, stats, map);
        if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.calculator) && element instanceof google.maps.marker.AdvancedMarkerElement) {
            var title = this.options.calculator(cluster.markers).title;
            element.title = title;
        }
        return element;
    };
    return CustomClusterRenderer;
}());
exports.CustomClusterRenderer = CustomClusterRenderer;
