"use strict";
(globalThis["webpackChunkcore_nga"] = globalThis["webpackChunkcore_nga"] || []).push([["205"], {
521: (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___namespace_cache;
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
  "default": () => (NgAuthorComments)
});
/* ESM import */var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(893);
/* ESM import */var react_compiler_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(827);
/* ESM import */var _mdx_js_mdx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(488);
/* ESM import */var _mdx_js_mdx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(233);
/* ESM import */var react_error_boundary__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(780);
/* ESM import */var unist_util_visit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(386);






function NgAuthorComments(props) {
    const $ = (0,react_compiler_runtime__WEBPACK_IMPORTED_MODULE_1__.c)(10);
    const extData = props.game.extData?.nga;
    const comments = extData?.author_comments;
    let content;
    if (comments) {
        let t0;
        if ($[0] !== comments) {
            t0 = (0,_mdx_js_mdx__WEBPACK_IMPORTED_MODULE_2__/* .compileSync */.d)(comments, {
                outputFormat: "function-body",
                rehypePlugins: [
                    rehypeTargetBlank
                ]
            });
            $[0] = comments;
            $[1] = t0;
        } else {
            t0 = $[1];
        }
        const code = String(t0);
        let t1;
        if ($[2] !== code) {
            t1 = (0,_mdx_js_mdx__WEBPACK_IMPORTED_MODULE_3__/* .runSync */.W)(code, {
                .../*#__PURE__*/ (react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__, 2))),
                baseUrl: "https://newgrounds.com"
            });
            $[2] = code;
            $[3] = t1;
        } else {
            t1 = $[3];
        }
        const { default: MDXContent } = t1;
        let t2;
        if ($[4] !== MDXContent) {
            t2 = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_error_boundary__WEBPACK_IMPORTED_MODULE_4__/* .ErrorBoundary */.SV, {
                fallbackRender: _temp,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXContent, {})
            });
            $[4] = MDXContent;
            $[5] = t2;
        } else {
            t2 = $[5];
        }
        content = t2;
    } else {
        let t0;
        if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
            t0 = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
                children: "No Author Comments"
            });
            $[6] = t0;
        } else {
            t0 = $[6];
        }
        content = t0;
    }
    let t0;
    if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
        t0 = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
            children: "NG Author Comments:"
        });
        $[7] = t0;
    } else {
        t0 = $[7];
    }
    let t1;
    if ($[8] !== content) {
        t1 = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: "browse-right-sidebar__row",
            children: [
                t0,
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
                    className: "ng-author-comments",
                    children: content
                })
            ]
        });
        $[8] = content;
        $[9] = t1;
    } else {
        t1 = $[9];
    }
    return t1;
}
function _temp(t0) {
    const { error } = t0;
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: `Error rendering author comments: ${error}`
    });
}
const rehypeTargetBlank = ()=>{
    return (tree)=>{
        (0,unist_util_visit__WEBPACK_IMPORTED_MODULE_5__/* .visit */.Vn)(tree, 'mdxJsxTextElement', (node)=>{
            if (node.name === 'a') {
                const hrefAttr = node.attributes.find((a)=>a.type === 'mdxJsxAttribute' && a.name === 'href');
                if (hrefAttr) {
                    node.attributes = [
                        hrefAttr,
                        {
                            type: 'mdxJsxAttribute',
                            name: 'target',
                            value: '_blank'
                        },
                        {
                            type: 'mdxJsxAttribute',
                            name: 'rel',
                            value: 'noopener noreferrer'
                        }
                    ];
                }
            }
        });
    };
};


}),

}]);