/**
 * 仅启用 remark-directive 的 **容器** 语法（`:::name` … `:::`），不解析行内 `:foo` 与块级 `::foo`。
 * 避免普通文本中的 `:15`（时间）或 `:icon[...]` 被误解析为指令。
 *
 * 依赖与 `remark-directive` 相同：`micromark-extension-directive` + `mdast-util-directive`。
 *
 * 仅使用官方入口 `directive()` 中与 `lib/syntax.js` 一致的 flow[58][0]（容器指令），
 * 避免深层路径 `lib/directive-container.js`（未列入 package exports，Next/Turbopack 等会解析失败）。
 */ 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;
}
import { directiveFromMarkdown, directiveToMarkdown } from "mdast-util-directive";
import { directive } from "micromark-extension-directive";
/** `:` — 与 micromark-extension-directive 内 `syntax.js` 中 flow/text 映射键一致 */ var MICROMARK_DIRECTIVE_MARK = 58;
var directiveContainerOnlyMicromarkExtension = function() {
    var _ext_flow;
    var ext = directive();
    var atColon = (_ext_flow = ext.flow) === null || _ext_flow === void 0 ? void 0 : _ext_flow[MICROMARK_DIRECTIVE_MARK];
    var container = Array.isArray(atColon) ? atColon[0] : atColon;
    if (!container) {
        throw new Error('micromark-extension-directive: expected container construct on flow[58]');
    }
    return {
        flow: _define_property({}, MICROMARK_DIRECTIVE_MARK, [
            container
        ])
    };
}();
/**
 * @returns {undefined}
 *   Nothing.
 */ var remarkDirectiveContainersOnly = function remarkDirectiveContainersOnly() {
    var data = this.data();
    var micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
    var fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
    var toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
    micromarkExtensions.push(directiveContainerOnlyMicromarkExtension);
    fromMarkdownExtensions.push(directiveFromMarkdown());
    toMarkdownExtensions.push(directiveToMarkdown());
};
export default remarkDirectiveContainersOnly;
