"use strict";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}import{Node}from"@meonode/ui";import{extendTheme}from"@mui/material/styles";// --- Global type sentinel ---------------------------------------
// --- Theme detection --------------------------------------------
var memoizedReferenceThemeKeys=null;function getReferenceThemeKeys(){if(null===memoizedReferenceThemeKeys){var a=extendTheme();memoizedReferenceThemeKeys=Object.keys(a)}return memoizedReferenceThemeKeys}export function isProbablyMuiTheme(a){if("object"!==_typeof(a)||null===a)return!1;var b=getReferenceThemeKeys(),c=Object.keys(a),d=c.filter(function(a){return b.includes(a)}),e=d.length/b.length;// Must share at least 3 keys AND 25% similarity
return 3<=d.length&&.25<=e}// --- Types ------------------------------------------------------
/**
 * Factory for Material-UI components.
 * @template InitialProperties Initial/Extra props baked in when creating the factory.
 * @template TypeMap The OverridableTypeMap of the MUI component.
 * @template DefaultComponent The default underlying element of the MUI component.
 *//**
 * Factory for generic React elements.
 * @template InitialProperties Initial/Extra props baked in when creating the factory.
 * @template Element The React element type.
 */// --- Overloads --------------------------------------------------
/**
 * Create node factory for a Material-UI OverridableComponent.
 *//**
 * Create node factory for a generic React element.
 */// --- Implementation --------------------------------------------
export default function createMuiNode(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=function Instance(){var c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},d=_objectSpread(_objectSpread({},b),c);return isProbablyMuiTheme(null===d||void 0===d?void 0:d.theme)||(d.nodetheme=d.theme,delete d.theme),Node(a,d)};return c.element=a,c}export{createMuiNode};