"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (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__, {
    BlockItem: ()=>BlockItem
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
require("react");
const schema_namespaceObject = require("@tachybase/schema");
const external_antd_style_namespaceObject = require("antd-style");
const external_classnames_namespaceObject = require("classnames");
var external_classnames_default = /*#__PURE__*/ __webpack_require__.n(external_classnames_namespaceObject);
const withDynamicSchemaProps_js_namespaceObject = require("../../../application/hoc/withDynamicSchemaProps.js");
const index_js_namespaceObject = require("../../common/index.js");
const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
const useGetAriaLabelOfBlockItem_js_namespaceObject = require("./hooks/useGetAriaLabelOfBlockItem.js");
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    position: relative;\n    &:hover {\n      > .general-schema-designer {\n        display: block;\n      }\n    }\n    &.tb-form-item:hover {\n      > .general-schema-designer {\n        background: var(--colorBgSettingsHover) !important;\n        border: 0 !important;\n        top: -5px !important;\n        bottom: -5px !important;\n        left: -5px !important;\n        right: -5px !important;\n      }\n    }\n    > .general-schema-designer {\n      position: absolute;\n      z-index: 999;\n      top: 0;\n      bottom: 0;\n      left: 0;\n      right: 0;\n      display: none;\n      border: 2px solid var(--colorBorderSettingsHover);\n      pointer-events: none;\n      > .general-schema-designer-icons {\n        position: absolute;\n        right: 2px;\n        top: 2px;\n        line-height: 16px;\n        pointer-events: all;\n        .ant-space-item {\n          background-color: var(--colorSettings);\n          color: #fff;\n          line-height: 16px;\n          width: 16px;\n          padding-left: 1px;\n          align-self: stretch;\n        }\n      }\n    }\n  "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
    let { css } = param;
    return css(_templateObject());
});
const BlockItem = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaProps)((props)=>{
    const { className, children } = (0, external_hooks_index_js_namespaceObject.useProps)(props);
    const { styles } = useStyles();
    const Designer = (0, external_hooks_index_js_namespaceObject.useDesigner)();
    const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
    const { getAriaLabel } = (0, useGetAriaLabelOfBlockItem_js_namespaceObject.useGetAriaLabelOfBlockItem)(props.name);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_js_namespaceObject.SortableItem, {
        role: "button",
        "aria-label": getAriaLabel(),
        className: external_classnames_default()('tb-block-item', className, styles),
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Designer, {
                ...fieldSchema['x-toolbar-props']
            }),
            children
        ]
    });
});
exports.BlockItem = __webpack_exports__.BlockItem;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
    "BlockItem"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
    value: true
});
