import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_components__ from "@tachybase/components";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
import * as __WEBPACK_EXTERNAL_MODULE__built_in_acl_index_mjs__ from "../../../built-in/acl/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../../collection-manager/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_mjs__ from "./hooks.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_mjs__ from "./schema.mjs";
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n      & .ant-formily-item-layout-vertical {\n        margin-bottom: 10px;\n      }\n      .ant-card-body {\n        padding: 15px 20px 5px;\n      }\n      .ant-divider-horizontal {\n        margin: 10px 0;\n      }\n    "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
function _templateObject1() {
    const data = _tagged_template_literal([
        "\n      .ant-card-body {\n        padding: 0px 20px 20px 0px;\n      }\n      > .ant-card-bordered {\n        border: none;\n      }\n    "
    ]);
    _templateObject1 = function() {
        return data;
    };
    return data;
}
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
    let { css } = param;
    return {
        body: css(_templateObject()),
        showTitle: css(_templateObject1())
    };
});
const InternalNester = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)(()=>{
    var _fieldSchema_xdecoratorprops;
    const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const insertNester = (0, __WEBPACK_EXTERNAL_MODULE__hooks_mjs__.useInsertSchema)('Nester');
    const { options: collectionField } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_mjs__.useAssociationFieldContext)();
    var _fieldSchema_xdecoratorprops_showTitle;
    const showTitle = null === (_fieldSchema_xdecoratorprops_showTitle = null === (_fieldSchema_xdecoratorprops = fieldSchema['x-decorator-props']) || void 0 === _fieldSchema_xdecoratorprops ? void 0 : _fieldSchema_xdecoratorprops.showTitle) || void 0 === _fieldSchema_xdecoratorprops_showTitle || _fieldSchema_xdecoratorprops_showTitle;
    const { actionName } = (0, __WEBPACK_EXTERNAL_MODULE__built_in_acl_index_mjs__.useACLActionParamsContext)();
    const { styles } = useStyles();
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        insertNester(__WEBPACK_EXTERNAL_MODULE__schema_mjs__["default"].Nester);
    }, []);
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.CollectionProvider_deprecated, {
        name: collectionField.target,
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__built_in_acl_index_mjs__.ACLCollectionProvider, {
            actionPath: "".concat(collectionField.target, ":").concat(actionName),
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_components__.FormLayout, {
                layout: 'vertical',
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                    className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])(styles.body, {
                        [styles.showTitle]: false === showTitle
                    }),
                    children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.RecursionField, {
                        onlyRenderProperties: true,
                        basePath: field.address,
                        schema: fieldSchema,
                        filterProperties: (s)=>'AssociationField.Nester' === s['x-component']
                    })
                })
            })
        })
    });
}, {
    displayName: 'InternalNester'
});
export { InternalNester };
