/**
 * 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 { observe_Association, observe_Class, observe_ConcreteFunctionDefinition, observe_Enumeration, observe_INTERNAL__UnknownFunctionActivator, observe_Measure, observe_Package, observe_Profile, observe_HostedService, observe_SectionIndex, observe_SnowflakeApp, observe_SnowflakeM2MUdf, observe_MemSQLFunction, } from './DomainObserverHelper.js';
import { skipObservedWithContext, observe_INTERNAL__UnknownPackageableElement, observe_INTERNAL__UnknownElement, } from './CoreObserverHelper.js';
import { observe_FileGenerationSpecification, observe_GenerationSpecification, } from './DSL_Generation_ObserverHelper.js';
import { observe_INTERNAL__UnknownStore, observe_Mapping, observe_PackageableConnection, observe_PackageableRuntime, } from './DSL_Mapping_ObserverHelper.js';
import { observe_Service } from './DSL_Service_ObserverHelper.js';
import { observe_FlatData } from './STO_FlatData_ObserverHelper.js';
import { observe_Database } from './STO_Relational_ObserverHelper.js';
import { observe_DataElement } from './DSL_Data_ObserverHelper.js';
import { observe_ExecutionEnvironmentInstance } from './DSL_ExecutionEnvironment_ObseverHelper.js';
import { observe_DataProduct } from './DataProductObserveHelper.js';
class PackageableElementObserver {
    observerContext;
    constructor(observerContext) {
        this.observerContext = observerContext;
    }
    visit_PackageableElement(element) {
        const extraElementObservers = this.observerContext.plugins.flatMap((plugin) => plugin.getExtraElementObservers?.() ?? []);
        for (const observer of extraElementObservers) {
            const observedElement = observer(element, this.observerContext);
            if (observedElement) {
                return;
            }
        }
    }
    visit_INTERNAL__UnknownElement(element) {
        observe_INTERNAL__UnknownElement(element);
    }
    visit_INTERNAL__UnknownPackageableElement(element) {
        observe_INTERNAL__UnknownPackageableElement(element);
    }
    visit_INTERNAL__UnknownFunctionActivator(element) {
        observe_INTERNAL__UnknownFunctionActivator(element);
    }
    visit_SnowflakeApp(element) {
        observe_SnowflakeApp(element);
    }
    visit_SnowflakeM2MUdf(element) {
        observe_SnowflakeM2MUdf(element);
    }
    visit_HostedService(element) {
        observe_HostedService(element, this.observerContext);
    }
    visit_MemSQLFunction(element) {
        observe_MemSQLFunction(element);
    }
    visit_INTERNAL__UnknownStore(element) {
        observe_INTERNAL__UnknownStore(element);
    }
    visit_Package(element) {
        observe_Package(element, this.observerContext);
    }
    visit_SectionIndex(element) {
        observe_SectionIndex(element);
    }
    visit_PrimitiveType(element) {
        return;
    }
    visit_Profile(element) {
        observe_Profile(element);
    }
    visit_Enumeration(element) {
        observe_Enumeration(element);
    }
    visit_Measure(element) {
        observe_Measure(element);
    }
    visit_Class(element) {
        observe_Class(element);
    }
    visit_Association(element) {
        observe_Association(element);
    }
    visit_ConcreteFunctionDefinition(element) {
        observe_ConcreteFunctionDefinition(element, this.observerContext);
    }
    visit_FlatData(element) {
        observe_FlatData(element);
    }
    visit_Database(element) {
        observe_Database(element, this.observerContext);
    }
    visit_DataProduct(element) {
        observe_DataProduct(element);
    }
    visit_Mapping(element) {
        observe_Mapping(element, this.observerContext);
    }
    visit_Service(element) {
        observe_Service(element, this.observerContext);
    }
    visit_ExecutionEnvironmentInstance(element) {
        observe_ExecutionEnvironmentInstance(element, this.observerContext);
    }
    visit_PackageableRuntime(element) {
        observe_PackageableRuntime(element, this.observerContext);
    }
    visit_PackageableConnection(element) {
        observe_PackageableConnection(element, this.observerContext);
    }
    visit_FileGenerationSpecification(element) {
        observe_FileGenerationSpecification(element);
    }
    visit_GenerationSpecification(element) {
        observe_GenerationSpecification(element);
    }
    visit_DataElement(element) {
        observe_DataElement(element, this.observerContext);
    }
    visit_IngestDefinition(element) {
        return this.visit_INTERNAL__UnknownPackageableElement(element);
    }
}
export const observe_PackageableElement = skipObservedWithContext((packageableElement, context) => {
    packageableElement.accept_PackageableElementVisitor(new PackageableElementObserver(context));
    return packageableElement;
});
//# sourceMappingURL=PackageableElementObserver.js.map