"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.clearClientSelection = exports.addClientSelectedFeature = exports.removeMapLayerBusyWorker = exports.addMapLayerBusyWorker = exports.setMapLayerVectorStyle = exports.setMapLayerVisibility = exports.setHeatmapLayerRadius = exports.setHeatmapLayerBlur = exports.setMapLayerOpacity = exports.setMapLayerIndex = exports.removeMapLayer = exports.externalLayersReady = exports.mapLayerAdded = exports.showSelectedFeature = exports.setViewRotationEnabled = exports.setViewRotation = exports.setManualFeatureTooltipsEnabled = exports.enableSelectDragPan = exports.setFeatureTooltipsEnabled = exports.setActiveMap = exports.setActiveTool = exports.nextView = exports.previousView = exports.setViewSizeUnits = exports.setLayerTransparency = exports.setMouseCoordinates = exports.setScale = exports.setBaseLayer = exports.setBusyCount = exports.invokeCommand = exports.setSelection = exports.mapResized = exports.setCurrentView = exports.queryMapFeatures = exports.combineSelections = void 0;
var tslib_1 = require("tslib");
var common_1 = require("../api/common");
var runtime_1 = require("../api/runtime");
var number_1 = require("../utils/number");
var client_1 = require("../api/client");
var request_builder_1 = require("../api/request-builder");
var deArrayify_1 = require("../api/builders/deArrayify");
var actions_1 = require("../constants/actions");
var session_store_1 = require("../api/session-store");
var site_version_1 = require("../utils/site-version");
var viewer_state_1 = require("../utils/viewer-state");
var lodash_xor_1 = tslib_1.__importDefault(require("lodash.xor"));
var lodash_xorby_1 = tslib_1.__importDefault(require("lodash.xorby"));
var logger_1 = require("../utils/logger");
function combineSelectedFeatures(oldRes, newRes) {
    // This function won't be called if we're using QUERYMAPFEATURES older than v4.0.0 (because we won't request
    // attributes on the first QUERYMAPFEATURES call and use the save merged selection XML QUERYMAPFEATURES call as an 
    // opportunity to get back the full attribute set of the merged selection), but if we ever do hit here we are totally
    // assuming a v4 QUERYMAPFEATURES response and the selected features will be having a SelectionKey set so we can easily 
    // xorby the 2 arrays
    return (0, lodash_xorby_1.default)(oldRes, newRes, function (f) { return f.SelectionKey; });
}
function combineSelectedFeatureSets(oldRes, newRes) {
    if (oldRes == null) {
        return newRes;
    }
    var merged = {
        SelectedLayer: []
    };
    for (var _i = 0, _a = oldRes.SelectedLayer; _i < _a.length; _i++) {
        var layer = _a[_i];
        merged.SelectedLayer.push(layer);
    }
    if (newRes) {
        var _loop_1 = function (layer) {
            var layerId = layer["@id"];
            var layerName = layer["@name"];
            var existing = merged.SelectedLayer.filter(function (l) { return l["@id"] == layerId && l["@name"] == layerName; });
            if (existing.length == 0) {
                merged.SelectedLayer.push(layer);
            }
            else {
                existing[0].Feature = combineSelectedFeatures(existing[0].Feature, layer.Feature);
            }
        };
        for (var _b = 0, _c = newRes.SelectedLayer; _b < _c.length; _b++) {
            var layer = _c[_b];
            _loop_1(layer);
        }
    }
    return merged;
}
function combineFeatureSets(oldRes, newRes) {
    if (oldRes == null) {
        return newRes;
    }
    var merged = {
        Layer: []
    };
    for (var _i = 0, _a = oldRes.Layer; _i < _a.length; _i++) {
        var layer = _a[_i];
        merged.Layer.push(layer);
    }
    if (newRes) {
        var _loop_2 = function (layer) {
            var layerId = layer["@id"];
            var existing = merged.Layer.filter(function (l) { return l["@id"] == layerId; });
            if (existing.length == 0) {
                merged.Layer.push(layer);
            }
            else {
                existing[0].Class.ID = (0, lodash_xor_1.default)(existing[0].Class.ID, layer.Class.ID);
            }
        };
        for (var _b = 0, _c = newRes.Layer; _b < _c.length; _b++) {
            var layer = _c[_b];
            _loop_2(layer);
        }
    }
    return merged;
}
/**
 * @hidden Exported just to be unit testable
 */
function combineSelections(oldRes, newRes) {
    if (oldRes) {
        var merged = {
            SelectedFeatures: combineSelectedFeatureSets(oldRes.SelectedFeatures, newRes.SelectedFeatures),
            FeatureSet: combineFeatureSets(oldRes.FeatureSet, newRes.FeatureSet),
            Hyperlink: undefined,
            InlineSelectionImage: undefined
        };
        return merged;
    }
    else {
        return newRes;
    }
}
exports.combineSelections = combineSelections;
function queryMapFeaturesHelper(map, client, opts, selectionSet, dispatch) {
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var mapName, sv, isV4, queryOp, isAppendingWithAttributesOnOldMapGuide, res, combined, mergedXml, opts2, res2;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    mapName = map.Name;
                    sv = (0, site_version_1.getSiteVersion)(map);
                    isV4 = (0, site_version_1.canUseQueryMapFeaturesV4)(sv);
                    queryOp = isV4
                        ? function (opts) { return client.queryMapFeatures_v4(opts); }
                        : function (opts) { return client.queryMapFeatures(opts); };
                    isAppendingWithAttributesOnOldMapGuide = !isV4
                        && opts.append === true
                        && opts.options.persist === 1
                        && opts.options.requestdata !== undefined
                        && (opts.options.requestdata & request_builder_1.QueryFeaturesSet.Attributes);
                    if (isAppendingWithAttributesOnOldMapGuide) {
                        (0, logger_1.debug)("Not asking for attributes in first QUERYMAPFEATURES");
                        // Momentarily stop requesting for attributes
                        opts.options.requestdata &= ~request_builder_1.QueryFeaturesSet.Attributes;
                    }
                    return [4 /*yield*/, queryOp(opts.options)];
                case 1:
                    res = _a.sent();
                    if (!(opts.options.persist === 1)) return [3 /*break*/, 5];
                    if (!(opts.append === true)) return [3 /*break*/, 3];
                    combined = combineSelections(selectionSet, res);
                    mergedXml = (0, deArrayify_1.buildSelectionXml)(combined.FeatureSet);
                    opts2 = {
                        session: map.SessionId,
                        mapname: map.Name,
                        persist: 1,
                        featurefilter: mergedXml
                    };
                    // If appending with attributes, we can now also include attributes of the merged result
                    if (isAppendingWithAttributesOnOldMapGuide) {
                        (0, logger_1.debug)("Now asking for attributes in second QUERYMAPFEATURES");
                        opts2.requestdata = request_builder_1.QueryFeaturesSet.Attributes;
                    }
                    return [4 /*yield*/, queryOp(opts2)];
                case 2:
                    res2 = _a.sent();
                    // If appending with attributes, res2 represents the attributes of the merged result, so accept
                    // it as the new combined without having to do any stitching
                    if (isAppendingWithAttributesOnOldMapGuide) {
                        (0, logger_1.debug)("Accepting second QUERYMAPFEATURES as new combined selection response");
                        combined = res2;
                    }
                    (0, session_store_1.persistSelectionSetToLocalStorage)(map.SessionId, mapName, combined); // set and forget
                    dispatch(setSelection(mapName, combined));
                    return [2 /*return*/, combined];
                case 3:
                    (0, session_store_1.persistSelectionSetToLocalStorage)(map.SessionId, mapName, res); // set and forget
                    dispatch(setSelection(mapName, res));
                    return [2 /*return*/, res];
                case 4: return [3 /*break*/, 6];
                case 5: return [2 /*return*/, res];
                case 6: return [2 /*return*/];
            }
        });
    });
}
/**
 * Queries map features
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @param {QueryMapFeatureActionOptions} opts query options
 * @returns {ReduxThunkedAction}
 */
function queryMapFeatures(mapName, opts) {
    return function (dispatch, getState) {
        var state = getState();
        var args = state.config;
        var map = (0, common_1.getRuntimeMap)(state);
        var selectionSet = (0, common_1.getSelectionSet)(state);
        if (map && args.agentKind && args.agentUri) {
            var client = new client_1.Client(args.agentUri, args.agentKind);
            var success_1 = function (res) {
                if (opts.callback != null) {
                    opts.callback(res);
                }
            };
            var failure_1 = function (err) {
                if (opts.errBack != null) {
                    opts.errBack(err);
                }
            };
            queryMapFeaturesHelper(map, client, opts, selectionSet, dispatch).then(function (r) { return success_1(r); })
                .catch(function (e) { return failure_1(e); });
        }
    };
}
exports.queryMapFeatures = queryMapFeatures;
/**
 * Sets the current map view.
 *
 * NOTE: Subscribing components are not guaranteed to receive every new view change sent by
 * calling this method. For purposes of optimization, views passed in that are "close enough"
 * to the current view are not dispatched to subscribing components.
 *
 * @export
 * @param {IMapView} view The map view to set
 * @returns {ReduxThunkedAction}
 */
function setCurrentView(view) {
    return function (dispatch, getState) {
        var _a, _b;
        // HACK-y:
        //
        // We don't want to dispatch SET_VIEW actions with redundant view
        // states if the one we're about to dispatch is the same as the
        // previous one
        var state = getState();
        var currentView = (0, common_1.getCurrentView)(state);
        var newView = tslib_1.__assign({}, view);
        var mapName = state.config.activeMapName;
        var dispatchThis = true;
        if (currentView && mapName) {
            //If the current map is tiled (has finite scales), "snap" the view's scale
            //to the closest applicable finite scale then do the test 
            var mapState = state.mapState[mapName];
            var fs = (_b = (_a = mapState === null || mapState === void 0 ? void 0 : mapState.mapguide) === null || _a === void 0 ? void 0 : _a.runtimeMap) === null || _b === void 0 ? void 0 : _b.FiniteDisplayScale;
            if (fs && fs.length > 0) {
                var fi = (0, number_1.getFiniteScaleIndexForScale)(fs, newView.scale);
                newView.scale = fs[fi];
            }
            if ((0, viewer_state_1.areViewsCloseToEqual)(currentView, newView)) {
                dispatchThis = false;
            }
        }
        if (dispatchThis && mapName) {
            dispatch({
                type: actions_1.ActionType.MAP_SET_VIEW,
                payload: {
                    mapName: mapName,
                    view: newView
                }
            });
        }
    };
}
exports.setCurrentView = setCurrentView;
/**
 * Sends a map resized notification
 *
 * @export
 * @param {number} width
 * @param {number} height
 * @returns {IMapResizedAction}
 */
function mapResized(width, height) {
    return {
        type: actions_1.ActionType.MAP_RESIZED,
        payload: {
            width: width,
            height: height
        }
    };
}
exports.mapResized = mapResized;
/**
 * Sets the selection set for the given map
 *
 * @param mapName
 * @param selectionSet
 * @returns
 *
 * @since 0.14 Fixed up the type of selectionSet parameter
 */
function setSelection(mapName, selectionSet) {
    return {
        type: actions_1.ActionType.MAP_SET_SELECTION,
        payload: {
            mapName: mapName,
            selection: selectionSet
        }
    };
}
exports.setSelection = setSelection;
/**
 * Invokes the specified command
 *
 * @export
 * @param {ICommand} cmd
 * @param {*} [parameters]
 * @returns {ReduxThunkedAction}
 */
function invokeCommand(cmd, parameters) {
    return function (dispatch, getState) {
        return cmd.invoke(dispatch, getState, (0, runtime_1.getViewer)(), parameters);
    };
}
exports.invokeCommand = invokeCommand;
/**
 * Sets the busy count of the viewer. A value greater than zero signifies that the viewer is currently
 * busy performing various actions (eg. Loading/Rendering the current map image)
 *
 * @export
 * @param {number} busyCount The current busy count
 * @returns {IMapSetBusyCountAction}
 */
function setBusyCount(busyCount) {
    return {
        type: actions_1.ActionType.MAP_SET_BUSY_COUNT,
        payload: busyCount
    };
}
exports.setBusyCount = setBusyCount;
/**
 * Set the given external base layer as the active base layer
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @param {string} layerName The name of the external base layer to set as active
 * @returns
 */
function setBaseLayer(mapName, layerName) {
    return {
        type: actions_1.ActionType.MAP_SET_BASE_LAYER,
        payload: {
            mapName: mapName,
            layerName: layerName
        }
    };
}
exports.setBaseLayer = setBaseLayer;
/**
 * Sets the view scale
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @param {number} scale The scale to set
 * @returns
 */
function setScale(mapName, scale) {
    var viewer = (0, runtime_1.getViewer)();
    var resolution;
    if (viewer) {
        resolution = viewer.scaleToResolution(scale);
    }
    return {
        type: actions_1.ActionType.MAP_SET_SCALE,
        payload: {
            mapName: mapName,
            scale: scale,
            resolution: resolution
        }
    };
}
exports.setScale = setScale;
/**
 * Sets the current mouse coordinates
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @param {*} coord The current mouse coordinates
 * @returns
 */
function setMouseCoordinates(mapName, coord) {
    return {
        type: actions_1.ActionType.UPDATE_MOUSE_COORDINATES,
        payload: {
            mapName: mapName,
            coord: coord
        }
    };
}
exports.setMouseCoordinates = setMouseCoordinates;
/**
 * Set the transparency for the given OL layer
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @param {string} layerName The name of the OL layer
 * @param {number} opacity A value between 0 and 1. 1 - Fully Opaque, 0 - Fully Transparent
 * @returns
 */
function setLayerTransparency(mapName, layerName, opacity) {
    return {
        type: actions_1.ActionType.MAP_SET_LAYER_TRANSPARENCY,
        payload: {
            mapName: mapName,
            layerName: layerName,
            opacity: opacity
        }
    };
}
exports.setLayerTransparency = setLayerTransparency;
/**
 * Sets the units for the map view size display
 *
 * @export
 * @param {UnitOfMeasure} unit
 * @returns {IMapSetViewSizeUnitsAction}
 */
function setViewSizeUnits(unit) {
    return {
        type: actions_1.ActionType.MAP_SET_VIEW_SIZE_UNITS,
        payload: unit
    };
}
exports.setViewSizeUnits = setViewSizeUnits;
/**
 * Goes back to the previous view on the navigation stack
 *
 * @export
 * @param {string} mapName The name of the current runtime map
 * @returns
 */
function previousView(mapName) {
    return {
        type: actions_1.ActionType.MAP_PREVIOUS_VIEW,
        payload: {
            mapName: mapName
        }
    };
}
exports.previousView = previousView;
/**
 * Goes to the next view on the navigation stack
 *
 * @export
 * @param {string} mapName The name of the current runtime amp
 * @returns
 */
function nextView(mapName) {
    return {
        type: actions_1.ActionType.MAP_NEXT_VIEW,
        payload: {
            mapName: mapName
        }
    };
}
exports.nextView = nextView;
/**
 * Sets the active map tool
 *
 * @export
 * @param {ActiveMapTool} tool The active map tool command
 * @returns
 */
function setActiveTool(tool) {
    return {
        type: actions_1.ActionType.MAP_SET_ACTIVE_TOOL,
        payload: tool
    };
}
exports.setActiveTool = setActiveTool;
/**
 * Sets the active runtime map
 *
 * @export
 * @param {string} mapName The name of the runtime map to set as active
 * @returns
 */
function setActiveMap(mapName) {
    return {
        type: actions_1.ActionType.MAP_SET_ACTIVE_MAP,
        payload: mapName
    };
}
exports.setActiveMap = setActiveMap;
/**
 * Sets whether feature tooltips (aka. Map Tips) are enabled
 *
 * @export
 * @param {boolean} enabled
 * @returns
 */
function setFeatureTooltipsEnabled(enabled) {
    return {
        type: actions_1.ActionType.MAP_SET_MAPTIP,
        payload: enabled
    };
}
exports.setFeatureTooltipsEnabled = setFeatureTooltipsEnabled;
/**
 * Sets whether the select tool can pan while dragging
 *
 * @param enabled
 * @since 0.14.2
 */
function enableSelectDragPan(enabled) {
    return {
        type: actions_1.ActionType.MAP_ENABLE_SELECT_DRAGPAN,
        payload: enabled
    };
}
exports.enableSelectDragPan = enableSelectDragPan;
/**
 * Sets whether manual feature tooltips (aka. Map Tips) are enabled
 *
 * @export
 * @param {boolean} enabled
 * @returns
 */
function setManualFeatureTooltipsEnabled(enabled) {
    return {
        type: actions_1.ActionType.MAP_SET_MANUAL_MAPTIP,
        payload: enabled
    };
}
exports.setManualFeatureTooltipsEnabled = setManualFeatureTooltipsEnabled;
/**
 * Sets the rotation of the current view
 *
 * @export
 * @param {number} rotation
 * @returns
 */
function setViewRotation(rotation) {
    return {
        type: actions_1.ActionType.MAP_SET_VIEW_ROTATION,
        payload: rotation
    };
}
exports.setViewRotation = setViewRotation;
/**
 * Sets whether view rotation is enabled or not
 *
 * @export
 * @param {boolean} enabled
 */
function setViewRotationEnabled(enabled) {
    return {
        type: actions_1.ActionType.MAP_SET_VIEW_ROTATION_ENABLED,
        payload: enabled
    };
}
exports.setViewRotationEnabled = setViewRotationEnabled;
/**
 * Shows the selected feature on the map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerId
 * @param {string} selectionKey
 * @returns {IShowSelectedFeatureAction}
 */
function showSelectedFeature(mapName, layerId, selectionKey) {
    return {
        type: actions_1.ActionType.MAP_SHOW_SELECTED_FEATURE,
        payload: {
            mapName: mapName,
            layerId: layerId,
            selectionKey: selectionKey
        }
    };
}
exports.showSelectedFeature = showSelectedFeature;
/**
 * NOTE: Dispatching this action does not add the layer to the map. This is a means to notify others
 * that a new layer has been added. It is expected to be dispatched by any component that is managing
 * layers
 *
 * @export
 * @param {string} mapName
 * @param {ILayerInfo} layer
 * @param {IVectorLayerStyle} [defaultStyle]
 * @returns {IAddedLayerAction}
 * @since 0.13
 * @since 0.14 defaultStyle argument changed to IVectorLayerStyle
 */
function mapLayerAdded(mapName, layer, defaultStyle) {
    return {
        type: actions_1.ActionType.LAYER_ADDED,
        payload: {
            mapName: mapName,
            layer: layer,
            defaultStyle: defaultStyle
        }
    };
}
exports.mapLayerAdded = mapLayerAdded;
/**
 * An action that signals the externa layers for the given map name is ready. This action
 * is only dispatched when there is no external layers to initially add
 *
 * @param mapName
 * @since 0.14
 */
function externalLayersReady(mapName) {
    return {
        type: actions_1.ActionType.EXTERNAL_LAYERS_READY,
        payload: {
            mapName: mapName
        }
    };
}
exports.externalLayersReady = externalLayersReady;
/**
 * Removes a given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @returns {IRemoveLayerAction}
 * @since 0.13
 */
function removeMapLayer(mapName, layerName) {
    return {
        type: actions_1.ActionType.REMOVE_LAYER,
        payload: {
            mapName: mapName,
            layerName: layerName
        }
    };
}
exports.removeMapLayer = removeMapLayer;
/**
 * Sets the display order index for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @param {number} index
 * @returns {ISetLayerIndexAction}
 * @since 0.13
 */
function setMapLayerIndex(mapName, layerName, index) {
    return {
        type: actions_1.ActionType.SET_LAYER_INDEX,
        payload: {
            mapName: mapName,
            layerName: layerName,
            index: index
        }
    };
}
exports.setMapLayerIndex = setMapLayerIndex;
/**
 * Sets the opacity for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @param {number} opacity
 * @returns {ISetLayerOpacityAction}
 * @since 0.13
 */
function setMapLayerOpacity(mapName, layerName, opacity) {
    return {
        type: actions_1.ActionType.SET_LAYER_OPACITY,
        payload: {
            mapName: mapName,
            layerName: layerName,
            opacity: opacity
        }
    };
}
exports.setMapLayerOpacity = setMapLayerOpacity;
/**
 * Sets the heatmap blur for the given external heatmap layer for the given map
 *
 * @param mapName
 * @param layerName
 * @param blur
 */
function setHeatmapLayerBlur(mapName, layerName, blur) {
    return {
        type: actions_1.ActionType.SET_HEATMAP_LAYER_BLUR,
        payload: {
            mapName: mapName,
            layerName: layerName,
            blur: blur
        }
    };
}
exports.setHeatmapLayerBlur = setHeatmapLayerBlur;
/**
 * Sets the heatmap radius for the given external heatmap layer for the given map
 *
 * @param mapName
 * @param layerName
 * @param radius
 */
function setHeatmapLayerRadius(mapName, layerName, radius) {
    return {
        type: actions_1.ActionType.SET_HEATMAP_LAYER_RADIUS,
        payload: {
            mapName: mapName,
            layerName: layerName,
            radius: radius
        }
    };
}
exports.setHeatmapLayerRadius = setHeatmapLayerRadius;
/**
 * Sets the visibility for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @param {boolean} visible
 * @returns {ISetLayerVisibilityAction}
 * @since 0.13
 */
function setMapLayerVisibility(mapName, layerName, visible) {
    return {
        type: actions_1.ActionType.SET_LAYER_VISIBILITY,
        payload: {
            mapName: mapName,
            layerName: layerName,
            visible: visible
        }
    };
}
exports.setMapLayerVisibility = setMapLayerVisibility;
/**
 * Sets the vector style for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @param {IVectorLayerStyle} style
 * @param {VectorStyleSource} which
 * @returns {ISetMapLayerVectorStyle}
 * @since 0.13
 * @since 0.14 style and which arguments changed to IVectorLayerStyle
 */
function setMapLayerVectorStyle(mapName, layerName, style, which) {
    return {
        type: actions_1.ActionType.SET_LAYER_VECTOR_STYLE,
        payload: {
            mapName: mapName,
            layerName: layerName,
            style: style,
            which: which
        }
    };
}
exports.setMapLayerVectorStyle = setMapLayerVectorStyle;
/**
 * Adds a busy worker for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @returns {IAddMapLayerBusyWorkerAction}
 * @since 0.13
 */
function addMapLayerBusyWorker(mapName, layerName) {
    return {
        type: actions_1.ActionType.ADD_LAYER_BUSY_WORKER,
        payload: {
            mapName: mapName,
            layerName: layerName
        }
    };
}
exports.addMapLayerBusyWorker = addMapLayerBusyWorker;
/**
 * Removes a busy worker for the given external layer for the given map
 *
 * @export
 * @param {string} mapName
 * @param {string} layerName
 * @returns {IRemoveMapLayerBusyWorkerAction}
 * @since 0.13
 */
function removeMapLayerBusyWorker(mapName, layerName) {
    return {
        type: actions_1.ActionType.REMOVE_LAYER_BUSY_WORKER,
        payload: {
            mapName: mapName,
            layerName: layerName
        }
    };
}
exports.removeMapLayerBusyWorker = removeMapLayerBusyWorker;
/**
 * Adds a feature to the client selection set for the given map
 *
 * @param mapName
 * @param layerName
 * @param feature
 * @returns
 * @since 0.14
 */
function addClientSelectedFeature(mapName, layerName, feature) {
    return {
        type: actions_1.ActionType.MAP_ADD_CLIENT_SELECTED_FEATURE,
        payload: {
            mapName: mapName,
            layerName: layerName,
            feature: feature
        }
    };
}
exports.addClientSelectedFeature = addClientSelectedFeature;
/**
 * Clears the client selection set for the given map
 *
 * @param mapName
 * @since 0.14
 */
function clearClientSelection(mapName) {
    return {
        type: actions_1.ActionType.MAP_CLEAR_CLIENT_SELECTION,
        payload: {
            mapName: mapName
        }
    };
}
exports.clearClientSelection = clearClientSelection;
//# sourceMappingURL=map.js.map