"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunknocode_component"] = self["webpackChunknocode_component"] || []).push([[344],{

/***/ "./src/base/web/CodeEditor/index.less":
/*!********************************************!*\
  !*** ./src/base/web/CodeEditor/index.less ***!
  \********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"code_editor\":\"wutNrO3C_code_editor\"});\n\n//# sourceURL=webpack://nocode-component/./src/base/web/CodeEditor/index.less?");

/***/ }),

/***/ "./src/base/web/CodeEditor/CodeEditorField.tsx":
/*!*****************************************************!*\
  !*** ./src/base/web/CodeEditor/CodeEditorField.tsx ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-properties */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\n/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\");\n/* harmony import */ var kd_libs_react__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(kd_libs_react__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var kd_libs_codemirror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! kd_libs/codemirror */ \"webpack/container/remote/kd_libs/codemirror\");\n/* harmony import */ var kd_libs_codemirror__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(kd_libs_codemirror__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./index.less */ \"./src/base/web/CodeEditor/index.less\");\n/* harmony import */ var codemirror_addon_lint_lint_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! codemirror/addon/lint/lint.css */ \"../../node_modules/codemirror/addon/lint/lint.css\");\n/* harmony import */ var codemirror_addon_lint_lint_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_lint_lint_css__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var codemirror_addon_fold_foldgutter_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! codemirror/addon/fold/foldgutter.css */ \"../../node_modules/codemirror/addon/fold/foldgutter.css\");\n/* harmony import */ var codemirror_addon_fold_foldgutter_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_foldgutter_css__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var codemirror_addon_fold_foldcode_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! codemirror/addon/fold/foldcode.js */ \"../../node_modules/codemirror/addon/fold/foldcode.js\");\n/* harmony import */ var codemirror_addon_fold_foldcode_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_foldcode_js__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var codemirror_addon_fold_foldgutter_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! codemirror/addon/fold/foldgutter.js */ \"../../node_modules/codemirror/addon/fold/foldgutter.js\");\n/* harmony import */ var codemirror_addon_fold_foldgutter_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_foldgutter_js__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var codemirror_addon_fold_xml_fold_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! codemirror/addon/fold/xml-fold.js */ \"../../node_modules/codemirror/addon/fold/xml-fold.js\");\n/* harmony import */ var codemirror_addon_fold_xml_fold_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_xml_fold_js__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var codemirror_addon_fold_indent_fold_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! codemirror/addon/fold/indent-fold.js */ \"../../node_modules/codemirror/addon/fold/indent-fold.js\");\n/* harmony import */ var codemirror_addon_fold_indent_fold_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_indent_fold_js__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var codemirror_addon_fold_brace_fold__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! codemirror/addon/fold/brace-fold */ \"../../node_modules/codemirror/addon/fold/brace-fold.js\");\n/* harmony import */ var codemirror_addon_fold_brace_fold__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_brace_fold__WEBPACK_IMPORTED_MODULE_19__);\n/* harmony import */ var codemirror_addon_fold_markdown_fold_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! codemirror/addon/fold/markdown-fold.js */ \"../../node_modules/codemirror/addon/fold/markdown-fold.js\");\n/* harmony import */ var codemirror_addon_fold_markdown_fold_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_markdown_fold_js__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var codemirror_addon_fold_comment_fold_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! codemirror/addon/fold/comment-fold.js */ \"../../node_modules/codemirror/addon/fold/comment-fold.js\");\n/* harmony import */ var codemirror_addon_fold_comment_fold_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_fold_comment_fold_js__WEBPACK_IMPORTED_MODULE_21__);\n/* harmony import */ var codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! codemirror/addon/selection/active-line */ \"../../node_modules/codemirror/addon/selection/active-line.js\");\n/* harmony import */ var codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_22__);\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ \"../../node_modules/codemirror/lib/codemirror.css\");\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_23__);\n/* harmony import */ var codemirror_mode_javascript_javascript_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! codemirror/mode/javascript/javascript.js */ \"../../node_modules/codemirror/mode/javascript/javascript.js\");\n/* harmony import */ var codemirror_mode_javascript_javascript_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(codemirror_mode_javascript_javascript_js__WEBPACK_IMPORTED_MODULE_24__);\n/* harmony import */ var codemirror_theme_cobalt_css__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! codemirror/theme/cobalt.css */ \"../../node_modules/codemirror/theme/cobalt.css\");\n/* harmony import */ var codemirror_theme_cobalt_css__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(codemirror_theme_cobalt_css__WEBPACK_IMPORTED_MODULE_25__);\n/* harmony import */ var codemirror_theme_3024_day_css__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! codemirror/theme/3024-day.css */ \"../../node_modules/codemirror/theme/3024-day.css\");\n/* harmony import */ var codemirror_theme_3024_day_css__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(codemirror_theme_3024_day_css__WEBPACK_IMPORTED_MODULE_26__);\n/* harmony import */ var codemirror_theme_rubyblue_css__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! codemirror/theme/rubyblue.css */ \"../../node_modules/codemirror/theme/rubyblue.css\");\n/* harmony import */ var codemirror_theme_rubyblue_css__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(codemirror_theme_rubyblue_css__WEBPACK_IMPORTED_MODULE_27__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @/utils */ \"./src/utils/index.ts\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_29__);\n\n\n\n\n\n\n\n\n\n\nfunction ownKeys(e, r) { var t = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(e); if ((_babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default())) { var o = _babel_runtime_corejs3_core_js_stable_object_get_own_property_symbols__WEBPACK_IMPORTED_MODULE_3___default()(e); r && (o = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default()(o).call(o, function (r) { return _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default()(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(e, r, t[r]); }) : (_babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default()) ? _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_7___default()(e, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_6___default()(t)) : ownKeys(Object(t)).forEach(function (r) { _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_8___default()(e, r, _babel_runtime_corejs3_core_js_stable_object_get_own_property_descriptor__WEBPACK_IMPORTED_MODULE_5___default()(t, r)); }); } return e; }\n/*\n * @Description:\n * @Author: xiaoman_xie\n * @Date: 2024-04-21 22:19:41\n * @LastEditTime: 2024-06-20 19:24:31\n * @Last Modified by: xiaoman_xie\n */\n\n\n\n\n\n// 折叠高亮等 css\n\n\n\n\n\n\n\n\n\n\n// merge 对比的css\n// import 'codemirror/addon/merge/merge';\n\n\n\n// 主题 css\n\n\n\n\n\nvar CodeEditor = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.forwardRef)(function (props, ref) {\n  var value = props.value,\n    options = props.options,\n    className = props.className;\n  var editorRef = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.useRef)();\n  var id = (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.useMemo)(function () {\n    return (0,_utils__WEBPACK_IMPORTED_MODULE_28__.getRandomValues)();\n  }, []);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.useEffect)(function () {\n    var codeReadContainer = document.querySelector(\"#codeEditor\".concat(id));\n    editorRef.current = kd_libs_codemirror__WEBPACK_IMPORTED_MODULE_11___default().fromTextArea(codeReadContainer, _objectSpread({\n      extraKeys: {\n        Ctrl: 'autocomplete'\n      },\n      gutters: ['CodeMirror-foldgutter', 'CodeMirror-lint-markers'],\n      line: true,\n      autoCloseBrackets: true,\n      // 键入时自动关闭括号和引号\n      mode: 'application/json',\n      lineNumbers: false,\n      theme: 'cobalt',\n      styleActiveLine: !(options !== null && options !== void 0 && options.readOnly),\n      foldGutter: true,\n      foldOptions: {\n        widget: function widget(from, to) {\n          // 计算数组长度\n          // let count = ''\n\n          // let startToken = '{'\n          // let endToken = '}'\n          // const prevLine = editorRead.current.getLine(from.line)\n          // if (prevLine.lastIndexOf('[') > prevLine.lastIndexOf('{')) {\n          //   startToken = '['\n          //   endToken = ']'\n          // }\n\n          // Get json content\n          // const internal = editorRead.current.getRange(from, to)\n          // const toParse = startToken + internal + endToken\n          // // Get key count\n          // try {\n          //   const parsed = JSON.parse(toParse)\n          //   count = Object.keys(parsed).length\n          // } catch (e) {\n          //   //\n          // }\n          // return count ? `\\u21A4${count}\\u21A6` : '\\u2194'\n          return '...';\n        }\n      }\n    }, options));\n  }, [id]);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.useImperativeHandle)(ref, function () {\n    return {\n      getInstance: function getInstance() {\n        return editorRef.current;\n      }\n    };\n  }, []);\n  (0,kd_libs_react__WEBPACK_IMPORTED_MODULE_10__.useEffect)(function () {\n    var _editorRef$current, _editorRef$current$se;\n    (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 || (_editorRef$current$se = _editorRef$current.setValue) === null || _editorRef$current$se === void 0 || _editorRef$current$se.call(_editorRef$current, value);\n  }, [value]);\n  return /*#__PURE__*/kd_libs_react__WEBPACK_IMPORTED_MODULE_10___default().createElement(\"div\", {\n    className: classnames__WEBPACK_IMPORTED_MODULE_29___default()(_index_less__WEBPACK_IMPORTED_MODULE_12__[\"default\"].code_editor, className)\n  }, /*#__PURE__*/kd_libs_react__WEBPACK_IMPORTED_MODULE_10___default().createElement(\"textarea\", {\n    id: \"codeEditor\".concat(id)\n  }));\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (CodeEditor);\n\n//# sourceURL=webpack://nocode-component/./src/base/web/CodeEditor/CodeEditorField.tsx?");

/***/ })

}]);