"use strict";
/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps 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_platform"] = self["webpackChunknocode_platform"] || []).push([[1796],{

/***/ "./src/web/component/common/IconGenerator.less":
/*!*****************************************************!*\
  !*** ./src/web/component/common/IconGenerator.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\"] = ({\"icon_pop\":\"L4d1n3Co_icon_pop\",\"pop\":\"wDS8lVOy_pop\",\"pop_main\":\"pM5A9eK0_pop_main\",\"colors\":\"RHIwvsm9_colors\",\"icons\":\"+e5WT0CW_icons\",\"icon-item-f-style\":\"LUv9eLkI_icon-item-f-style\",\"icon-item-f-style-active\":\"FbkEq6b8_icon-item-f-style-active\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2NvbXBvbmVudC9jb21tb24vSWNvbkdlbmVyYXRvci5sZXNzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vbm9jb2RlLXBsYXRmb3JtLy4vc3JjL3dlYi9jb21wb25lbnQvY29tbW9uL0ljb25HZW5lcmF0b3IubGVzcz84MmE0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpblxuZXhwb3J0IGRlZmF1bHQge1wiaWNvbl9wb3BcIjpcIkw0ZDFuM0NvX2ljb25fcG9wXCIsXCJwb3BcIjpcIndEUzhsVk95X3BvcFwiLFwicG9wX21haW5cIjpcInBNNUE5ZUswX3BvcF9tYWluXCIsXCJjb2xvcnNcIjpcIlJISXd2c205X2NvbG9yc1wiLFwiaWNvbnNcIjpcIitlNVdUMENXX2ljb25zXCIsXCJpY29uLWl0ZW0tZi1zdHlsZVwiOlwiTFV2OWVMa0lfaWNvbi1pdGVtLWYtc3R5bGVcIixcImljb24taXRlbS1mLXN0eWxlLWFjdGl2ZVwiOlwiRmJrRXE2YjhfaWNvbi1pdGVtLWYtc3R5bGUtYWN0aXZlXCJ9OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/web/component/common/IconGenerator.less\n");

/***/ }),

/***/ "./src/web/component/common/TreeLeafIconSelector.less":
/*!************************************************************!*\
  !*** ./src/web/component/common/TreeLeafIconSelector.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\"] = ({\"pop\":\"js8Jd4ya_pop\",\"avatar\":\"coK+fk++_avatar\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2NvbXBvbmVudC9jb21tb24vVHJlZUxlYWZJY29uU2VsZWN0b3IubGVzcyIsIm1hcHBpbmdzIjoiO0FBQUE7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL25vY29kZS1wbGF0Zm9ybS8uL3NyYy93ZWIvY29tcG9uZW50L2NvbW1vbi9UcmVlTGVhZkljb25TZWxlY3Rvci5sZXNzPzEyNjciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luXG5leHBvcnQgZGVmYXVsdCB7XCJwb3BcIjpcImpzOEpkNHlhX3BvcFwiLFwiYXZhdGFyXCI6XCJjb0srZmsrK19hdmF0YXJcIn07Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/web/component/common/TreeLeafIconSelector.less\n");

/***/ }),

/***/ "./src/web/layout/designer/SaveTemplateModal.less":
/*!********************************************************!*\
  !*** ./src/web/layout/designer/SaveTemplateModal.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\"] = ({\"nocode-save-template-modal\":\"_6F96kUhg_nocode-save-template-modal\",\"nocode-save-template-modal-form-item-checkbox\":\"_1cAwLZM5_nocode-save-template-modal-form-item-checkbox\",\"nocode-save-template-modal-footer\":\"s2nsVvte_nocode-save-template-modal-footer\",\"nocode-save-template-modal-body\":\"+fqon2-X_nocode-save-template-modal-body\",\"nocode-save-template-upload-wrapper\":\"qz3PdAnC_nocode-save-template-upload-wrapper\",\"icon-selector\":\"lnxgyB0B_icon-selector\",\"nocode-save-template-upload-desc\":\"Pc+XS6pH_nocode-save-template-upload-desc\",\"checkbox-group\":\"ImKtv5OJ_checkbox-group\",\"checkbox\":\"dHGjNzbj_checkbox\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2xheW91dC9kZXNpZ25lci9TYXZlVGVtcGxhdGVNb2RhbC5sZXNzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vbm9jb2RlLXBsYXRmb3JtLy4vc3JjL3dlYi9sYXlvdXQvZGVzaWduZXIvU2F2ZVRlbXBsYXRlTW9kYWwubGVzcz8xYjY1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpblxuZXhwb3J0IGRlZmF1bHQge1wibm9jb2RlLXNhdmUtdGVtcGxhdGUtbW9kYWxcIjpcIl82Rjk2a1VoZ19ub2NvZGUtc2F2ZS10ZW1wbGF0ZS1tb2RhbFwiLFwibm9jb2RlLXNhdmUtdGVtcGxhdGUtbW9kYWwtZm9ybS1pdGVtLWNoZWNrYm94XCI6XCJfMWNBd0xaTTVfbm9jb2RlLXNhdmUtdGVtcGxhdGUtbW9kYWwtZm9ybS1pdGVtLWNoZWNrYm94XCIsXCJub2NvZGUtc2F2ZS10ZW1wbGF0ZS1tb2RhbC1mb290ZXJcIjpcInMybnNWdnRlX25vY29kZS1zYXZlLXRlbXBsYXRlLW1vZGFsLWZvb3RlclwiLFwibm9jb2RlLXNhdmUtdGVtcGxhdGUtbW9kYWwtYm9keVwiOlwiK2Zxb24yLVhfbm9jb2RlLXNhdmUtdGVtcGxhdGUtbW9kYWwtYm9keVwiLFwibm9jb2RlLXNhdmUtdGVtcGxhdGUtdXBsb2FkLXdyYXBwZXJcIjpcInF6M1BkQW5DX25vY29kZS1zYXZlLXRlbXBsYXRlLXVwbG9hZC13cmFwcGVyXCIsXCJpY29uLXNlbGVjdG9yXCI6XCJsbnhneUIwQl9pY29uLXNlbGVjdG9yXCIsXCJub2NvZGUtc2F2ZS10ZW1wbGF0ZS11cGxvYWQtZGVzY1wiOlwiUGMrWFM2cEhfbm9jb2RlLXNhdmUtdGVtcGxhdGUtdXBsb2FkLWRlc2NcIixcImNoZWNrYm94LWdyb3VwXCI6XCJJbUt0djVPSl9jaGVja2JveC1ncm91cFwiLFwiY2hlY2tib3hcIjpcImRIR2pOemJqX2NoZWNrYm94XCJ9OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/web/layout/designer/SaveTemplateModal.less\n");

/***/ }),

/***/ "./src/route/NocodeLink.tsx":
/*!**********************************!*\
  !*** ./src/route/NocodeLink.tsx ***!
  \**********************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __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\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/extends */ \"../../node_modules/@babel/runtime-corejs3/helpers/extends.js\"));\nvar _reactRouterDom = __webpack_require__(/*! react-router-dom */ \"../../node_modules/react-router-dom/index.js\");\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _urlUtil = __webpack_require__(/*! @/utils/urlUtil */ \"./src/utils/urlUtil.ts\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nvar NocodeLink = function NocodeLink(props) {\n  var children = props.children,\n    to = props.to;\n  var location = (0, _reactRouterDom.useLocation)();\n  var search = location.search;\n  var nocodeTo = to;\n  nocodeTo = (0, _urlUtil.urlParamWithDebug)(nocodeTo, search);\n  return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, (0, _extends2.default)({}, props, {\n    to: nocodeTo\n  }), children);\n};\nvar _default = exports[\"default\"] = (0, _react.memo)(NocodeLink);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvcm91dGUvTm9jb2RlTGluay50c3giLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFBQSIsInNvdXJjZXMiOlsid2VicGFjazovL25vY29kZS1wbGF0Zm9ybS8uL3NyYy9yb3V0ZS9Ob2NvZGVMaW5rLnRzeD80NGM4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IExpbmssIHVzZUxvY2F0aW9uIH0gZnJvbSAncmVhY3Qtcm91dGVyLWRvbSdcbmltcG9ydCBSZWFjdCwgeyBtZW1vIH0gZnJvbSAncmVhY3QnXG5pbXBvcnQgeyB1cmxQYXJhbVdpdGhEZWJ1ZyB9IGZyb20gJ0AvdXRpbHMvdXJsVXRpbCdcblxuY29uc3QgTm9jb2RlTGluayA9IChwcm9wcykgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCB0byB9ID0gcHJvcHNcbiAgY29uc3QgbG9jYXRpb24gPSB1c2VMb2NhdGlvbigpXG4gIGNvbnN0IHsgc2VhcmNoIH0gPSBsb2NhdGlvblxuICBsZXQgbm9jb2RlVG8gPSB0b1xuICBub2NvZGVUbyA9IHVybFBhcmFtV2l0aERlYnVnKG5vY29kZVRvLCBzZWFyY2gpXG4gIHJldHVybiA8TGluayB7Li4ucHJvcHN9IHRvPXtub2NvZGVUb30+e2NoaWxkcmVufTwvTGluaz5cbn1cblxuZXhwb3J0IGRlZmF1bHQgbWVtbyhOb2NvZGVMaW5rKVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/route/NocodeLink.tsx\n");

/***/ }),

/***/ "./src/web/component/common/IconGenerator.tsx":
/*!****************************************************!*\
  !*** ./src/web/component/common/IconGenerator.tsx ***!
  \****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __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\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _map = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js\"));\nvar _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/defineProperty.js\"));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js\"));\nvar _kdesign = __webpack_require__(/*! kd_libs/kdesign1 */ \"webpack/container/remote/kd_libs/kdesign1\");\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _IconGenerator = _interopRequireDefault(__webpack_require__(/*! ./IconGenerator.less */ \"./src/web/component/common/IconGenerator.less\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nvar IconGenerator = function IconGenerator(props) {\n  var _context, _context2;\n  var data = props.data,\n    colorIndexProps = props.colorIndex,\n    iconIndexProps = props.iconIndex,\n    onSelect = props.onSelect,\n    isLineIconStyle = props.isLineIconStyle;\n  var _useState = (0, _react.useState)(0),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    colorIndex = _useState2[0],\n    setColorIndex = _useState2[1];\n  var _useState3 = (0, _react.useState)(0),\n    _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n    iconIndex = _useState4[0],\n    setIconIndex = _useState4[1];\n  var iconsRef = (0, _react.useRef)(null);\n  (0, _react.useEffect)(function () {\n    setColorIndex(colorIndexProps);\n  }, [colorIndexProps]);\n  (0, _react.useEffect)(function () {\n    setIconIndex(iconIndexProps);\n  }, [iconIndexProps]);\n  // 点击图标动作\n  var handleClickIcon = (0, _react.useCallback)(function (colorIndex, iconIndex) {\n    setColorIndex(colorIndex);\n    setIconIndex(iconIndex);\n    onSelect === null || onSelect === void 0 || onSelect(colorIndex, iconIndex);\n  }, [onSelect, data]);\n\n  // 焦点样式切换\n  (0, _react.useLayoutEffect)(function () {\n    var _iconsRef$current;\n    var svgs = (_iconsRef$current = iconsRef.current) === null || _iconsRef$current === void 0 ? void 0 : _iconsRef$current.getElementsByTagName('path');\n    if (svgs) {\n      var _svgs$iconIndex, _svgs$iconIndex2;\n      Array.prototype.forEach.call(svgs, function (item) {\n        return item.removeAttribute('style');\n      });\n      isLineIconStyle ? (_svgs$iconIndex = svgs[iconIndex]) === null || _svgs$iconIndex === void 0 ? void 0 : _svgs$iconIndex.setAttribute('style', \"fill:\".concat(data === null || data === void 0 ? void 0 : data.colors[colorIndex].value)) : (_svgs$iconIndex2 = svgs[iconIndex]) === null || _svgs$iconIndex2 === void 0 ? void 0 : _svgs$iconIndex2.setAttribute('style', 'fill:#fff');\n    }\n  }, [iconIndex, colorIndex, iconsRef.current]);\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _IconGenerator.default.pop_main\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _IconGenerator.default.colors\n  }, data === null || data === void 0 ? void 0 : (0, _map.default)(_context = data.colors).call(_context, function (item, index) {\n    return /*#__PURE__*/_react.default.createElement(\"div\", {\n      key: index,\n      onClick: function onClick() {\n        return handleClickIcon(index, iconIndex);\n      },\n      style: {\n        backgroundColor: item.value\n      }\n    }, colorIndex === index && /*#__PURE__*/_react.default.createElement(_kdesign.Icon, {\n      prefix: \"nocodeplatformicon\",\n      type: \"gouxuan\"\n    }));\n  })), /*#__PURE__*/_react.default.createElement(\"div\", {\n    ref: iconsRef,\n    className: _IconGenerator.default.icons\n  }, data === null || data === void 0 ? void 0 : (0, _map.default)(_context2 = data.svgs).call(_context2, function (item, index) {\n    var iconColor = iconIndex === index ? data === null || data === void 0 ? void 0 : data.colors[colorIndex].value : '';\n    var bgColor = iconIndex === index ? '#fff' : '';\n    return /*#__PURE__*/_react.default.createElement(\"div\", {\n      key: index,\n      onClick: function onClick() {\n        return handleClickIcon(colorIndex, index);\n      },\n      className: (0, _classnames.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _IconGenerator.default['icon-item-f-style'], isLineIconStyle), _IconGenerator.default['icon-item-f-style-active'], isLineIconStyle && iconIndex === index)),\n      style: {\n        backgroundColor: isLineIconStyle ? bgColor : iconColor,\n        color: isLineIconStyle ? iconColor : bgColor\n      },\n      dangerouslySetInnerHTML: {\n        __html: item.content\n      }\n    });\n  })));\n};\nvar _default = exports[\"default\"] = _react.default.memo(IconGenerator);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/component/common/IconGenerator.tsx\n");

/***/ }),

/***/ "./src/web/component/common/TreeLeafIconSelector.tsx":
/*!***********************************************************!*\
  !*** ./src/web/component/common/TreeLeafIconSelector.tsx ***!
  \***********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __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\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _findIndex = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/find-index */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/find-index.js\"));\nvar _concat = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\"));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js\"));\nvar _kdesign = __webpack_require__(/*! kd_libs/kdesign1 */ \"webpack/container/remote/kd_libs/kdesign1\");\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _TreeLeafIconSelector = _interopRequireDefault(__webpack_require__(/*! ./TreeLeafIconSelector.less */ \"./src/web/component/common/TreeLeafIconSelector.less\"));\nvar _IconGenerator = _interopRequireDefault(__webpack_require__(/*! ./IconGenerator */ \"./src/web/component/common/IconGenerator.tsx\"));\nvar _utils = __webpack_require__(/*! @/utils */ \"./src/utils/index.tsx\");\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2023-06-27 11:01:34\n * @LastEditTime: 2023-06-30 13:59:15\n * @Last Modified by: jianhang_he\n */\n\n/**\n * 选择图标弹窗\n * @param {*} props\n * @param data {Object} 图标数据{colors,svgs}\n * @param current {Object} 当前选中的是哪一个{iconIndex, colorIndex}\n * @param update {Function} 用户选择完后的回调函数\n * */\nvar TreeLeafIconSelector = function TreeLeafIconSelector(props) {\n  var onChange = props.onChange,\n    image = props.image,\n    placement = props.placement,\n    triggerClassName = props.triggerClassName,\n    popperClassName = props.popperClassName,\n    isLineIconStyle = props.isLineIconStyle,\n    svgData = props.svgData,\n    readonly = props.readonly;\n  // const [svgData, setSvgData] = useState(null) // svg图标数据\n  var _useState = (0, _react.useState)({\n      colorIndex: undefined,\n      iconIndex: undefined\n    }),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    currentIcon = _useState2[0],\n    setCurrentIcon = _useState2[1]; // 当前图标数据\n  var iconComponent = (0, _react.useRef)(null); // 图标\n\n  // 确定当前应用图标位置\n  var setIndex = (0, _react.useCallback)(function (image, datas) {\n    var _datas$colors, _datas$svgs;\n    var color = (0, _utils.getQueryString)('color', image); // 图标背景颜色\n    var svg = (0, _utils.getQueryString)('svg', image); // 图标样式\n    var colorIndex = color && color !== 'undefined' ? datas === null || datas === void 0 || (_datas$colors = datas.colors) === null || _datas$colors === void 0 ? void 0 : (0, _findIndex.default)(_datas$colors).call(_datas$colors, function (item) {\n      return item.value === color || item.key === color;\n    }) : 0;\n    var iconIndex = svg && svg !== 'undefined' ? datas === null || datas === void 0 || (_datas$svgs = datas.svgs) === null || _datas$svgs === void 0 ? void 0 : (0, _findIndex.default)(_datas$svgs).call(_datas$svgs, function (item) {\n      return item.label === svg;\n    }) : 0;\n    setCurrentIcon({\n      colorIndex: colorIndex,\n      iconIndex: iconIndex\n    });\n  }, []);\n  var handleSelect = function handleSelect(colorIndex, iconIndex) {\n    setCurrentIcon({\n      colorIndex: colorIndex,\n      iconIndex: iconIndex\n    });\n  };\n\n  // SVG图标改成白色\n  (0, _react.useLayoutEffect)(function () {\n    var _svgData$colors, _iconComponent$curren;\n    if (!svgData || !iconComponent.current) return;\n    var svgFill = isLineIconStyle ? svgData === null || svgData === void 0 || (_svgData$colors = svgData.colors) === null || _svgData$colors === void 0 || (_svgData$colors = _svgData$colors[currentIcon.colorIndex]) === null || _svgData$colors === void 0 ? void 0 : _svgData$colors.value : '#fff';\n    (_iconComponent$curren = iconComponent.current.getElementsByTagName('path')) === null || _iconComponent$curren === void 0 || (_iconComponent$curren = _iconComponent$curren[0]) === null || _iconComponent$curren === void 0 || _iconComponent$curren.setAttribute('style', \"fill:\".concat(svgFill, \" \"));\n  }, [svgData, currentIcon, iconComponent.current, isLineIconStyle]);\n  (0, _react.useEffect)(function () {\n    setIndex(image, svgData);\n  }, [image, svgData]);\n\n  // 弹窗选择图标 ==> 更新到父节点\n  var handleOnChange = (0, _react.useCallback)(function (visible) {\n    if (visible) {\n      // getLineIconAndColor().then(res => {\n      //   const datas = res.row // 背景颜色及SVG\n      //   setSvgData(datas)\n      setIndex(image, svgData);\n      // })\n    } else {\n      var _svgData$colors2, _svgData$svgs, _context;\n      var color = encodeURIComponent(svgData === null || svgData === void 0 || (_svgData$colors2 = svgData.colors) === null || _svgData$colors2 === void 0 || (_svgData$colors2 = _svgData$colors2[currentIcon.colorIndex]) === null || _svgData$colors2 === void 0 ? void 0 : _svgData$colors2.value);\n      var icon = svgData === null || svgData === void 0 || (_svgData$svgs = svgData.svgs) === null || _svgData$svgs === void 0 ? void 0 : _svgData$svgs[currentIcon.iconIndex].label;\n      var url = (0, _concat.default)(_context = \"nocode/v2/nocode_sys/common/svgs/create_svg_line?color=\".concat(color, \"&svg=\")).call(_context, icon);\n      onChange === null || onChange === void 0 || onChange(url);\n    }\n  }, [svgData, currentIcon, onChange]);\n  var tip = (0, _react.useMemo)(function () {\n    return /*#__PURE__*/_react.default.createElement(_IconGenerator.default, {\n      data: svgData,\n      iconIndex: currentIcon.iconIndex,\n      colorIndex: currentIcon.colorIndex,\n      onSelect: handleSelect,\n      isLineIconStyle: isLineIconStyle\n    });\n  }, [svgData, currentIcon, isLineIconStyle]);\n\n  // 应用图标组件\n  var triggerElement = (0, _react.useMemo)(function () {\n    var _svgData$colors3, _svgData$svgs2;\n    return /*#__PURE__*/_react.default.createElement(\"div\", {\n      ref: iconComponent,\n      className: (0, _classnames.default)(_TreeLeafIconSelector.default.avatar, triggerClassName),\n      style: {\n        backgroundColor: isLineIconStyle ? '' : svgData === null || svgData === void 0 || (_svgData$colors3 = svgData.colors) === null || _svgData$colors3 === void 0 || (_svgData$colors3 = _svgData$colors3[currentIcon.colorIndex]) === null || _svgData$colors3 === void 0 ? void 0 : _svgData$colors3.value\n      },\n      dangerouslySetInnerHTML: {\n        __html: (svgData === null || svgData === void 0 || (_svgData$svgs2 = svgData.svgs) === null || _svgData$svgs2 === void 0 || (_svgData$svgs2 = _svgData$svgs2[currentIcon.iconIndex]) === null || _svgData$svgs2 === void 0 ? void 0 : _svgData$svgs2.content) || ''\n      }\n    });\n  }, [svgData, currentIcon, isLineIconStyle]);\n  if (readonly) {\n    return triggerElement;\n  }\n  return /*#__PURE__*/_react.default.createElement(_kdesign.Tooltip, {\n    placement: placement || 'rightTop',\n    arrow: false,\n    popperClassName: (0, _classnames.default)(_TreeLeafIconSelector.default.pop, popperClassName),\n    gap: 0,\n    tip: tip,\n    trigger: \"click\",\n    onVisibleChange: handleOnChange\n  }, triggerElement);\n};\nvar _default = exports[\"default\"] = _react.default.memo(TreeLeafIconSelector);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/component/common/TreeLeafIconSelector.tsx\n");

/***/ }),

/***/ "./src/web/layout/designer/SaveTemplateModal.jsx":
/*!*******************************************************!*\
  !*** ./src/web/layout/designer/SaveTemplateModal.jsx ***!
  \*******************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _Object$keys = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\nvar _Object$getOwnPropertySymbols = __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\");\nvar _filterInstanceProperty2 = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js\");\nvar _Object$getOwnPropertyDescriptor = __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\");\nvar _Object$getOwnPropertyDescriptors = __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\");\nvar _Object$defineProperties = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-properties */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = exports.INIT_TEMPLATE_VALUE = void 0;\nvar _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/regenerator */ \"../../node_modules/@babel/runtime-corejs3/regenerator/index.js\"));\nvar _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/extends */ \"../../node_modules/@babel/runtime-corejs3/helpers/extends.js\"));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/asyncToGenerator */ \"../../node_modules/@babel/runtime-corejs3/helpers/asyncToGenerator.js\"));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js\"));\nvar _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/toConsumableArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js\"));\nvar _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/defineProperty.js\"));\nvar _map = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js\"));\nvar _set = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/set.js\"));\nvar _concat = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\"));\nvar _filter = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js\"));\nvar _includes = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/includes */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js\"));\nvar _promise = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/promise */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/promise.js\"));\nvar _values = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/values */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/values.js\"));\nvar _trim = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/trim */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js\"));\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _kdesign = __webpack_require__(/*! kd_libs/kdesign1 */ \"webpack/container/remote/kd_libs/kdesign1\");\nvar _common = __webpack_require__(/*! @/actions/common */ \"./src/actions/common.js\");\nvar _WebUI = __webpack_require__(/*! nocode_component/WebUI */ \"webpack/container/remote/nocode_component/WebUI\");\nvar _SaveTemplateModal = _interopRequireDefault(__webpack_require__(/*! ./SaveTemplateModal.less */ \"./src/web/layout/designer/SaveTemplateModal.less\"));\nvar _TreeLeafIconSelector = _interopRequireDefault(__webpack_require__(/*! @/web/component/common/TreeLeafIconSelector */ \"./src/web/component/common/TreeLeafIconSelector.tsx\"));\nvar _home = __webpack_require__(/*! @/actions/home */ \"./src/actions/home.js\");\nvar _defaultIcon = __webpack_require__(/*! @/constants/defaultIcon */ \"./src/constants/defaultIcon.ts\");\nvar _reducer = __webpack_require__(/*! @/utils/reducer */ \"./src/utils/reducer.ts\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(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, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } // import PersonAuthorize from '@/web/component/permission/PersonAuthorize'\n// import OrgAuthorize from '@/web/component/permission/OrgAuthorize'\nvar PREFIX_CLS = 'nocode-save-template';\nvar getIds = function getIds(arr) {\n  return (0, _map.default)(arr).call(arr, function (item) {\n    return item.id;\n  });\n};\nvar INIT_TEMPLATE_VALUE = exports.INIT_TEMPLATE_VALUE = {\n  name: '',\n  desc: '',\n  icon: '',\n  domains: [],\n  trades: []\n};\nvar INIT_CHECKBOX_OPTIONS = {\n  domains: [],\n  trades: []\n};\nvar domainsAndTradesReducer = function domainsAndTradesReducer(state, newData) {\n  return _objectSpread(_objectSpread({}, state), newData);\n};\nvar CheckBoxGroupWithSelectAll = function CheckBoxGroupWithSelectAll(_ref) {\n  var value = _ref.value,\n    onChange = _ref.onChange,\n    options = _ref.options;\n  var handleCheckAll = function handleCheckAll(e) {\n    console.log('onChangeAll checked', e.target.checked);\n    var newValue;\n    if (e.target.checked) {\n      newValue = (0, _map.default)(options).call(options, function (domain) {\n        return domain.id;\n      });\n    } else {\n      newValue = [];\n    }\n    onChange === null || onChange === void 0 || onChange(newValue);\n  };\n  var handleCheck = function handleCheck(e, id) {\n    var _context;\n    var checked = e.target.checked;\n    var newValue = checked ? (0, _toConsumableArray2.default)(new _set.default((0, _concat.default)(_context = []).call(_context, (0, _toConsumableArray2.default)(value), [id]))) : (0, _filter.default)(value).call(value, function (k) {\n      return k !== id;\n    });\n    onChange === null || onChange === void 0 || onChange(newValue);\n  };\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _SaveTemplateModal.default['checkbox-group']\n  }, /*#__PURE__*/_react.default.createElement(_kdesign.Checkbox, {\n    className: _SaveTemplateModal.default.checkbox,\n    checked: value.length === options.length,\n    value: \"all\",\n    key: \"all\",\n    onChange: handleCheckAll\n  }, \"\\u5168\\u90E8\"), (0, _map.default)(options).call(options, function (op) {\n    return /*#__PURE__*/_react.default.createElement(_kdesign.Checkbox, {\n      className: _SaveTemplateModal.default.checkbox,\n      value: op.id,\n      key: op.id,\n      checked: (0, _includes.default)(value).call(value, op.id),\n      onChange: function onChange(e) {\n        return handleCheck(e, op.id);\n      }\n    }, op.name);\n  }));\n};\nvar ModalBody = (0, _react.forwardRef)(function (_ref2, ref) {\n  var prefixCls = _ref2.prefixCls,\n    value = _ref2.value,\n    svgData = _ref2.svgData;\n  var _Form$useForm = _kdesign.Form.useForm(),\n    _Form$useForm2 = (0, _slicedToArray2.default)(_Form$useForm, 1),\n    form = _Form$useForm2[0];\n  var _useReducer = (0, _react.useReducer)(domainsAndTradesReducer, INIT_CHECKBOX_OPTIONS),\n    _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),\n    checkboxOptions = _useReducer2[0],\n    dispatchCheckboxOptions = _useReducer2[1];\n  var _useReducer3 = (0, _react.useReducer)(_reducer.assignDataReducer, value || INIT_TEMPLATE_VALUE),\n    _useReducer4 = (0, _slicedToArray2.default)(_useReducer3, 2),\n    formData = _useReducer4[0],\n    dispatchFormData = _useReducer4[1];\n  (0, _react.useEffect)(function () {\n    initTradeAndDomainOptions();\n  }, []);\n\n  // 获取行业和领域数据\n  var initTradeAndDomainOptions = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {\n    var _yield$getTradesAndDo, _yield$getTradesAndDo2, rows, _ref4, _ref4$domains, domains, _ref5, _ref5$trades, trades;\n    return _regenerator.default.wrap(function _callee$(_context2) {\n      while (1) switch (_context2.prev = _context2.next) {\n        case 0:\n          _context2.prev = 0;\n          _context2.next = 3;\n          return (0, _common.getTradesAndDomains)();\n        case 3:\n          _yield$getTradesAndDo = _context2.sent;\n          _yield$getTradesAndDo2 = _yield$getTradesAndDo.rows;\n          rows = _yield$getTradesAndDo2 === void 0 ? [] : _yield$getTradesAndDo2;\n          _ref4 = rows[0] || {}, _ref4$domains = _ref4.domains, domains = _ref4$domains === void 0 ? [] : _ref4$domains;\n          _ref5 = rows[1] || {}, _ref5$trades = _ref5.trades, trades = _ref5$trades === void 0 ? [] : _ref5$trades;\n          dispatchCheckboxOptions({\n            domains: domains,\n            trades: trades\n          });\n          _context2.next = 14;\n          break;\n        case 11:\n          _context2.prev = 11;\n          _context2.t0 = _context2[\"catch\"](0);\n          console.log(_context2.t0);\n        case 14:\n        case \"end\":\n          return _context2.stop();\n      }\n    }, _callee, null, [[0, 11]]);\n  })), [dispatchCheckboxOptions]);\n  (0, _react.useImperativeHandle)(ref, function () {\n    return {\n      validateFields: validateFields\n    };\n  });\n  var validateFields = function validateFields() {\n    return new _promise.default(function (resolve, reject) {\n      form.validateFields().then(function (_ref6) {\n        var values = (0, _values.default)(_ref6);\n        resolve(values);\n      }).catch(function (e) {\n        return reject(e);\n      });\n    });\n  };\n  (0, _react.useEffect)(function () {\n    // 初始值回填\n    if (value) {\n      var name = value.name,\n        icon = value.icon,\n        trades = value.trades,\n        domains = value.domains,\n        desc = value.desc;\n      form.setFieldsValue({\n        name: name,\n        icon: icon || _defaultIcon.DEFAULT_FORM_IMAGE,\n        trades: getIds(trades),\n        domains: getIds(domains),\n        desc: desc\n      });\n    }\n  }, []);\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-body\")]\n  }, /*#__PURE__*/_react.default.createElement(_kdesign.Form, {\n    layout: \"vertical\",\n    form: form,\n    labelWidth: \"100%\",\n    wrapperWidth: \"100%\",\n    onValuesChange: function onValuesChange(changedValue, values) {\n      console.log('form', changedValue, values);\n    }\n  }, /*#__PURE__*/_react.default.createElement(_kdesign.Form.Item, {\n    label: \"\\u6A21\\u677F\\u540D\\u79F0\",\n    name: \"name\",\n    required: true,\n    validateTrigger: \"onBlur\",\n    rules: [{\n      required: true,\n      message: '请输入模板名称'\n    }, {\n      type: 'string',\n      validator: function validator(rule, value, callback, source, options) {\n        if (!(value !== null && value !== void 0 && (0, _trim.default)(value).call(value))) {\n          return [new Error('请输入模板名称')];\n        } else {\n          return [];\n        }\n      }\n    }]\n  }, /*#__PURE__*/_react.default.createElement(_kdesign.Input, {\n    type: \"text\",\n    value: formData.name,\n    borderType: \"bordered\",\n    size: \"large\",\n    placeholder: \"\\u8BF7\\u8F93\\u5165\\u6A21\\u677F\\u540D\\u79F0\",\n    maxLength: 50,\n    onChange: function onChange(e) {\n      dispatchFormData({\n        name: e.target.value\n      });\n    }\n  })), /*#__PURE__*/_react.default.createElement(_kdesign.Form.Item, {\n    label: \"\\u56FE\\u6807\",\n    name: \"icon\",\n    required: true,\n    validateTrigger: \"onBlur\"\n  }, /*#__PURE__*/_react.default.createElement(_TreeLeafIconSelector.default, {\n    isLineIconStyle: true,\n    placement: \"bottomLeft\",\n    triggerClassName: _SaveTemplateModal.default['icon-selector'],\n    svgData: svgData,\n    image: formData.icon || _defaultIcon.DEFAULT_FORM_IMAGE,\n    onChange: function onChange(url) {\n      form.setFieldValue('icon', url);\n      dispatchFormData({\n        icon: url\n      });\n    }\n  })), /*#__PURE__*/_react.default.createElement(_kdesign.Form.Item, {\n    label: \"\\u6A21\\u677F\\u63CF\\u8FF0\",\n    name: \"desc\",\n    validateTrigger: \"onBlur\"\n  }, /*#__PURE__*/_react.default.createElement(_WebUI.Textarea, {\n    size: \"large\",\n    value: formData.desc,\n    autoSize: {\n      minRows: 3,\n      maxRows: 3\n    },\n    borderType: \"bordered\",\n    placeholder: \"\\u8BF7\\u8F93\\u5165\\u6A21\\u677F\\u63CF\\u8FF0\",\n    onChange: function onChange(v) {\n      return dispatchFormData({\n        desc: v\n      });\n    },\n    maxLength: 255,\n    showCount: true\n  })), /*#__PURE__*/_react.default.createElement(_kdesign.Form.Item, {\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-form-item-checkbox\")],\n    label: \"\\u9886\\u57DF\",\n    name: \"domains\",\n    rules: [{\n      required: true,\n      message: '请选择领域'\n    }]\n  }, /*#__PURE__*/_react.default.createElement(CheckBoxGroupWithSelectAll, {\n    value: formData.domains,\n    options: checkboxOptions.domains,\n    onChange: function onChange(value) {\n      dispatchFormData({\n        domains: value\n      });\n      form.setFieldValue('domains', value);\n    }\n  })), /*#__PURE__*/_react.default.createElement(_kdesign.Form.Item, {\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-form-item-checkbox\")],\n    label: \"\\u884C\\u4E1A\",\n    name: \"trades\",\n    rules: [{\n      required: true,\n      message: '请选择行业'\n    }]\n  }, /*#__PURE__*/_react.default.createElement(CheckBoxGroupWithSelectAll, {\n    value: formData.trades,\n    options: checkboxOptions.trades,\n    onChange: function onChange(value) {\n      dispatchFormData({\n        trades: value\n      });\n      form.setFieldValue('trades', value);\n    }\n  }))));\n});\nvar ModalFooter = function ModalFooter(_ref7) {\n  var prefixCls = _ref7.prefixCls,\n    _ref7$confirmBtnProps = _ref7.confirmBtnProps,\n    confirmBtnProps = _ref7$confirmBtnProps === void 0 ? {} : _ref7$confirmBtnProps,\n    onCancel = _ref7.onCancel,\n    onConfirm = _ref7.onConfirm;\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-footer\")]\n  }, /*#__PURE__*/_react.default.createElement(_kdesign.Button, {\n    onClick: onCancel,\n    type: \"second\",\n    size: \"small\",\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-cancel-btn\")]\n  }, \"\\u53D6\\u6D88\"), /*#__PURE__*/_react.default.createElement(_kdesign.Button, (0, _extends2.default)({\n    type: \"primary\",\n    size: \"small\",\n    style: {\n      marginLeft: '12px'\n    },\n    onClick: onConfirm,\n    className: _SaveTemplateModal.default[\"\".concat(prefixCls, \"-modal-ok-btn\")]\n  }, confirmBtnProps), \"\\u786E\\u5B9A\"));\n};\nvar SaveTemplateModal = function SaveTemplateModal(_ref8) {\n  var title = _ref8.title,\n    value = _ref8.value,\n    visible = _ref8.visible,\n    setVisible = _ref8.setVisible,\n    onConfirm = _ref8.onConfirm,\n    confirmBtnProps = _ref8.confirmBtnProps;\n  var modalBodyRef = (0, _react.useRef)(null);\n  var _useState = (0, _react.useState)({}),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    svgData = _useState2[0],\n    setSvgData = _useState2[1];\n  var fetchSvgData = /*#__PURE__*/function () {\n    var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {\n      var _yield$getLineIconAnd, _yield$getLineIconAnd2, row;\n      return _regenerator.default.wrap(function _callee2$(_context3) {\n        while (1) switch (_context3.prev = _context3.next) {\n          case 0:\n            _context3.prev = 0;\n            _context3.next = 3;\n            return (0, _home.getLineIconAndColor)();\n          case 3:\n            _yield$getLineIconAnd = _context3.sent;\n            _yield$getLineIconAnd2 = _yield$getLineIconAnd.row;\n            row = _yield$getLineIconAnd2 === void 0 ? {} : _yield$getLineIconAnd2;\n            setSvgData(row);\n            _context3.next = 12;\n            break;\n          case 9:\n            _context3.prev = 9;\n            _context3.t0 = _context3[\"catch\"](0);\n            console.log(_context3.t0);\n          case 12:\n          case \"end\":\n            return _context3.stop();\n        }\n      }, _callee2, null, [[0, 9]]);\n    }));\n    return function fetchSvgData() {\n      return _ref9.apply(this, arguments);\n    };\n  }();\n  (0, _react.useEffect)(function () {\n    fetchSvgData();\n  }, []);\n\n  // 点击确定\n  var handleConfirm = function handleConfirm() {\n    var validateFields = modalBodyRef.current.validateFields;\n    validateFields().then(function (formData) {\n      var _formData = formData,\n        name = _formData.name;\n      formData = _objectSpread(_objectSpread({}, formData), {}, {\n        name: (0, _trim.default)(name).call(name)\n      });\n      setVisible(false);\n      // 外部需要传回调，则以外部回调为准\n      onConfirm === null || onConfirm === void 0 || onConfirm(formData);\n    }).catch(function (e) {\n      console.warn(e);\n    });\n  };\n\n  // 点击取消\n  var handleCancel = function handleCancel() {\n    setVisible(false);\n  };\n  return /*#__PURE__*/_react.default.createElement(_kdesign.Modal, {\n    mask: true,\n    visible: visible,\n    body: /*#__PURE__*/_react.default.createElement(ModalBody, {\n      prefixCls: PREFIX_CLS,\n      ref: modalBodyRef,\n      value: value,\n      svgData: svgData\n    }),\n    titleIcon: null,\n    className: _SaveTemplateModal.default[\"\".concat(PREFIX_CLS, \"-modal\")],\n    footer: /*#__PURE__*/_react.default.createElement(ModalFooter, {\n      prefixCls: PREFIX_CLS,\n      confirmBtnProps: confirmBtnProps,\n      onConfirm: handleConfirm,\n      onCancel: handleCancel\n    }),\n    maskClosable: false,\n    width: 480,\n    height: 830,\n    keyboard: false,\n    title: title || '保存为模板',\n    closable: true,\n    draggable: false,\n    destroyOnClose: true,\n    onCancel: handleCancel,\n    onOk: handleConfirm\n  });\n};\nvar _default = exports[\"default\"] = SaveTemplateModal;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/layout/designer/SaveTemplateModal.jsx\n");

/***/ })

}]);