UNPKG

@wordpress/block-library

Version:
1 lines • 23.4 kB
{"version":3,"file":"edit.cjs","names":["unlock","blockEditorPrivateApis","useSelect","blockEditorStore","useState","useEntityProp","useMemo","coreStore","useBlockProps","useBorderProps","getShadowClassesAndStyles","useBlockEditingMode","Placeholder","isBlobURL","useDispatch","noticesStore","useToolsPanelDropdownMenuProps","InspectorControls","OverlayControls","getDimensionResetAttributes","DimensionControls","ToolsPanel","__","ToolsPanelItem","sprintf","ToggleControl","TextControl","createInterpolateElement","ExternalLink","Overlay","MediaPlaceholder","Button","upload","WCSpinner","BlockControls","MediaReplaceFlow"],"sources":["../../src/post-featured-image/edit.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tToggleControl,\n\tPlaceholder,\n\tButton,\n\tSpinner as WCSpinner,\n\tTextControl,\n\tExternalLink,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tuseMemo,\n\tuseState,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport DimensionControls from './dimension-controls';\nimport OverlayControls from './overlay-controls';\nimport Overlay from './overlay';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\nimport { getDimensionResetAttributes } from '../utils/style-state';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst { ResolutionTool } = unlock( blockEditorPrivateApis );\n\nconst hasDimensionValue = ( value ) =>\n\tvalue !== undefined && value !== null && value !== '';\nconst DEFAULT_MEDIA_SIZE_SLUG = 'full';\n\nfunction FeaturedImageResolutionTool( { image, value, onChange } ) {\n\tconst { imageSizes } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\timageSizes: getSettings().imageSizes,\n\t\t};\n\t}, [] );\n\n\tif ( ! imageSizes?.length ) {\n\t\treturn null;\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\treturn (\n\t\t<ResolutionTool\n\t\t\tvalue={ value }\n\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\toptions={ imageSizeOptions }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst {\n\t\tisLink,\n\t\taspectRatio,\n\t\theight,\n\t\twidth,\n\t\tscale,\n\t\tsizeSlug,\n\t\trel,\n\t\tlinkTarget,\n\t\tuseFirstImageFromPost,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\n\tconst [ storedFeaturedImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\t// Fallback to post content if no featured image is set.\n\t// This is needed for the \"Use first image from post\" option.\n\tconst [ postContent ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst featuredImage = useMemo( () => {\n\t\tif ( storedFeaturedImage ) {\n\t\t\treturn storedFeaturedImage;\n\t\t}\n\n\t\tif ( ! useFirstImageFromPost ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageOpener =\n\t\t\t/<!--\\s+wp:(?:core\\/)?image\\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*)?}\\s+)?-->/.exec(\n\t\t\t\tpostContent\n\t\t\t);\n\t\tconst imageId =\n\t\t\timageOpener?.groups?.attrs &&\n\t\t\tJSON.parse( imageOpener.groups.attrs )?.id;\n\t\treturn imageId;\n\t}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );\n\n\tconst {\n\t\tmedia,\n\t\tpostType,\n\t\tpostPermalink,\n\t\tselectedStyleState,\n\t\thasSelectedStyleState,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getPostType, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getSelectedBlockStyleState, hasSelectedBlockStyleState } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetEntityRecord( 'postType', 'attachment', featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t\tpostPermalink: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\tpostId\n\t\t\t\t)?.link,\n\t\t\t\tselectedStyleState: getSelectedBlockStyleState( clientId ),\n\t\t\t\thasSelectedStyleState: hasSelectedBlockStyleState( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, featuredImage, postTypeSlug, postId ]\n\t);\n\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ||\n\t\tmedia?.source_url;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t'is-transient': temporaryURL,\n\t\t} ),\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst aspectRatioStyle = aspectRatio === 'auto' ? undefined : aspectRatio;\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-media-placeholder',\n\t\t\t\t\tborderProps.className\n\t\t\t\t) }\n\t\t\t\twithIllustration\n\t\t\t\tstyle={ {\n\t\t\t\t\taspectRatio: aspectRatioStyle,\n\t\t\t\t\theight: hasDimensionValue( height )\n\t\t\t\t\t\t? height\n\t\t\t\t\t\t: hasDimensionValue( width ) && 'auto',\n\t\t\t\t\twidth: hasDimensionValue( width )\n\t\t\t\t\t\t? width\n\t\t\t\t\t\t: !! aspectRatio && '100%',\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\n\t\tif ( value?.url && isBlobURL( value.url ) ) {\n\t\t\tsetTemporaryURL( value.url );\n\t\t}\n\t};\n\n\t// On reset image\n\tconst onResetImage = () => {\n\t\tsetAttributes( {\n\t\t\tisLink: false,\n\t\t\tlinkTarget: '_self',\n\t\t\trel: '',\n\t\t\tsizeSlug: undefined,\n\t\t} );\n\t\tsetFeaturedImage( 0 );\n\t};\n\n\t// Reset temporary url when media is available.\n\tif ( mediaUrl && temporaryURL ) {\n\t\tsetTemporaryURL();\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = blockEditingMode === 'default' && (\n\t\t<>\n\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t<OverlayControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tresetAllFilter={ ( attrs ) => {\n\t\t\t\t\treturn getDimensionResetAttributes( {\n\t\t\t\t\t\tattributes: attrs,\n\t\t\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\t\t\thasSelectedStyleState,\n\t\t\t\t\t\tkeys: [ 'aspectRatio', 'height', 'objectFit', 'width' ],\n\t\t\t\t\t\tdefaultAttributes: {\n\t\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t\tscale: undefined,\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<DimensionControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tmedia={ media }\n\t\t\t\t\tselectedStyleState={ selectedStyleState }\n\t\t\t\t\thasSelectedStyleState={ hasSelectedStyleState }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ ( featuredImage || isDescendentOfQueryLoop || ! postId ) && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t\t\tsizeSlug: DEFAULT_MEDIA_SIZE_SLUG,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels?.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! isLink }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Make image a link' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => '_self' !== linkTarget }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tlinkTarget: value\n\t\t\t\t\t\t\t\t\t\t\t\t? '_blank'\n\t\t\t\t\t\t\t\t\t\t\t\t: '_self',\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Link relation' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Link relation' ) }\n\t\t\t\t\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document.'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel\" />\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! media && (\n\t\t\t\t\t\t\t<FeaturedImageResolutionTool\n\t\t\t\t\t\t\t\timage={ media }\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\tonChange={ ( nextSizeSlug ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { sizeSlug: nextSizeSlug } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n\n\tlet image;\n\n\t/**\n\t * A Post Featured Image block should not have image replacement\n\t * or upload options in the following cases:\n\t * - Is placed in a Query Loop. This is a conscious decision to\n\t * prevent content editing of different posts in Query Loop, and\n\t * this could change in the future.\n\t * - Is in a context where it does not have a postId (for example\n\t * in a template or template part).\n\t */\n\tif ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplaceholder()\n\t\t\t\t\t) }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\tconst imageStyles = {\n\t\t...borderProps.style,\n\t\t...shadowProps.style,\n\t\taspectRatio: aspectRatioStyle,\n\t\theight: hasDimensionValue( height )\n\t\t\t? height\n\t\t\t: hasDimensionValue( width ) && 'auto',\n\t\twidth: hasDimensionValue( width ) ? width : !! aspectRatio && '100%',\n\t\tobjectFit: !! ( height || aspectRatio ) && scale,\n\t};\n\n\t/**\n\t * When the post featured image block is placed in a context where:\n\t * - It has a postId (for example in a single post)\n\t * - It is not inside a query loop\n\t * - It has no image assigned yet\n\t * Then display the placeholder with the image upload option.\n\t */\n\tif ( ! featuredImage && ! temporaryURL ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage =\n\t\t\t! media && ! temporaryURL ? (\n\t\t\t\tplaceholder()\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\tsrc={ temporaryURL || mediaUrl }\n\t\t\t\t\t\talt={\n\t\t\t\t\t\t\tmedia && media?.alt_text\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ temporaryURL && <WCSpinner /> }\n\t\t\t\t</>\n\t\t\t);\n\t}\n\n\t/**\n\t * When the post featured image block:\n\t * - Has an image assigned\n\t * - Is not inside a query loop\n\t * Then display the image and the image replacement option.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ ! temporaryURL && controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\tonReset={ onResetImage }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /* Wrap the image in an <a> to pick up the theme's inherited link styles. Never wrap the placeholder, since its buttons must not sit inside an anchor. */ }\n\t\t\t\t{ !! isLink && ( featuredImage || temporaryURL ) ? (\n\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t{ image }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\timage\n\t\t\t\t) }\n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