{
  "version": 3,
  "sources": ["../../../src/components/theme-support-check/index.js"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Checks if the current theme supports specific features and renders the children if supported.\n *\n * @param {Object}          props             The component props.\n * @param {React.ReactNode} props.children    The children to render if the theme supports the specified features.\n * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.\n *\n * @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null.\n */\nexport default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AAKnC,mBAAqC;AAWtB,SAAR,kBAAoC,EAAE,UAAU,YAAY,GAAI;AACtE,QAAM,EAAE,UAAU,cAAc,QAAI,uBAAW,CAAE,WAAY;AAC5D,WAAO;AAAA,MACN,UAAU,OAAQ,aAAAA,KAAY,EAAE,uBAAwB,MAAO;AAAA,MAC/D,eAAe,OAAQ,iBAAAC,KAAU,EAAE,iBAAiB;AAAA,IACrD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,eACL,MAAM,QAAS,WAAY,IAAI,cAAc,CAAE,WAAY,GAC1D,KAAM,CAAE,QAAS;AAClB,UAAM,YAAY,gBAAiB,GAAI,KAAK;AAK5C,QAAK,sBAAsB,OAAO,MAAM,QAAS,SAAU,GAAI;AAC9D,aAAO,UAAU,SAAU,QAAS;AAAA,IACrC;AACA,WAAO;AAAA,EACR,CAAE;AAEF,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
  "names": ["editorStore", "coreStore"]
}
