{"version":3,"file":"elementAcceptingRef.mjs","sources":["../../../../../../../../../node_modules/@mui/utils/esm/elementAcceptingRef/elementAcceptingRef.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport chainPropTypes from \"../chainPropTypes/index.js\";\nfunction isClassComponent(elementType) {\n  // elementType.prototype?.isReactComponent\n  const {\n    prototype = {}\n  } = elementType;\n  return Boolean(prototype.isReactComponent);\n}\nfunction acceptingRef(props, propName, componentName, location, propFullName) {\n  const element = props[propName];\n  const safePropName = propFullName || propName;\n  if (element == null ||\n  // When server-side rendering React doesn't warn either.\n  // This is not an accurate check for SSR.\n  // This is only in place for Emotion compat.\n  // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.\n  typeof window === 'undefined') {\n    return null;\n  }\n  let warningHint;\n  const elementType = element.type;\n  /**\n   * Blacklisting instead of whitelisting\n   *\n   * Blacklisting will miss some components, such as React.Fragment. Those will at least\n   * trigger a warning in React.\n   * We can't whitelist because there is no safe way to detect React.forwardRef\n   * or class components. \"Safe\" means there's no public API.\n   *\n   */\n  if (typeof elementType === 'function' && !isClassComponent(elementType)) {\n    warningHint = 'Did you accidentally use a plain function component for an element instead?';\n  }\n  if (warningHint !== undefined) {\n    return new Error(`Invalid ${location} \\`${safePropName}\\` supplied to \\`${componentName}\\`. ` + `Expected an element that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');\n  }\n  return null;\n}\nconst elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef);\nelementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef);\nexport default elementAcceptingRef;"],"names":["isClassComponent"],"mappings":";;;AAEA,SAASA,kBAAgB,CAAC,WAAW,EAAE;AACvC;AACA,EAAE,MAAM;AACR,IAAI,SAAS,GAAG;AAChB,GAAG,GAAG,WAAW;AACjB,EAAE,OAAO,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAC5C;AACA,SAAS,YAAY,CAAC,KAAK,EAAE,Q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