function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { useEditorStyleRegister } from "../../Hooks/useStyle";
var genStyle = function genStyle(token) {
    var _obj, _obj1;
    return _define_property({}, "".concat(token.componentCls), (_obj1 = {
        display: 'flex',
        flexDirection: 'column',
        height: '100%'
    }, _define_property(_obj1, "".concat(token.componentCls, "-actions"), {
        display: 'flex',
        justifyContent: 'flex-end',
        padding: '8px 0'
    }), _define_property(_obj1, "".concat(token.componentCls, "-content"), {
        position: 'relative',
        width: '100%',
        height: '100%'
    }), _define_property(_obj1, "".concat(token.componentCls, "-iframe"), {
        width: '100%',
        height: '100%',
        minHeight: '240px',
        border: 'none',
        background: '#fff'
    }), _define_property(_obj1, "".concat(token.componentCls, "-overlay"), (_obj = {
        position: 'absolute',
        inset: 0,
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        zIndex: 1
    }, _define_property(_obj, "&--loading", {
        background: 'rgba(255, 255, 255, 0.6)'
    }), _define_property(_obj, "&--error", {
        background: 'rgba(255, 245, 245, 0.6)',
        color: '#cb1e1e'
    }), _obj)), _define_property(_obj1, "".concat(token.componentCls, "-empty"), {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        height: '100%',
        minHeight: '240px',
        padding: '24px',
        textAlign: 'center'
    }), _obj1));
};
export function useHtmlPreviewStyle(prefixCls) {
    return useEditorStyleRegister('WorkspaceHtmlPreview', function(token) {
        var htmlPreviewToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(htmlPreviewToken)
        ];
    });
}
