/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { QUERY_BUILDER_EXPLORER_TREE_DND_TYPE, } from '../../stores/explorer/QueryBuilderExplorerState.js';
import { QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE, } from '../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
import { QUERY_BUILDER_VARIABLE_DND_TYPE, } from './BasicValueSpecificationEditor.js';
import { QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE, } from '../../stores/fetch-structure/tds/window/QueryBuilderWindowState.js';
export const getDNDItemType = (item, type) => {
    switch (type) {
        case QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE:
            return item.columnState.getColumnType();
        case QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.ENUM_PROPERTY:
        case QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY:
            return item.node.property
                .genericType.value.rawType;
        case QUERY_BUILDER_VARIABLE_DND_TYPE:
            return item.variable.genericType
                ?.value.rawType;
        case QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE:
            return item.columnState.getColumnType();
        default:
            return undefined;
    }
};
//# sourceMappingURL=QueryBuilderFilterHelper.js.map