import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["type", "children"]; import * as React from 'react'; import Icon from "./Icon"; var customCache = new Set(); function isValidCustomScriptUrl(scriptUrl) { return Boolean(typeof scriptUrl === 'string' && scriptUrl.length && !customCache.has(scriptUrl)); } function createScriptUrlElements(scriptUrls) { var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var currentScriptUrl = scriptUrls[index]; if (isValidCustomScriptUrl(currentScriptUrl)) { var script = document.createElement('script'); script.setAttribute('src', currentScriptUrl); script.setAttribute('data-namespace', currentScriptUrl); if (scriptUrls.length > index + 1) { script.onload = function () { createScriptUrlElements(scriptUrls, index + 1); }; script.onerror = function () { createScriptUrlElements(scriptUrls, index + 1); }; } customCache.add(currentScriptUrl); document.body.appendChild(script); } } export default function create() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var scriptUrl = options.scriptUrl, _options$extraCommonP = options.extraCommonProps, extraCommonProps = _options$extraCommonP === void 0 ? {} : _options$extraCommonP; /** * DOM API required. * Make sure in browser environment. * The Custom Icon will create a