"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    associationFilterInitializer: ()=>associationFilterInitializer
});
const SchemaInitializer_js_namespaceObject = require("../../../application/schema-initializer/SchemaInitializer.js");
const utils_js_namespaceObject = require("../../../filter-provider/utils.js");
const associationFilterInitializer = new SchemaInitializer_js_namespaceObject.SchemaInitializer({
    name: 'AssociationFilter.Initializer',
    style: {
        marginTop: 16
    },
    icon: 'SettingOutlined',
    title: '{{t("Configure fields")}}',
    items: [
        {
            name: 'associationFields',
            type: 'itemGroup',
            title: '{{t("Association fields")}}',
            useChildren () {
                const associatedFields = (0, utils_js_namespaceObject.useAssociatedFields)();
                const children = associatedFields.map((field)=>{
                    var _field_uiSchema, _field_uiSchema1;
                    return {
                        type: 'item',
                        name: field.key,
                        title: null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title,
                        Component: 'AssociationFilterDesignerDisplayField',
                        schema: {
                            name: field.name,
                            title: null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title,
                            type: 'void',
                            'x-toolbar': 'CollapseItemSchemaToolbar',
                            'x-settings': 'fieldSettings:FilterCollapseItem',
                            'x-component': 'AssociationFilter.Item',
                            'x-use-component-props': 'useAssociationFilterProps',
                            'x-component-props': {
                                fieldNames: {
                                    label: field.targetKey || 'id'
                                }
                            },
                            properties: {}
                        }
                    };
                });
                return children;
            }
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            name: 'delete',
            title: '{{t("Delete")}}',
            Component: 'AssociationFilterDesignerDelete'
        }
    ]
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
