Fix File
•
/
home
/
sportsfe...
/
httpdocs
/
clone
/
wp-inclu...
/
js
/
dist
•
File:
block-library.js
•
Content:
/* harmony default export */ const comment_edit_link = (commentEditLink); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ function comment_edit_link_edit_Edit({ attributes: { linkTarget, textAlign }, setAttributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#edit-comment-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_edit_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-edit-link", title: "Comment Edit Link", category: "theme", ancestor: ["core/comment-template"], description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", textdomain: "default", usesContext: ["commentId"], attributes: { linkTarget: { type: "string", "default": "_self" }, textAlign: { type: "string" } }, supports: { html: false, color: { link: true, gradients: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comment_edit_link_name } = comment_edit_link_metadata; const comment_edit_link_settings = { icon: comment_edit_link, edit: comment_edit_link_edit_Edit }; const comment_edit_link_init = () => initBlock({ name: comment_edit_link_name, metadata: comment_edit_link_metadata, settings: comment_edit_link_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js /** * WordPress dependencies */ const commentReplyLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) }); /* harmony default export */ const comment_reply_link = (commentReplyLink); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Renders the `core/comment-reply-link` block on the editor. * * @param {Object} props React props. * @param {Object} props.setAttributes Callback for updating block attributes. * @param {Object} props.attributes Block attributes. * @param {string} props.attributes.textAlign The `textAlign` attribute. * * @return {JSX.Element} React element. */ function comment_reply_link_edit_Edit({ setAttributes, attributes: { textAlign } }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#comment-reply-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_i18n_namespaceObject.__)('Reply') }) })] }); } /* harmony default export */ const comment_reply_link_edit = (comment_reply_link_edit_Edit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_reply_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-reply-link", title: "Comment Reply Link", category: "theme", ancestor: ["core/comment-template"], description: "Displays a link to reply to a comment.", textdomain: "default", usesContext: ["commentId"], attributes: { textAlign: { type: "string" } }, supports: { color: { gradients: true, link: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, html: false } }; const { name: comment_reply_link_name } = comment_reply_link_metadata; const comment_reply_link_settings = { edit: comment_reply_link_edit, icon: comment_reply_link }; const comment_reply_link_init = () => initBlock({ name: comment_reply_link_name, metadata: comment_reply_link_metadata, settings: comment_reply_link_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js /** * WordPress dependencies */ const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_layout = (layout); ;// CONCATENATED MODULE: external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js /** * WordPress dependencies */ // This is limited by WP REST API const MAX_COMMENTS_PER_PAGE = 100; /** * Return an object with the query args needed to fetch the default page of * comments. * * @param {Object} props Hook props. * @param {number} props.postId ID of the post that contains the comments. * discussion settings. * * @return {Object} Query args to retrieve the comments. */ const useCommentQueryArgs = ({ postId }) => { // Initialize the query args that are not going to change. const queryArgs = { status: 'approve', order: 'asc', context: 'embed', parent: 0, _embed: 'children' }; // Get the Discussion settings that may be needed to query the comments. const { pageComments, commentsPerPage, defaultCommentsPage: defaultPage } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings; }); // WP REST API doesn't allow fetching more than max items limit set per single page of data. // As for the editor performance is more important than completeness of data and fetching only the // max allowed for single page should be enough for the purpose of design and laying out the page. // Fetching over the limit would return an error here but would work with backend query. const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page. const page = useDefaultPageIndex({ defaultPage, postId, perPage, queryArgs }); // Merge, memoize and return all query arguments, unless the default page's // number is not known yet. return (0,external_wp_element_namespaceObject.useMemo)(() => { return page ? { ...queryArgs, post: postId, per_page: perPage, page } : null; }, [postId, perPage, page]); }; /** * Return the index of the default page, depending on whether `defaultPage` is * `newest` or `oldest`. In the first case, the only way to know the page's * index is by using the `X-WP-TotalPages` header, which forces to make an * additional request. * * @param {Object} props Hook props. * @param {string} props.defaultPage Page shown by default (newest/oldest). * @param {number} props.postId ID of the post that contains the comments. * @param {number} props.perPage The number of comments included per page. * @param {Object} props.queryArgs Other query args. * * @return {number} Index of the default comments page. */ const useDefaultPageIndex = ({ defaultPage, postId, perPage, queryArgs }) => { // Store the default page indices. const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({}); const key = `${postId}_${perPage}`; const page = defaultPages[key] || 0; (0,external_wp_element_namespaceObject.useEffect)(() => { // Do nothing if the page is already known or not the newest page. if (page || defaultPage !== 'newest') { return; } // We need to fetch comments to know the index. Use HEAD and limit // fields just to ID, to make this call as light as possible. external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs, post: postId, per_page: perPage, _fields: 'id' }), method: 'HEAD', parse: false }).then(res => { const pages = parseInt(res.headers.get('X-WP-TotalPages')); setDefaultPages({ ...defaultPages, [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page. }); }); }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one. return defaultPage === 'newest' ? page : 1; }; /** * Generate a tree structure of comment IDs from a list of comment entities. The * children of each comment are obtained from `_embedded`. * * @typedef {{ commentId: number, children: CommentNode }} CommentNode * * @param {Object[]} topLevelComments List of comment entities. * @return {{ commentTree: CommentNode[]}} Tree of comment IDs. */ const useCommentTree = topLevelComments => { const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments?.map(({ id, _embedded }) => { const [children] = _embedded?.children || [[]]; return { commentId: id, children: children.map(child => ({ commentId: child.id })) }; }), [topLevelComments]); return commentTree; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; /** * Function that returns a comment structure that will be rendered with default placehoders. * * Each comment has a `commentId` property that is always a negative number in * case of the placeholders. This is to ensure that the comment does not * conflict with the actual (real) comments. * * @param {Object} settings Discussion Settings. * @param {number} [settings.perPage] - Comments per page setting or block attribute. * @param {boolean} [settings.pageComments] - Enable break comments into pages setting. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments. * * @typedef {{id: null, children: EmptyComment[]}} EmptyComment * @return {EmptyComment[]} Inner blocks of the Comment Template */ const getCommentsPlaceholder = ({ perPage, pageComments, threadComments, threadCommentsDepth }) => { // Limit commentsDepth to 3 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); const buildChildrenComment = commentsLevel => { // Render children comments until commentsDepth is reached if (commentsLevel < commentsDepth) { const nextLevel = commentsLevel + 1; return [{ commentId: -(commentsLevel + 3), children: buildChildrenComment(nextLevel) }]; } return []; }; // Add the first comment and its children const placeholderComments = [{ commentId: -1, children: buildChildrenComment(1) }]; // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max if ((!pageComments || perPage >= 2) && commentsDepth < 3) { placeholderComments.push({ commentId: -2, children: [] }); } // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments if ((!pageComments || perPage >= 3) && commentsDepth < 2) { placeholderComments.push({ commentId: -3, children: [] }); } // In case that the value is set but larger than 3 we truncate it to 3. return placeholderComments; }; /** * Component which renders the inner blocks of the Comment Template. * * @param {Object} props Component props. * @param {Array} [props.comment] - A comment object. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. * @param {Array} [props.firstCommentId] - ID of the first comment in the array. * @param {Array} [props.blocks] - Array of blocks returned from * getBlocks() in parent . * @return {Element} Inner blocks of the Comment Template */ function CommentTemplateInnerBlocks({ comment, activeCommentId, setActiveCommentId, firstCommentId, blocks }) { const { children, ...innerBlocksProps } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, { template: edit_TEMPLATE }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { ...innerBlocksProps, children: [comment.commentId === (activeCommentId || firstCommentId) ? children : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedCommentTemplatePreview, { blocks: blocks, commentId: comment.commentId, setActiveCommentId: setActiveCommentId, isHidden: comment.commentId === (activeCommentId || firstCommentId) }), comment?.children?.length > 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { comments: comment.children, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, blocks: blocks, firstCommentId: firstCommentId }) : null] }); } const CommentTemplatePreview = ({ blocks, commentId, setActiveCommentId, isHidden }) => { const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ blocks }); const handleOnClick = () => { setActiveCommentId(commentId); }; // We have to hide the preview block if the `comment` props points to // the curently active block! // Or, to put it differently, every preview block is visible unless it is the // currently active block - in this case we render its inner blocks. const style = { display: isHidden ? 'none' : undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockPreviewProps, tabIndex: 0, role: "button", style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role , onClick: handleOnClick, onKeyPress: handleOnClick }); }; const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview); /** * Component that renders a list of (nested) comments. It is called recursively. * * @param {Object} props Component props. * @param {Array} [props.comments] - Array of comment objects. * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent. * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of * comment objects. * @return {Element} List of comments. */ const CommentsList = ({ comments, blockProps, activeCommentId, setActiveCommentId, blocks, firstCommentId }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { ...blockProps, children: comments && comments.map(({ commentId, ...comment }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: { // If the commentId is negative it means that this comment is a // "placeholder" and that the block is most likely being used in the // site editor. In this case, we have to set the commentId to `null` // because otherwise the (non-existent) comment with a negative ID // would be reqested from the REST API. commentId: commentId < 0 ? null : commentId }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentTemplateInnerBlocks, { comment: { commentId, ...comment }, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, blocks: blocks, firstCommentId: firstCommentId }) }, comment.commentId || index)) }); function CommentTemplateEdit({ clientId, context: { postId } }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)(); const { commentOrder, threadCommentsDepth, threadComments, commentsPerPage, pageComments } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings().__experimentalDiscussionSettings; }); const commentQuery = useCommentQueryArgs({ postId }); const { topLevelComments, blocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); return { // Request only top-level comments. Replies are embedded. topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null, blocks: getBlocks(clientId) }; }, [clientId, commentQuery]); // Generate a tree structure of comment IDs. let commentTree = useCommentTree( // Reverse the order of top comments if needed. commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments); if (!topLevelComments) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } if (!postId) { commentTree = getCommentsPlaceholder({ perPage: commentsPerPage, pageComments, threadComments, threadCommentsDepth }); } if (!commentTree.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: (0,external_wp_i18n_namespaceObject.__)('No results found.') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { comments: commentTree, blockProps: blockProps, blocks: blocks, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, firstCommentId: commentTree[0]?.commentId }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/save.js /** * WordPress dependencies */ function CommentTemplateSave() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_template_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-template", title: "Comment Template", category: "design", parent: ["core/comments"], description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", textdomain: "default", usesContext: ["postId"], supports: { align: true, html: false, reusable: false, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-comment-template" }; const { name: comment_template_name } = comment_template_metadata; const comment_template_settings = { icon: library_layout, edit: CommentTemplateEdit, save: CommentTemplateSave }; const comment_template_init = () => initBlock({ name: comment_template_name, metadata: comment_template_metadata, settings: comment_template_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js /** * WordPress dependencies */ const queryPaginationPrevious = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" }) }); /* harmony default export */ const query_pagination_previous = (queryPaginationPrevious); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js /** * WordPress dependencies */ const arrowMap = { none: '', arrow: '←', chevron: '«' }; function CommentsPaginationPreviousEdit({ attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } }) { const displayArrow = arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#comments-pagination-previous-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`, children: displayArrow }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_previous_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-previous", title: "Comments Previous Page", category: "theme", parent: ["core/comments-pagination"], description: "Displays the previous comment's page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["postId", "comments/paginationArrow"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_previous_name } = comments_pagination_previous_metadata; const comments_pagination_previous_settings = { icon: query_pagination_previous, edit: CommentsPaginationPreviousEdit }; const comments_pagination_previous_init = () => initBlock({ name: comments_pagination_previous_name, metadata: comments_pagination_previous_metadata, settings: comments_pagination_previous_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js /** * WordPress dependencies */ const queryPagination = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" }) }); /* harmony default export */ const query_pagination = (queryPagination); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js /** * WordPress dependencies */ function CommentsPaginationArrowControls({ value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), value: value, onChange: onChange, help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "none", label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "arrow", label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "chevron", label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks') })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']]; function QueryPaginationEdit({ attributes: { paginationArrow }, setAttributes, clientId }) { const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); const innerBlocks = getBlocks(clientId); /** * Show the `paginationArrow` control only if a * Comments Pagination Next or Comments Pagination Previous * block exists. */ return innerBlocks?.find(innerBlock => { return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name); }); }, []); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: comments_pagination_edit_TEMPLATE }); // Get the Discussion settings const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings?.pageComments; }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination // controls. We don't want to remove them from the template so that when the user enables // paging comments, the controls will be visible. if (!pageComments) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsPaginationArrowControls, { value: paginationArrow, onChange: value => { setAttributes({ paginationArrow: value }); } }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js /** * WordPress dependencies */ function comments_pagination_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination", title: "Comments Pagination", category: "theme", parent: ["core/comments"], allowedBlocks: ["core/comments-pagination-previous", "core/comments-pagination-numbers", "core/comments-pagination-next"], description: "Displays a paginated navigation to next/previous set of comments, when applicable.", textdomain: "default", attributes: { paginationArrow: { type: "string", "default": "none" } }, providesContext: { "comments/paginationArrow": "paginationArrow" }, supports: { align: true, reusable: false, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, layout: { allowSwitching: false, allowInheriting: false, "default": { type: "flex" } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-comments-pagination-editor", style: "wp-block-comments-pagination" }; const { name: comments_pagination_name } = comments_pagination_metadata; const comments_pagination_settings = { icon: query_pagination, edit: QueryPaginationEdit, save: comments_pagination_save_save }; const comments_pagination_init = () => initBlock({ name: comments_pagination_name, metadata: comments_pagination_metadata, settings: comments_pagination_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js /** * WordPress dependencies */ const queryPaginationNext = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" }) }); /* harmony default export */ const query_pagination_next = (queryPaginationNext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js /** * WordPress dependencies */ const edit_arrowMap = { none: '', arrow: '→', chevron: '»' }; function CommentsPaginationNextEdit({ attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } }) { const displayArrow = edit_arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#comments-pagination-next-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`, children: displayArrow })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_next_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-next", title: "Comments Next Page", category: "theme", parent: ["core/comments-pagination"], description: "Displays the next comment's page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["postId", "comments/paginationArrow"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_next_name } = comments_pagination_next_metadata; const comments_pagination_next_settings = { icon: query_pagination_next, edit: CommentsPaginationNextEdit }; const comments_pagination_next_init = () => initBlock({ name: comments_pagination_next_name, metadata: comments_pagination_next_metadata, settings: comments_pagination_next_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js /** * WordPress dependencies */ const queryPaginationNumbers = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z" }) }); /* harmony default export */ const query_pagination_numbers = (queryPaginationNumbers); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js /** * WordPress dependencies */ const PaginationItem = ({ content, tag: Tag = 'a', extraClass = '' }) => Tag === 'a' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, href: "#comments-pagination-numbers-pseudo-link", onClick: event => event.preventDefault(), children: content }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, children: content }); function CommentsPaginationNumbersEdit() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "1" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "2" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "3", tag: "span", extraClass: "current" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "4" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "5" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "...", tag: "span", extraClass: "dots" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "8" })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_numbers_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-numbers", title: "Comments Page Numbers", category: "theme", parent: ["core/comments-pagination"], description: "Displays a list of page numbers for comments pagination.", textdomain: "default", usesContext: ["postId"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_numbers_name } = comments_pagination_numbers_metadata; const comments_pagination_numbers_settings = { icon: query_pagination_numbers, edit: CommentsPaginationNumbersEdit }; const comments_pagination_numbers_init = () => initBlock({ name: comments_pagination_numbers_name, metadata: comments_pagination_numbers_metadata, settings: comments_pagination_numbers_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/title.js /** * WordPress dependencies */ const title = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" }) }); /* harmony default export */ const library_title = (title); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js /** * External dependencies */ /** * WordPress dependencies */ function comments_title_edit_Edit({ attributes: { textAlign, showPostTitle, showCommentsCount, level }, setAttributes, context: { postType, postId } }) { const TagName = 'h' + level; const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); const isSiteEditor = typeof postId === 'undefined'; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const { threadCommentsDepth, threadComments, commentsPerPage, pageComments } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings().__experimentalDiscussionSettings; }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isSiteEditor) { // Match the number of comments that will be shown in the comment-template/edit.js placeholder const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); setCommentsCount(Math.min(commentsNumber, 3)); return; } const currentPostId = postId; external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { post: postId, _fields: 'id' }), method: 'HEAD', parse: false }).then(res => { // Stale requests will have the `currentPostId` of an older closure. if (currentPostId === postId) { setCommentsCount(parseInt(res.headers.get('X-WP-Total'))); } }).catch(() => { setCommentsCount(0); }); }, [postId]); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, onChange: newLevel => setAttributes({ level: newLevel }) })] }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show post title'), checked: showPostTitle, onChange: value => setAttributes({ showPostTitle: value }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'), checked: showCommentsCount, onChange: value => setAttributes({ showCommentsCount: value }) })] }) }); const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('“Post Title”') : `"${rawTitle}"`; let placeholder; if (showCommentsCount && commentsCount !== undefined) { if (showPostTitle) { if (commentsCount === 1) { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle); } else { placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Number of comments, 2: Post title. */ (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle); } } else if (commentsCount === 1) { placeholder = (0,external_wp_i18n_namespaceObject.__)('One response'); } else { placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Number of comments. */ (0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount); } } else if (showPostTitle) { if (commentsCount === 1) { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle); } else { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle); } } else if (commentsCount === 1) { placeholder = (0,external_wp_i18n_namespaceObject.__)('Response'); } else { placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses'); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: placeholder })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js /** * Internal dependencies */ const deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-title", title: "Comments Title", category: "theme", ancestor: ["core/comments"], description: "Displays a title with the number of comments.", textdomain: "default", usesContext: ["postId", "postType"], attributes: { textAlign: { type: "string" }, showPostTitle: { type: "boolean", "default": true }, showCommentsCount: { type: "boolean", "default": true }, level: { type: "number", "default": 2 } }, supports: { anchor: false, align: true, html: false, __experimentalBorder: { radius: true, color: true, width: true, style: true }, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true } }, interactivity: { clientNavigation: true } } }; const { attributes, supports } = deprecated_metadata; /* harmony default export */ const comments_title_deprecated = ([{ attributes: { ...attributes, singleCommentLabel: { type: 'string' }, multipleCommentsLabel: { type: 'string' } }, supports, migrate: oldAttributes => { const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes; return newAttributes; }, isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel, save: () => null }]); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_title_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-title", title: "Comments Title", category: "theme", ancestor: ["core/comments"], description: "Displays a title with the number of comments.", textdomain: "default", usesContext: ["postId", "postType"], attributes: { textAlign: { type: "string" }, showPostTitle: { type: "boolean", "default": true }, showCommentsCount: { type: "boolean", "default": true }, level: { type: "number", "default": 2 } }, supports: { anchor: false, align: true, html: false, __experimentalBorder: { radius: true, color: true, width: true, style: true }, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_title_name } = comments_title_metadata; const comments_title_settings = { icon: library_title, edit: comments_title_edit_Edit, deprecated: comments_title_deprecated }; const comments_title_init = () => initBlock({ name: comments_title_name, metadata: comments_title_metadata, settings: comments_title_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js /** * WordPress dependencies */ const cover = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z" }) }); /* harmony default export */ const library_cover = (cover); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/shared.js /** * WordPress dependencies */ const POSITION_CLASSNAMES = { 'top left': 'is-position-top-left', 'top center': 'is-position-top-center', 'top right': 'is-position-top-right', 'center left': 'is-position-center-left', 'center center': 'is-position-center-center', center: 'is-position-center-center', 'center right': 'is-position-center-right', 'bottom left': 'is-position-bottom-left', 'bottom center': 'is-position-bottom-center', 'bottom right': 'is-position-bottom-right' }; const IMAGE_BACKGROUND_TYPE = 'image'; const VIDEO_BACKGROUND_TYPE = 'video'; const COVER_MIN_HEIGHT = 50; const COVER_MAX_HEIGHT = 1000; const COVER_DEFAULT_HEIGHT = 300; const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 }; const shared_ALLOWED_MEDIA_TYPES = ['image', 'video']; function mediaPosition({ x, y } = DEFAULT_FOCAL_POINT) { return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`; } function dimRatioToClass(ratio) { return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); } function attributesFromMedia(media) { if (!media || !media.url) { return { url: undefined, id: undefined }; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); } let mediaType; // For media selections originated from a file upload. if (media.media_type) { if (media.media_type === IMAGE_BACKGROUND_TYPE) { mediaType = IMAGE_BACKGROUND_TYPE; } else { // only images and videos are accepted so if the media_type is not an image we can assume it is a video. // Videos contain the media type of 'file' in the object returned from the rest api. mediaType = VIDEO_BACKGROUND_TYPE; } } else { // For media selections originated from existing files in the media library. if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) { return; } mediaType = media.type; } return { url: media.url, id: media.id, alt: media?.alt, backgroundType: mediaType, ...(mediaType === VIDEO_BACKGROUND_TYPE ? { hasParallax: undefined } : {}) }; } /** * Checks of the contentPosition is the center (default) position. * * @param {string} contentPosition The current content position. * @return {boolean} Whether the contentPosition is center. */ function isContentPositionCenter(contentPosition) { return !contentPosition || contentPosition === 'center center' || contentPosition === 'center'; } /** * Retrieves the className for the current contentPosition. * The default position (center) will not have a className. * * @param {string} contentPosition The current content position. * @return {string} The className assigned to the contentPosition. */ function getPositionClassName(contentPosition) { /* * Only render a className if the contentPosition is not center (the default). */ if (isContentPositionCenter(contentPosition)) { return ''; } return POSITION_CLASSNAMES[contentPosition]; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function backgroundImageStyles(url) { return url ? { backgroundImage: `url(${url})` } : {}; } /** * Original function to determine the background opacity classname * * Used in deprecations: v1-7. * * @param {number} ratio ratio to use for opacity. * @return {string} background opacity class . */ function dimRatioToClassV1(ratio) { return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); } function migrateDimRatio(attributes) { return { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio }; } function migrateTag(attributes) { if (!attributes.tagName) { attributes = { ...attributes, tagName: 'div' }; } return { ...attributes }; } const deprecated_blockAttributes = { url: { type: 'string' }, id: { type: 'number' }, hasParallax: { type: 'boolean', default: false }, dimRatio: { type: 'number', default: 50 }, overlayColor: { type: 'string' }, customOverlayColor: { type: 'string' }, backgroundType: { type: 'string', default: 'image' }, focalPoint: { type: 'object' } }; const v8ToV11BlockAttributes = { url: { type: 'string' }, id: { type: 'number' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, hasParallax: { type: 'boolean', default: false }, isRepeated: { type: 'boolean', default: false }, dimRatio: { type: 'number', default: 100 }, overlayColor: { type: 'string' }, customOverlayColor: { type: 'string' }, backgroundType: { type: 'string', default: 'image' }, focalPoint: { type: 'object' }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' }, isDark: { type: 'boolean', default: true }, allowedBlocks: { type: 'array' }, templateLock: { type: ['string', 'boolean'], enum: ['all', 'insert', false] } }; const v12BlockAttributes = { ...v8ToV11BlockAttributes, useFeaturedImage: { type: 'boolean', default: false }, tagName: { type: 'string', default: 'div' } }; const v7toV11BlockSupports = { anchor: true, align: true, html: false, spacing: { padding: true, __experimentalDefaultControls: { padding: true } }, color: { __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', text: false, background: false } }; const v12BlockSupports = { ...v7toV11BlockSupports, spacing: { padding: true, margin: ['top', 'bottom'], blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', heading: true, text: true, background: false, __experimentalSkipSerialization: ['gradients'], enableContrastChecker: false }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowJustification: false } }; // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated. const v13 = { attributes: v12BlockAttributes, supports: v12BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } }; // Deprecation for blocks to prevent auto overlay color from overriding previously set values. const v12 = { attributes: v12BlockAttributes, supports: v12BlockSupports, isEligible(attributes) { return attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined; }, migrate(attributes) { return { ...attributes, isUserOverlayColor: true }; }, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } }; // Deprecation for blocks that does not have a HTML tag option. const deprecated_v11 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // Deprecation for blocks that renders fixed background as backgroud from the main block container. const deprecated_v10 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`. const v9 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`. const v8 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, { 'has-background-dim': dimRatio !== undefined, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass }), style: bgStyle }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; const v7 = { attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' } }, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient && !url ? customGradient : undefined, minHeight: minHeight || undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v6 = { attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isRepeated, overlayColor, url, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const style = isImageBackground ? backgroundImageStyles(url) : {}; const videoStyle = {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; let positionValue; if (focalPoint) { positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`; if (isImageBackground && !hasParallax) { style.backgroundPosition = positionValue; } if (isVideoBackground) { videoStyle.objectPosition = positionValue; } } const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: videoStyle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v5 = { attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, gradient: { type: 'string' }, customGradient: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, url, minHeight } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v4 = { attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, gradient: { type: 'string' }, customGradient: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, url, minHeight } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v3 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'p' }, contentAlign: { type: 'string', default: 'center' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, contentAlign, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, title, url } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`; } const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-text", value: title })] }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const v2 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'p' }, contentAlign: { type: 'string', default: 'center' }, align: { type: 'string' } }, supports: { className: false }, save({ attributes }) { const { url, title, hasParallax, dimRatio, align, contentAlign, overlayColor, customOverlayColor } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundImageStyles(url); if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }, align ? `align${align}` : null); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: classes, style: style, children: !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-image-text", value: title }) }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, align, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const cover_deprecated_v1 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'h2' }, align: { type: 'string' }, contentAlign: { type: 'string', default: 'center' } }, supports: { className: false }, save({ attributes }) { const { url, title, hasParallax, dimRatio, align } = attributes; const style = backgroundImageStyles(url); const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax }, align ? `align${align}` : null); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("section", { className: classes, style: style, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "h2", value: title }) }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, align, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; /* harmony default export */ const cover_deprecated = ([v13, v12, deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: inspector_controls_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CoverHeightInput({ onChange, onUnitChange, unit = 'px', value = '' }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); const inputId = `block-cover-height-input-${instanceId}`; const isPx = unit === 'px'; const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', 'em', 'rem', 'vw', 'vh'], defaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 } }); const handleOnChange = unprocessedValue => { const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined; if (isNaN(inputValue) && inputValue !== undefined) { return; } onChange(inputValue); }; const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => { const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); return [parsedQuantity, unit].join(''); }, [unit, value]); const min = isPx ? COVER_MIN_HEIGHT : 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'), id: inputId, isResetValueOnUnitChange: true, min: min, onChange: handleOnChange, onUnitChange: onUnitChange, __unstableInputWidth: "80px", units: units, value: computedValue }); } function CoverInspectorControls({ attributes, setAttributes, clientId, setOverlayColor, coverRef, currentSettings, updateDimRatio, onClearMedia }) { const { useFeaturedImage, dimRatio, focalPoint, hasParallax, isRepeated, minHeight, minHeightUnit, alt, tagName } = attributes; const { isVideoBackground, isImageBackground, mediaElement, url, overlayColor } = currentSettings; const { gradientValue, setGradient } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const toggleParallax = () => { setAttributes({ hasParallax: !hasParallax, ...(!hasParallax ? { focalPoint: undefined } : {}) }); }; const toggleIsRepeated = () => { setAttributes({ isRepeated: !isRepeated }); }; const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); const imperativeFocalPointPreview = value => { const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition']; styleOfRef[property] = mediaPosition(value); }; const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); const htmlElementMessages = { header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."), article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."), footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).') }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: !!url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [isImageBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), checked: hasParallax, onChange: toggleParallax }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), checked: isRepeated, onChange: toggleIsRepeated })] }), showFocalPointPicker && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), url: url, value: focalPoint, onDragStart: imperativeFocalPointPreview, onDrag: imperativeFocalPointPreview, onChange: newFocalPoint => setAttributes({ focalPoint: newFocalPoint }) }), !useFeaturedImage && url && !isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), value: alt, onChange: newAlt => setAttributes({ alt: newAlt }), help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelRow, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", size: "small", className: "block-library-cover__reset-button", onClick: onClearMedia, children: (0,external_wp_i18n_namespaceObject.__)('Clear Media') }) })] }) }), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { __experimentalIsRenderedInSidebar: true, settings: [{ colorValue: overlayColor.color, gradientValue, label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), onColorChange: setOverlayColor, onGradientChange: setGradient, isShownByDefault: true, resetAllFilter: () => ({ overlayColor: undefined, customOverlayColor: undefined, gradient: undefined, customGradient: undefined }) }], panelId: clientId, ...colorGradientSettings }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => { // If there's a media background the dimRatio will be // defaulted to 50 whereas it will be 100 for colors. return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100); }, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), onDeselect: () => updateDimRatio(url ? 50 : 100), resetAllFilter: () => ({ dimRatio: url ? 50 : 100 }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), value: dimRatio, onChange: newDimRatio => updateDimRatio(newDimRatio), min: 0, max: 100, step: 10, required: true, __next40pxDefaultSize: true }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "dimensions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!minHeight, label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), onDeselect: () => setAttributes({ minHeight: undefined, minHeightUnit: undefined }), resetAllFilter: () => ({ minHeight: undefined, minHeightUnit: undefined }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverHeightInput, { value: attributes?.style?.dimensions?.aspectRatio ? '' : minHeight, unit: minHeightUnit, onChange: newMinHeight => setAttributes({ minHeight: newMinHeight, style: inspector_controls_cleanEmptyObject({ ...attributes?.style, dimensions: { ...attributes?.style?.dimensions, aspectRatio: undefined // Reset aspect ratio when minHeight is set. } }) }), onUnitChange: nextUnit => setAttributes({ minHeightUnit: nextUnit }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), value: 'div' }, { label: '<header>', value: 'header' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<article>', value: 'article' }, { label: '<aside>', value: 'aside' }, { label: '<footer>', value: 'footer' }], value: tagName, onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: block_controls_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CoverBlockControls({ attributes, setAttributes, onSelectMedia, currentSettings, toggleUseFeaturedImage }) { const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } = attributes; const { hasInnerBlocks, url } = currentSettings; const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight); const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit); const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100 && !attributes?.style?.dimensions?.aspectRatio; const toggleMinFullHeight = () => { if (isMinFullHeight) { // If there aren't previous values, take the default ones. if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) { return setAttributes({ minHeight: undefined, minHeightUnit: undefined }); } // Set the previous values of height. return setAttributes({ minHeight: prevMinHeightValue, minHeightUnit: prevMinHeightUnit }); } setPrevMinHeightValue(minHeight); setPrevMinHeightUnit(minHeightUnit); // Set full height, and clear any aspect ratio value. return setAttributes({ minHeight: 100, minHeightUnit: 'vh', style: block_controls_cleanEmptyObject({ ...attributes?.style, dimensions: { ...attributes?.style?.dimensions, aspectRatio: undefined // Reset aspect ratio when minHeight is set. } }) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, { label: (0,external_wp_i18n_namespaceObject.__)('Change content position'), value: contentPosition, onChange: nextPosition => setAttributes({ contentPosition: nextPosition }), isDisabled: !hasInnerBlocks }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, { isActive: isMinFullHeight, onToggle: toggleMinFullHeight, isDisabled: !hasInnerBlocks })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: url, allowedTypes: shared_ALLOWED_MEDIA_TYPES, accept: "image/*,video/*", onSelect: onSelectMedia, onToggleFeaturedImage: toggleUseFeaturedImage, useFeaturedImage: useFeaturedImage, name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add Media') : (0,external_wp_i18n_namespaceObject.__)('Replace') }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function CoverPlaceholder({ disableMediaButtons = false, children, onSelectMedia, onError, style, toggleUseFeaturedImage }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_cover }), labels: { title: (0,external_wp_i18n_namespaceObject.__)('Cover'), instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop onto this block, upload, or select existing media from your library.') }, onSelect: onSelectMedia, accept: "image/*,video/*", allowedTypes: shared_ALLOWED_MEDIA_TYPES, disableMediaButtons: disableMediaButtons, onToggleFeaturedImage: toggleUseFeaturedImage, onError: onError, style: style, children: children }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover-popover.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const RESIZABLE_BOX_ENABLE_OPTION = { top: false, right: false, bottom: true, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }; const { ResizableBoxPopover } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ResizableCoverPopover({ className, height, minHeight, onResize, onResizeStart, onResizeStop, showHandle, size, width, ...props }) { const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const resizableBoxProps = { className: dist_clsx(className, { 'is-resizing': isResizing }), enable: RESIZABLE_BOX_ENABLE_OPTION, onResizeStart: (_event, _direction, elt) => { onResizeStart(elt.clientHeight); onResize(elt.clientHeight); }, onResize: (_event, _direction, elt) => { onResize(elt.clientHeight); if (!isResizing) { setIsResizing(true); } }, onResizeStop: (_event, _direction, elt) => { onResizeStop(elt.clientHeight); setIsResizing(false); }, showHandle, size, __experimentalShowTooltip: true, __experimentalTooltipProps: { axis: 'y', position: 'bottom', isVisible: isResizing } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableBoxPopover, { className: "block-library-cover__resizable-box-popover", resizableBoxProps: resizableBoxProps, ...props }); } ;// CONCATENATED MODULE: ./node_modules/colord/index.mjs var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; ;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} ;// CONCATENATED MODULE: ./node_modules/fast-average-color/dist/index.esm.js /*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */ function toHex(num) { var str = num.toString(16); return str.length === 1 ? '0' + str : str; } function arrayToHex(arr) { return '#' + arr.map(toHex).join(''); } function isDark(color) { // http://www.w3.org/TR/AERT#color-contrast var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; return result < 128; } function prepareIgnoredColor(color) { if (!color) { return []; } return isRGBArray(color) ? color : [color]; } function isRGBArray(value) { return Array.isArray(value[0]); } function isIgnoredColor(data, index, ignoredColor) { for (var i = 0; i < ignoredColor.length; i++) { if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) { return true; } } return false; } function isIgnoredColorAsNumbers(data, index, ignoredColor) { switch (ignoredColor.length) { case 3: // [red, green, blue] if (isIgnoredRGBColor(data, index, ignoredColor)) { return true; } break; case 4: // [red, green, blue, alpha] if (isIgnoredRGBAColor(data, index, ignoredColor)) { return true; } break; case 5: // [red, green, blue, alpha, threshold] if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { return true; } break; default: return false; } } function isIgnoredRGBColor(data, index, ignoredColor) { // Ignore if the pixel are transparent. if (data[index + 3] !== 255) { return true; } if (data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2]) { return true; } return false; } function isIgnoredRGBAColor(data, index, ignoredColor) { if (data[index + 3] && ignoredColor[3]) { return data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2] && data[index + 3] === ignoredColor[3]; } // Ignore rgb components if the pixel are fully transparent. return data[index + 3] === ignoredColor[3]; } function inRange(colorComponent, ignoredColorComponent, value) { return colorComponent >= (ignoredColorComponent - value) && colorComponent <= (ignoredColorComponent + value); } function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { var redIgnored = ignoredColor[0]; var greenIgnored = ignoredColor[1]; var blueIgnored = ignoredColor[2]; var alphaIgnored = ignoredColor[3]; var threshold = ignoredColor[4]; var alphaData = data[index + 3]; var alphaInRange = inRange(alphaData, alphaIgnored, threshold); if (!alphaIgnored) { return alphaInRange; } if (!alphaData && alphaInRange) { return true; } if (inRange(data[index], redIgnored, threshold) && inRange(data[index + 1], greenIgnored, threshold) && inRange(data[index + 2], blueIgnored, threshold) && alphaInRange) { return true; } return false; } function dominantAlgorithm(arr, len, options) { var colorHash = {}; var divider = 24; var ignoredColor = options.ignoredColor; var step = options.step; var max = [0, 0, 0, 0, 0]; for (var i = 0; i < len; i += step) { var red = arr[i]; var green = arr[i + 1]; var blue = arr[i + 2]; var alpha = arr[i + 3]; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } var key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider); if (colorHash[key]) { colorHash[key] = [ colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1 ]; } else { colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; } if (max[4] < colorHash[key][4]) { max = colorHash[key]; } } var redTotal = max[0]; var greenTotal = max[1]; var blueTotal = max[2]; var alphaTotal = max[3]; var count = max[4]; return alphaTotal ? [ Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count) ] : options.defaultColor; } function simpleAlgorithm(arr, len, options) { var redTotal = 0; var greenTotal = 0; var blueTotal = 0; var alphaTotal = 0; var count = 0; var ignoredColor = options.ignoredColor; var step = options.step; for (var i = 0; i < len; i += step) { var alpha = arr[i + 3]; var red = arr[i] * alpha; var green = arr[i + 1] * alpha; var blue = arr[i + 2] * alpha; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } redTotal += red; greenTotal += green; blueTotal += blue; alphaTotal += alpha; count++; } return alphaTotal ? [ Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count) ] : options.defaultColor; } function sqrtAlgorithm(arr, len, options) { var redTotal = 0; var greenTotal = 0; var blueTotal = 0; var alphaTotal = 0; var count = 0; var ignoredColor = options.ignoredColor; var step = options.step; for (var i = 0; i < len; i += step) { var red = arr[i]; var green = arr[i + 1]; var blue = arr[i + 2]; var alpha = arr[i + 3]; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } redTotal += red * red * alpha; greenTotal += green * green * alpha; blueTotal += blue * blue * alpha; alphaTotal += alpha; count++; } return alphaTotal ? [ Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count) ] : options.defaultColor; } function getDefaultColor(options) { return getOption(options, 'defaultColor', [0, 0, 0, 0]); } function getOption(options, name, defaultValue) { return (options[name] === undefined ? defaultValue : options[name]); } var MIN_SIZE = 10; var MAX_SIZE = 100; function isSvg(filename) { return filename.search(/\.svg(\?|$)/i) !== -1; } function getOriginalSize(resource) { if (isInstanceOfHTMLImageElement(resource)) { var width = resource.naturalWidth; var height = resource.naturalHeight; // For SVG images with only viewBox attribute if (!resource.naturalWidth && isSvg(resource.src)) { width = height = MAX_SIZE; } return { width: width, height: height, }; } if (isInstanceOfHTMLVideoElement(resource)) { return { width: resource.videoWidth, height: resource.videoHeight }; } return { width: resource.width, height: resource.height }; } function getSrc(resource) { if (isInstanceOfHTMLCanvasElement(resource)) { return 'canvas'; } if (isInstanceOfOffscreenCanvas(resource)) { return 'offscreencanvas'; } if (isInstanceOfImageBitmap(resource)) { return 'imagebitmap'; } return resource.src; } function isInstanceOfHTMLImageElement(resource) { return typeof HTMLImageElement !== 'undefined' && resource instanceof HTMLImageElement; } var hasOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'; function isInstanceOfOffscreenCanvas(resource) { return hasOffscreenCanvas && resource instanceof OffscreenCanvas; } function isInstanceOfHTMLVideoElement(resource) { return typeof HTMLVideoElement !== 'undefined' && resource instanceof HTMLVideoElement; } function isInstanceOfHTMLCanvasElement(resource) { return typeof HTMLCanvasElement !== 'undefined' && resource instanceof HTMLCanvasElement; } function isInstanceOfImageBitmap(resource) { return typeof ImageBitmap !== 'undefined' && resource instanceof ImageBitmap; } function prepareSizeAndPosition(originalSize, options) { var srcLeft = getOption(options, 'left', 0); var srcTop = getOption(options, 'top', 0); var srcWidth = getOption(options, 'width', originalSize.width); var srcHeight = getOption(options, 'height', originalSize.height); var destWidth = srcWidth; var destHeight = srcHeight; if (options.mode === 'precision') { return { srcLeft: srcLeft, srcTop: srcTop, srcWidth: srcWidth, srcHeight: srcHeight, destWidth: destWidth, destHeight: destHeight }; } var factor; if (srcWidth > srcHeight) { factor = srcWidth / srcHeight; destWidth = MAX_SIZE; destHeight = Math.round(destWidth / factor); } else { factor = srcHeight / srcWidth; destHeight = MAX_SIZE; destWidth = Math.round(destHeight / factor); } if (destWidth > srcWidth || destHeight > srcHeight || destWidth < MIN_SIZE || destHeight < MIN_SIZE) { destWidth = srcWidth; destHeight = srcHeight; } return { srcLeft: srcLeft, srcTop: srcTop, srcWidth: srcWidth, srcHeight: srcHeight, destWidth: destWidth, destHeight: destHeight }; } var isWebWorkers = typeof window === 'undefined'; function makeCanvas() { if (isWebWorkers) { return hasOffscreenCanvas ? new OffscreenCanvas(1, 1) : null; } return document.createElement('canvas'); } var ERROR_PREFIX = 'FastAverageColor: '; function getError(message) { return Error(ERROR_PREFIX + message); } function outputError(error, silent) { if (!silent) { console.error(error); } } var FastAverageColor = /** @class */ (function () { function FastAverageColor() { this.canvas = null; this.ctx = null; } /** * Get asynchronously the average color from not loaded image. */ FastAverageColor.prototype.getColorAsync = function (resource, options) { if (!resource) { return Promise.reject(getError('call .getColorAsync() without resource.')); } if (typeof resource === 'string') { // Web workers if (typeof Image === 'undefined') { return Promise.reject(getError('resource as string is not supported in this environment')); } var img = new Image(); img.crossOrigin = options && options.crossOrigin || ''; img.src = resource; return this.bindImageEvents(img, options); } else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { return this.bindImageEvents(resource, options); } else { var result = this.getColor(resource, options); return result.error ? Promise.reject(result.error) : Promise.resolve(result); } }; /** * Get the average color from images, videos and canvas. */ FastAverageColor.prototype.getColor = function (resource, options) { options = options || {}; var defaultColor = getDefaultColor(options); if (!resource) { var error = getError('call .getColor(null) without resource'); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } var originalSize = getOriginalSize(resource); var size = prepareSizeAndPosition(originalSize, options); if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { var error = getError("incorrect sizes for resource \"".concat(getSrc(resource), "\"")); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } if (!this.canvas) { this.canvas = makeCanvas(); if (!this.canvas) { var error = getError('OffscreenCanvas is not supported in this browser'); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } } if (!this.ctx) { this.ctx = this.canvas.getContext('2d', { willReadFrequently: true }); if (!this.ctx) { var error = getError('Canvas Context 2D is not supported in this browser'); outputError(error, options.silent); return this.prepareResult(defaultColor); } this.ctx.imageSmoothingEnabled = false; } this.canvas.width = size.destWidth; this.canvas.height = size.destHeight; try { this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; return this.prepareResult(this.getColorFromArray4(bitmapData, options)); } catch (originalError) { var error = getError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image")); outputError(error, options.silent); !options.silent && console.error(originalError); return this.prepareResult(defaultColor, error); } }; /** * Get the average color from a array when 1 pixel is 4 bytes. */ FastAverageColor.prototype.getColorFromArray4 = function (arr, options) { options = options || {}; var bytesPerPixel = 4; var arrLength = arr.length; var defaultColor = getDefaultColor(options); if (arrLength < bytesPerPixel) { return defaultColor; } var len = arrLength - arrLength % bytesPerPixel; var step = (options.step || 1) * bytesPerPixel; var algorithm; switch (options.algorithm || 'sqrt') { case 'simple': algorithm = simpleAlgorithm; break; case 'sqrt': algorithm = sqrtAlgorithm; break; case 'dominant': algorithm = dominantAlgorithm; break; default: throw getError("".concat(options.algorithm, " is unknown algorithm")); } return algorithm(arr, len, { defaultColor: defaultColor, ignoredColor: prepareIgnoredColor(options.ignoredColor), step: step }); }; /** * Get color data from value ([r, g, b, a]). */ FastAverageColor.prototype.prepareResult = function (value, error) { var rgb = value.slice(0, 3); var rgba = [value[0], value[1], value[2], value[3] / 255]; var isDarkColor = isDark(value); return { value: [value[0], value[1], value[2], value[3]], rgb: 'rgb(' + rgb.join(',') + ')', rgba: 'rgba(' + rgba.join(',') + ')', hex: arrayToHex(rgb), hexa: arrayToHex(value), isDark: isDarkColor, isLight: !isDarkColor, error: error, }; }; /** * Destroy the instance. */ FastAverageColor.prototype.destroy = function () { if (this.canvas) { this.canvas.width = 1; this.canvas.height = 1; this.canvas = null; } this.ctx = null; }; FastAverageColor.prototype.bindImageEvents = function (resource, options) { var _this = this; return new Promise(function (resolve, reject) { var onload = function () { unbindEvents(); var result = _this.getColor(resource, options); if (result.error) { reject(result.error); } else { resolve(result); } }; var onerror = function () { unbindEvents(); reject(getError("Error loading image \"".concat(resource.src, "\"."))); }; var onabort = function () { unbindEvents(); reject(getError("Image \"".concat(resource.src, "\" loading aborted"))); }; var unbindEvents = function () { resource.removeEventListener('load', onload); resource.removeEventListener('error', onerror); resource.removeEventListener('abort', onabort); }; resource.addEventListener('load', onload); resource.addEventListener('error', onerror); resource.addEventListener('abort', onabort); }); }; return FastAverageColor; }()); ;// CONCATENATED MODULE: external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/color-utils.js /** * External dependencies */ /** * WordPress dependencies */ /** * @typedef {import('colord').RgbaColor} RgbaColor */ k([names]); /** * Fallback color when the average color can't be computed. The image may be * rendering as transparent, and most sites have a light color background. */ const DEFAULT_BACKGROUND_COLOR = '#FFF'; /** * Default dim color specified in style.css. */ const DEFAULT_OVERLAY_COLOR = '#000'; /** * Performs a Porter Duff composite source over operation on two rgba colors. * * @see {@link https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_srcover} * * @param {RgbaColor} source Source color. * @param {RgbaColor} dest Destination color. * * @return {RgbaColor} Composite color. */ function compositeSourceOver(source, dest) { return { r: source.r * source.a + dest.r * dest.a * (1 - source.a), g: source.g * source.a + dest.g * dest.a * (1 - source.a), b: source.b * source.a + dest.b * dest.a * (1 - source.a), a: source.a + dest.a * (1 - source.a) }; } /** * Retrieves the FastAverageColor singleton. * * @return {FastAverageColor} The FastAverageColor singleton. */ function retrieveFastAverageColor() { if (!retrieveFastAverageColor.fastAverageColor) { retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); } return retrieveFastAverageColor.fastAverageColor; } /** * Computes the average color of an image. * * @param {string} url The url of the image. * * @return {Promise<string>} Promise of an average color as a hex string. */ const getMediaColor = memize(async url => { if (!url) { return DEFAULT_BACKGROUND_COLOR; } // making the default color rgb for compat with FAC const { r, g, b, a } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); try { const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); const color = await retrieveFastAverageColor().getColorAsync(url, { // The default color is white, which is the color // that is returned if there's an error. // colord returns alpga 0-1, FAC needs 0-255 defaultColor: [r, g, b, a * 255], // Errors that come up don't reject the promise, // so error logging has to be silenced // with this option. silent: "production" === 'production', crossOrigin: imgCrossOrigin }); return color.hex; } catch (error) { // If there's an error return the fallback color. return DEFAULT_BACKGROUND_COLOR; } }); /** * Computes if the color combination of the overlay and background color is dark. * * @param {number} dimRatio Opacity of the overlay between 0 and 100. * @param {string} overlayColor CSS color string for the overlay. * @param {string} backgroundColor CSS color string for the background. * * @return {boolean} true if the color combination composite result is dark. */ function compositeIsDark(dimRatio, overlayColor, backgroundColor) { // Opacity doesn't matter if you're overlaying the same color on top of itself. // And background doesn't matter when overlay is fully opaque. if (overlayColor === backgroundColor || dimRatio === 100) { return w(overlayColor).isDark(); } const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); const background = w(backgroundColor).toRgb(); const composite = compositeSourceOver(overlay, background); return w(composite).isDark(); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function getInnerBlocksTemplate(attributes) { return [['core/paragraph', { align: 'center', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'), ...attributes }]]; } /** * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while * the media (image or video) is being uploaded and will not have an id allocated yet. * * @param {number} id The id of the media. * @param {string} url The url of the media. * * @return {boolean} Is the URL a Blob URL. */ const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); function CoverEdit({ attributes, clientId, isSelected, overlayColor, setAttributes, setOverlayColor, toggleSelection, context: { postId, postType } }) { const { contentPosition, id, url: originalUrl, backgroundType: originalBackgroundType, useFeaturedImage, dimRatio, focalPoint, hasParallax, isDark, isRepeated, minHeight, minHeightUnit, alt, allowedBlocks, templateLock, tagName: TagName = 'div', isUserOverlayColor } = attributes; const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { context: 'view' }), [featuredImage]); const mediaUrl = media?.source_url; // User can change the featured image outside of the block, but we still // need to update the block when that happens. This effect should only // run when the featured image changes in that case. All other cases are // handled in their respective callbacks. (0,external_wp_element_namespaceObject.useEffect)(() => { (async () => { if (!useFeaturedImage) { return; } const averageBackgroundColor = await getMediaColor(mediaUrl); let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = averageBackgroundColor; __unstableMarkNextChangeAsNotPersistent(); setOverlayColor(newOverlayColor); } const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); __unstableMarkNextChangeAsNotPersistent(); setAttributes({ isDark: newIsDark }); })(); // Disable reason: Update the block only when the featured image changes. // eslint-disable-next-line react-hooks/exhaustive-deps }, [mediaUrl]); // instead of destructuring the attributes // we define the url and background type // depending on the value of the useFeaturedImage flag // to preview in edit the dynamic featured image const url = useFeaturedImage ? mediaUrl : // Ensure the url is not malformed due to sanitization through `wp_kses`. originalUrl?.replaceAll('&', '&'); const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { gradientClass, gradientValue } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const onSelectMedia = async newMedia => { const mediaAttributes = attributesFromMedia(newMedia); const isImage = [newMedia?.type, newMedia?.media_type].includes(IMAGE_BACKGROUND_TYPE); const averageBackgroundColor = await getMediaColor(isImage ? newMedia?.url : undefined); let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = averageBackgroundColor; setOverlayColor(newOverlayColor); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } // Only set a new dimRatio if there was no previous media selected // to avoid resetting to 50 if it has been explicitly set to 100. // See issue #52835 for context. const newDimRatio = originalUrl === undefined && dimRatio === 100 ? 50 : dimRatio; const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); setAttributes({ ...mediaAttributes, focalPoint: undefined, useFeaturedImage: undefined, dimRatio: newDimRatio, isDark: newIsDark }); }; const onClearMedia = () => { let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = DEFAULT_OVERLAY_COLOR; setOverlayColor(undefined); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } const newIsDark = compositeIsDark(dimRatio, newOverlayColor, DEFAULT_BACKGROUND_COLOR); setAttributes({ url: undefined, id: undefined, backgroundType: undefined, focalPoint: undefined, hasParallax: undefined, isRepeated: undefined, useFeaturedImage: undefined, isDark: newIsDark }); }; const onSetOverlayColor = async newOverlayColor => { const averageBackgroundColor = await getMediaColor(url); const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); setOverlayColor(newOverlayColor); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); setAttributes({ isUserOverlayColor: true, isDark: newIsDark }); }; const onUpdateDimRatio = async newDimRatio => { const averageBackgroundColor = await getMediaColor(url); const newIsDark = compositeIsDark(newDimRatio, overlayColor.color, averageBackgroundColor); setAttributes({ dimRatio: newDimRatio, isDark: newIsDark }); }; const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); }; const isUploadingMedia = isTemporaryMedia(id, url); const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const [resizeListener, { height, width }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const resizableBoxDimensions = (0,external_wp_element_namespaceObject.useMemo)(() => { return { height: minHeightUnit === 'px' ? minHeight : 'auto', width: 'auto' }; }, [minHeight, minHeightUnit]); const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeightWithUnit || undefined }; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const bgStyle = { backgroundColor: overlayColor.color }; const mediaStyle = { objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined }; const hasBackground = !!(url || overlayColor.color || gradientValue); const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]); const ref = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks. const [fontSizes] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fontSizes'); const hasFontSizes = fontSizes?.length > 0; const innerBlocksTemplate = getInnerBlocksTemplate({ fontSize: hasFontSizes ? 'large' : undefined }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-cover__inner-container' }, { // Avoid template sync when the `templateLock` value is `all` or `contentOnly`. // See: https://github.com/WordPress/gutenberg/pull/45632 template: !hasInnerBlocks ? innerBlocksTemplate : undefined, templateInsertUpdatesSelection: true, allowedBlocks, templateLock, dropZoneElement: ref.current }); const mediaElement = (0,external_wp_element_namespaceObject.useRef)(); const currentSettings = { isVideoBackground, isImageBackground, mediaElement, hasInnerBlocks, url, isImgElement, overlayColor }; const toggleUseFeaturedImage = async () => { const newUseFeaturedImage = !useFeaturedImage; const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; const newOverlayColor = !isUserOverlayColor ? averageBackgroundColor : overlayColor.color; if (!isUserOverlayColor) { if (newUseFeaturedImage) { setOverlayColor(newOverlayColor); } else { setOverlayColor(undefined); } // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } const newDimRatio = dimRatio === 100 ? 50 : dimRatio; const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); setAttributes({ id: undefined, url: undefined, useFeaturedImage: newUseFeaturedImage, dimRatio: newDimRatio, backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined, isDark: newIsDark }); }; const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverBlockControls, { attributes: attributes, setAttributes: setAttributes, onSelectMedia: onSelectMedia, currentSettings: currentSettings, toggleUseFeaturedImage: toggleUseFeaturedImage }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverInspectorControls, { attributes: attributes, setAttributes: setAttributes, clientId: clientId, setOverlayColor: onSetOverlayColor, coverRef: ref, currentSettings: currentSettings, toggleUseFeaturedImage: toggleUseFeaturedImage, updateDimRatio: onUpdateDimRatio, onClearMedia: onClearMedia }); const resizableCoverProps = { className: 'block-library-cover__resize-container', clientId, height, minHeight: minHeightWithUnit, onResizeStart: () => { setAttributes({ minHeightUnit: 'px' }); toggleSelection(false); }, onResize: value => { setAttributes({ minHeight: value }); }, onResizeStop: newMinHeight => { toggleSelection(true); setAttributes({ minHeight: newMinHeight }); }, // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. showHandle: !attributes.style?.dimensions?.aspectRatio ? true : false, size: resizableBoxDimensions, width }; if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { ...resizableCoverProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, className: dist_clsx('is-placeholder', blockProps.className), style: { ...blockProps.style, minHeight: minHeightWithUnit || undefined }, children: [resizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { onSelectMedia: onSelectMedia, onError: onUploadError, toggleUseFeaturedImage: toggleUseFeaturedImage, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__placeholder-background-options", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { disableCustomColors: true, value: overlayColor.color, onChange: onSetOverlayColor, clearable: false }) }) })] })] }); } const classes = dist_clsx({ 'is-dark-theme': isDark, 'is-light': !isDark, 'is-transient': isUploadingMedia, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const showOverlay = url || !useFeaturedImage || useFeaturedImage && !url; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, className: dist_clsx(classes, blockProps.className), style: { ...style, ...blockProps.style }, "data-url": url, children: [resizeListener, showOverlay && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', dimRatioToClass(dimRatio), { [overlayColor.class]: overlayColor.class, 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: { backgroundImage: gradientValue, ...bgStyle } }), !url && useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "wp-block-cover__image--placeholder-image", withIllustration: true }), url && isImageBackground && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { ref: mediaElement, className: "wp-block-cover__image-background", alt: alt, src: url, style: mediaStyle }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: mediaElement, role: alt ? 'img' : undefined, "aria-label": alt ? alt : undefined, className: dist_clsx(classes, 'wp-block-cover__image-background'), style: { backgroundImage, backgroundPosition } })), url && isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { ref: mediaElement, className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url, style: mediaStyle }), isUploadingMedia && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { disableMediaButtons: true, onSelectMedia: onSelectMedia, onError: onUploadError, toggleUseFeaturedImage: toggleUseFeaturedImage }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }), isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { ...resizableCoverProps })] }); } /* harmony default export */ const cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ overlayColor: 'background-color' })])(CoverEdit)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/save.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function cover_save_save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: alt ? 'img' : undefined, "aria-label": alt ? alt : undefined, className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: transforms_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const cover_transforms_transforms = { from: [{ type: 'block', blocks: ['core/image'], transform: ({ caption, url, alt, align, id, anchor, style }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url, alt, align, id, anchor, style: { color: { duotone: style?.color?.duotone } } }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large', align: 'center' })]) }, { type: 'block', blocks: ['core/video'], transform: ({ caption, src, align, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url: src, align, id, backgroundType: VIDEO_BACKGROUND_TYPE, anchor }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large', align: 'center' })]) }, { type: 'block', blocks: ['core/group'], transform: (attributes, innerBlocks) => { const { align, anchor, backgroundColor, gradient, style } = attributes; // If the Group block being transformed has a Cover block as its // only child return that Cover block. if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/cover') { return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks); } // If no background or gradient color is provided, default to 50% opacity. // This matches the styling of a Cover block with a background image, // in the state where a background image has been removed. const dimRatio = backgroundColor || gradient || style?.color?.background || style?.color?.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block. const parentAttributes = { align, anchor, dimRatio, overlayColor: backgroundColor, customOverlayColor: style?.color?.background, gradient, customGradient: style?.color?.gradient }; const attributesWithoutBackgroundColors = { ...attributes, backgroundColor: undefined, gradient: undefined, style: transforms_cleanEmptyObject({ ...attributes?.style, color: style?.color ? { ...style?.color, background: undefined, gradient: undefined } : undefined }) }; // Preserve the block by nesting it within the Cover block, // instead of converting the Group block directly to the Cover block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]); } }], to: [{ type: 'block', blocks: ['core/image'], isMatch: ({ backgroundType, url, overlayColor, customOverlayColor, gradient, customGradient }) => { if (url) { // If a url exists the transform could happen if that URL represents an image background. return backgroundType === IMAGE_BACKGROUND_TYPE; } // If a url is not set the transform could happen if the cover has no background color or gradient; return !overlayColor && !customOverlayColor && !gradient && !customGradient; }, transform: ({ title, url, alt, align, id, anchor, style }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { caption: title, url, alt, align, id, anchor, style: { color: { duotone: style?.color?.duotone } } }) }, { type: 'block', blocks: ['core/video'], isMatch: ({ backgroundType, url, overlayColor, customOverlayColor, gradient, customGradient }) => { if (url) { // If a url exists the transform could happen if that URL represents a video background. return backgroundType === VIDEO_BACKGROUND_TYPE; } // If a url is not set the transform could happen if the cover has no background color or gradient; return !overlayColor && !customOverlayColor && !gradient && !customGradient; }, transform: ({ title, url, align, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { caption: title, src: url, id, align, anchor }) }, { type: 'block', blocks: ['core/group'], isMatch: ({ url, useFeaturedImage }) => { // If the Cover block uses background media, skip this transform, // and instead use the Group block's default transform. if (url || useFeaturedImage) { return false; } return true; }, transform: (attributes, innerBlocks) => { // Convert Cover overlay colors to comparable Group background colors. const transformedColorAttributes = { backgroundColor: attributes?.overlayColor, gradient: attributes?.gradient, style: transforms_cleanEmptyObject({ ...attributes?.style, color: attributes?.customOverlayColor || attributes?.customGradient || attributes?.style?.color ? { background: attributes?.customOverlayColor, gradient: attributes?.customGradient, ...attributes?.style?.color } : undefined }) }; // If the Cover block contains only a single Group block as a direct child, // then attempt to merge the Cover's background colors with the child Group block, // and remove the Cover block as the wrapper. if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/group') { const groupAttributes = transforms_cleanEmptyObject(innerBlocks[0].attributes || {}); // If the Group block contains any kind of background color or gradient, // skip merging Cover background colors, and preserve the Group block's colors. if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, innerBlocks[0]?.innerBlocks); } return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...transformedColorAttributes, ...groupAttributes, style: transforms_cleanEmptyObject({ ...groupAttributes?.style, color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { ...transformedColorAttributes?.style?.color, ...groupAttributes?.style?.color } : undefined }) }, innerBlocks[0]?.innerBlocks); } // In all other cases, transform the Cover block directly to a Group block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...attributes, ...transformedColorAttributes }, innerBlocks); } }] }; /* harmony default export */ const cover_transforms = (cover_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/variations.js /** * WordPress dependencies */ const variations_variations = [{ name: 'cover', title: (0,external_wp_i18n_namespaceObject.__)('Cover'), description: (0,external_wp_i18n_namespaceObject.__)('Add an image or video with a text overlay.'), attributes: { layout: { type: 'constrained' } }, isDefault: true, icon: library_cover }]; /* harmony default export */ const cover_variations = (variations_variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const cover_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/cover", title: "Cover", category: "media", description: "Add an image or video with a text overlay.", textdomain: "default", attributes: { url: { type: "string" }, useFeaturedImage: { type: "boolean", "default": false }, id: { type: "number" }, alt: { type: "string", "default": "" }, hasParallax: { type: "boolean", "default": false }, isRepeated: { type: "boolean", "default": false }, dimRatio: { type: "number", "default": 100 }, overlayColor: { type: "string" }, customOverlayColor: { type: "string" }, isUserOverlayColor: { type: "boolean" }, backgroundType: { type: "string", "default": "image" }, focalPoint: { type: "object" }, minHeight: { type: "number" }, minHeightUnit: { type: "string" }, gradient: { type: "string" }, customGradient: { type: "string" }, contentPosition: { type: "string" }, isDark: { type: "boolean", "default": true }, allowedBlocks: { type: "array" }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] }, tagName: { type: "string", "default": "div" } }, usesContext: ["postId", "postType"], supports: { anchor: true, align: true, html: false, shadow: true, spacing: { padding: true, margin: ["top", "bottom"], blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", heading: true, text: true, background: false, __experimentalSkipSerialization: ["gradients"], enableContrastChecker: false }, dimensions: { aspectRatio: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowJustification: false }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-cover-editor", style: "wp-block-cover" }; const { name: cover_name } = cover_metadata; const cover_settings = { icon: library_cover, example: { attributes: { customOverlayColor: '#065174', dimRatio: 40, url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg' }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'), align: 'center', style: { typography: { fontSize: 48 }, color: { text: 'white' } } } }] }, transforms: cover_transforms, save: cover_save_save, edit: cover_edit, deprecated: cover_deprecated, variations: cover_variations }; const cover_init = () => initBlock({ name: cover_name, metadata: cover_metadata, settings: cover_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/details.js /** * WordPress dependencies */ const details = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", fillRule: "evenodd", clipRule: "evenodd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4 5.25 4 2.5-4 2.5v-5Z" })] }); /* harmony default export */ const library_details = (details); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/edit.js /** * WordPress dependencies */ const details_edit_TEMPLATE = [['core/paragraph', { placeholder: (0,external_wp_i18n_namespaceObject.__)('Type / to add a hidden block') }]]; function DetailsEdit({ attributes, setAttributes, clientId }) { const { showContent, summary } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: details_edit_TEMPLATE, __experimentalCaptureToolbars: true }); // Check if either the block or the inner blocks are selected. const hasSelection = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockSelected, hasSelectedInnerBlock } = select(external_wp_blockEditor_namespaceObject.store); /* Sets deep to true to also find blocks inside the details content block. */ return hasSelectedInnerBlock(clientId, true) || isBlockSelected(clientId); }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), checked: showContent, onChange: () => setAttributes({ showContent: !showContent }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { ...innerBlocksProps, open: hasSelection || showContent, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { onClick: event => event.preventDefault(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "summary", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Write summary'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write summary…'), allowedFormats: [], withoutInteractiveFormatting: true, value: summary, onChange: newSummary => setAttributes({ summary: newSummary }) }) }), innerBlocksProps.children] })] }); } /* harmony default export */ const details_edit = (DetailsEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/save.js /** * WordPress dependencies */ function details_save_save({ attributes }) { const { showContent } = attributes; const summary = attributes.summary ? attributes.summary : 'Details'; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { ...blockProps, open: showContent, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: summary }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/details/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const details_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/details", title: "Details", category: "text", description: "Hide and show additional content.", keywords: ["accordion", "summary", "toggle", "disclosure"], textdomain: "default", attributes: { showContent: { type: "boolean", "default": false }, summary: { type: "rich-text", source: "rich-text", selector: "summary" } }, supports: { __experimentalOnEnter: true, align: ["wide", "full"], color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, __experimentalBorder: { color: true, width: true, style: true }, html: false, spacing: { margin: true, padding: true, blockGap: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowEditing: false }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-details-editor", style: "wp-block-details" }; const { name: details_name } = details_metadata; const details_settings = { icon: library_details, example: { attributes: { summary: 'La Mancha', showContent: true }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') } }] }, save: details_save_save, edit: details_edit }; const details_init = () => initBlock({ name: details_name, metadata: details_metadata, settings: details_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js /** * WordPress dependencies */ const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); /* harmony default export */ const library_pencil = (pencil); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js /** * Internal dependencies */ /* harmony default export */ const library_edit = (library_pencil); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js /** * WordPress dependencies */ function getResponsiveHelp(checked) { return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.'); } const EmbedControls = ({ blockSupportsResponsive, showEditButton, themeSupportsResponsive, allowResponsive, toggleResponsive, switchBackToURLInput }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: showEditButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-toolbar__control", label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'), icon: library_edit, onClick: switchBackToURLInput }) }) }), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Media settings'), className: "blocks-responsive", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'), checked: allowResponsive, help: getResponsiveHelp, onChange: toggleResponsive }) }) })] }); /* harmony default export */ const embed_controls = (EmbedControls); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/icons.js /** * WordPress dependencies */ const embedContentIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z" }) }); const embedAudioIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z" }) }); const embedPhotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); const embedVideoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" }) }); const embedTwitterIcon = { foreground: '#1da1f2', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z" }) }) }) }; const embedYouTubeIcon = { foreground: '#ff0000', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" }) }) }; const embedFacebookIcon = { foreground: '#3b5998', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z" }) }) }; const embedInstagramIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z" }) }) }); const embedWordPressIcon = { foreground: '#0073AA', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z" }) }) }) }; const embedSpotifyIcon = { foreground: '#1db954', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325" }) }) }; const embedFlickrIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z" }) }); const embedVimeoIcon = { foreground: '#1ab7ea', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z" }) }) }) }; const embedRedditIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z" }) }); const embedTumblrIcon = { foreground: '#35465c', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z" }) }) }; const embedAmazonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z" })] }); const embedAnimotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", fill: "#4bc7ee" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z", fill: "#d4cdcb" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", fill: "#c3d82e" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", fill: "#e4ecb0" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", fill: "#209dbd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", fill: "#7cb3c9" })] }); const embedDailymotionIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z", fill: "#333436" }) }); const embedPinterestIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); const embedWolframIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 44 44", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z" }) }); const embedPocketCastsIcon = { foreground: '#f43e37', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z", fill: "#fff" })] }) }; const embedBlueskyIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fill: "#0a7aff", d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" }) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js /** * WordPress dependencies */ const EmbedLoading = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed is-loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); /* harmony default export */ const embed_loading = (EmbedLoading); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js /** * WordPress dependencies */ const EmbedPlaceholder = ({ icon, label, value, onSubmit, onChange, cannotEmbed, fallback, tryAgain }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label, className: "wp-block-embed", instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { onSubmit: onSubmit, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: "url", value: value || '', className: "components-placeholder__input", "aria-label": label, placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'), onChange: onChange }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__learn-more", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/embeds/'), children: (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds') }) }), cannotEmbed && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "components-placeholder__error", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-placeholder__instructions", children: (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 3, justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: tryAgain, children: (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label') }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "secondary", onClick: fallback, children: (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label') })] })] })] }); }; /* harmony default export */ const embed_placeholder = (EmbedPlaceholder); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js /** * WordPress dependencies */ /** @typedef {import('react').SyntheticEvent} SyntheticEvent */ const attributeMap = { class: 'className', frameborder: 'frameBorder', marginheight: 'marginHeight', marginwidth: 'marginWidth' }; function WpEmbedPreview({ html }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); const props = (0,external_wp_element_namespaceObject.useMemo)(() => { const doc = new window.DOMParser().parseFromString(html, 'text/html'); const iframe = doc.querySelector('iframe'); const iframeProps = {}; if (!iframe) { return iframeProps; } Array.from(iframe.attributes).forEach(({ name, value }) => { if (name === 'style') { return; } iframeProps[attributeMap[name] || name] = value; }); return iframeProps; }, [html]); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = ref.current; const { defaultView } = ownerDocument; /** * Checks for WordPress embed events signaling the height change when * iframe content loads or iframe's window is resized. The event is * sent from WordPress core via the window.postMessage API. * * References: * window.postMessage: * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage * WordPress core embed-template on load: * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143 * WordPress core embed-template on resize: * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187 * * @param {MessageEvent} event Message event. */ function resizeWPembeds({ data: { secret, message, value } = {} }) { if (message !== 'height' || secret !== props['data-secret']) { return; } ref.current.height = value; } defaultView.addEventListener('message', resizeWPembeds); return () => { defaultView.removeEventListener('message', resizeWPembeds); }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), title: props.title, ...props }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js /** * Internal dependencies */ /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ class EmbedPreview extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.hideOverlay = this.hideOverlay.bind(this); this.state = { interactive: false }; } static getDerivedStateFromProps(nextProps, state) { if (!nextProps.isSelected && state.interactive) { // We only want to change this when the block is not selected, because changing it when // the block becomes selected makes the overlap disappear too early. Hiding the overlay // happens on mouseup when the overlay is clicked. return { interactive: false }; } return null; } hideOverlay() { // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop // changing, because that happens on mouse down, and the overlay immediately disappears, // and the mouse event can end up in the preview content. We can't use onClick on // the overlay to hide it either, because then the editor misses the mouseup event, and // thinks we're multi-selecting blocks. this.setState({ interactive: true }); } render() { const { preview, previewable, url, type, caption, onCaptionChange, isSelected, className, icon, label, insertBlocksAfter } = this.props; const { scripts } = preview; const { interactive } = this.state; const html = 'photo' === type ? getPhotoHtml(preview) : preview.html; const parsedHost = new URL(url).host.split('.'); const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.'); const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), parsedHostBaseUrl); const sandboxClassnames = dist_clsx(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality // as far as the user is concerned. We're just catching the first click so that // the block can be selected without interacting with the embed preview that the overlay covers. /* eslint-disable jsx-a11y/no-static-element-interactions */ const embedWrapper = 'wp-embed' === type ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WpEmbedPreview, { html: html }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-embed__wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SandBox, { html: html, scripts: scripts, title: iframeTitle, type: sandboxClassnames, onFocus: this.hideOverlay }), !interactive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-embed__interactive-overlay", onMouseUp: this.hideOverlay })] }); /* eslint-enable jsx-a11y/no-static-element-interactions */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: dist_clsx(className, 'wp-block-embed', { 'is-type-video': 'video' === type }), children: [previewable ? embedWrapper : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "components-placeholder__error", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: url, children: url }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "components-placeholder__error", children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: host providing embed content e.g: www.youtube.com */ (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), parsedHostBaseUrl) })] }), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "caption", tagName: "figcaption", className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'), value: caption, onChange: onCaptionChange, inlineToolbar: true, __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) })] }); } } /* harmony default export */ const embed_preview = (EmbedPreview); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/edit.js /** * Internal dependencies */ /** * External dependencies */ /** * WordPress dependencies */ const EmbedEdit = props => { const { attributes: { providerNameSlug, previewable, responsive, url: attributesUrl }, attributes, isSelected, onReplace, setAttributes, insertBlocksAfter, onFocus } = props; const defaultEmbedInfo = { title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'), icon: embedContentIcon }; const { icon, title } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl); const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const { invalidateResolution } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { preview, fetching, themeSupportsResponsive, cannotEmbed, hasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEmbedPreview, isPreviewEmbedFallback, isRequestingEmbedPreview, getThemeSupports, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); if (!attributesUrl) { return { fetching: false, cannotEmbed: false }; } const embedPreview = getEmbedPreview(attributesUrl); const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html. const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === undefined; // Some WordPress URLs that can't be embedded will cause the API to return // a valid JSON response with no HTML and `data.status` set to 404, rather // than generating a fallback response as other embeds do. const wordpressCantEmbed = embedPreview?.data?.status === 404; const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; return { preview: validPreview ? embedPreview : undefined, fetching: isRequestingEmbedPreview(attributesUrl), themeSupportsResponsive: getThemeSupports()['responsive-embeds'], cannotEmbed: !validPreview || previewIsFallback, hasResolved: hasFinishedResolution('getEmbedPreview', [attributesUrl]) }; }, [attributesUrl]); /** * Returns the attributes derived from the preview, merged with the current attributes. * * @return {Object} Merged attributes. */ const getMergedAttributes = () => getMergedAttributesWithPreview(attributes, preview, title, responsive); const toggleResponsive = () => { const { allowResponsive, className } = attributes; const { html } = preview; const newAllowResponsive = !allowResponsive; setAttributes({ allowResponsive: newAllowResponsive, className: getClassNames(html, className, responsive && newAllowResponsive) }); }; (0,external_wp_element_namespaceObject.useEffect)(() => { if (preview?.html || !cannotEmbed || !hasResolved) { return; } // At this stage, we're not fetching the preview and know it can't be embedded, // so try removing any trailing slash, and resubmit. const newURL = attributesUrl.replace(/\/$/, ''); setURL(newURL); setIsEditingURL(false); setAttributes({ url: newURL }); }, [preview?.html, attributesUrl, cannotEmbed, hasResolved, setAttributes]); // Try a different provider in case the embed url is not supported. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!cannotEmbed || fetching || !url) { return; } // Until X provider is supported in WordPress, as a workaround we use Twitter provider. if ((0,external_wp_url_namespaceObject.getAuthority)(url) === 'x.com') { const newURL = new URL(url); newURL.host = 'twitter.com'; setAttributes({ url: newURL.toString() }); } }, [url, cannotEmbed, fetching, setAttributes]); // Handle incoming preview. (0,external_wp_element_namespaceObject.useEffect)(() => { if (preview && !isEditingURL) { // When obtaining an incoming preview, // we set the attributes derived from the preview data. const mergedAttributes = getMergedAttributes(); setAttributes(mergedAttributes); if (onReplace) { const upgradedBlock = createUpgradedEmbedBlock(props, mergedAttributes); if (upgradedBlock) { onReplace(upgradedBlock); } } } }, [preview, isEditingURL]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (fetching) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_loading, {}) }); } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; if (showEmbedPlaceholder) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_placeholder, { icon: icon, label: label, onFocus: onFocus, onSubmit: event => { if (event) { event.preventDefault(); } // If the embed URL was changed, we need to reset the aspect ratio class. // To do this we have to remove the existing ratio class so it can be recalculated. const blockClass = removeAspectRatioClasses(attributes.className); setIsEditingURL(false); setAttributes({ url, className: blockClass }); }, value: url, cannotEmbed: cannotEmbed, onChange: event => setURL(event.target.value), fallback: () => fallback(url, onReplace), tryAgain: () => { invalidateResolution('getEmbedPreview', [url]); } }) }); } // Even though we set attributes that get derived from the preview, // we don't access them directly because for the initial render, // the `setAttributes` call will not have taken effect. If we're // rendering responsive content, setting the responsive classes // after the preview has been rendered can result in unwanted // clipping or scrollbars. The `getAttributesFromPreview` function // that `getMergedAttributes` uses is memoized so that we're not // calculating them on every render. const { caption, type, allowResponsive, className: classFromPreview } = getMergedAttributes(); const className = dist_clsx(classFromPreview, props.className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_controls, { showEditButton: preview && !cannotEmbed, themeSupportsResponsive: themeSupportsResponsive, blockSupportsResponsive: responsive, allowResponsive: allowResponsive, toggleResponsive: toggleResponsive, switchBackToURLInput: () => setIsEditingURL(true) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_preview, { preview: preview, previewable: previewable, className: className, url: url, type: type, caption: caption, onCaptionChange: value => setAttributes({ caption: value }), isSelected: isSelected, icon: icon, label: label, insertBlocksAfter: insertBlocksAfter }) })] }); }; /* harmony default export */ const embed_edit = (EmbedEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/save.js /** * External dependencies */ /** * WordPress dependencies */ function embed_save_save({ attributes }) { const { url, caption, type, providerNameSlug } = attributes; if (!url) { return null; } const className = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: `\n${url}\n` /* URL needs to be on its own line. */ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const transforms_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", __experimentalRole: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", __experimentalRole: "content" }, type: { type: "string", __experimentalRole: "content" }, providerNameSlug: { type: "string", __experimentalRole: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, __experimentalRole: "content" }, previewable: { type: "boolean", "default": true, __experimentalRole: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; const { name: EMBED_BLOCK } = transforms_metadata; /** * Default transforms for generic embeds. */ const embed_transforms_transforms = { from: [{ type: 'raw', isMatch: node => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1, transform: node => { return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, { url: node.textContent.trim() }); } }], to: [{ type: 'block', blocks: ['core/paragraph'], isMatch: ({ url }) => !!url, transform: ({ url, caption }) => { let value = `<a href="${url}">${url}</a>`; if (caption?.trim()) { value += `<br />${caption}`; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: value }); } }] }; /* harmony default export */ const embed_transforms = (embed_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ /** * The embed provider services. * * @type {WPBlockVariation[]} */ const embed_variations_variations = [{ name: 'twitter', title: 'Twitter', icon: embedTwitterIcon, keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'), patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], attributes: { providerNameSlug: 'twitter', responsive: true } }, { name: 'youtube', title: 'YouTube', icon: embedYouTubeIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'), patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i], attributes: { providerNameSlug: 'youtube', responsive: true } }, { // Deprecate Facebook Embed per FB policy // See: https://developers.facebook.com/docs/plugins/oembed-legacy name: 'facebook', title: 'Facebook', icon: embedFacebookIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'facebook', previewable: false, responsive: true } }, { // Deprecate Instagram per FB policy // See: https://developers.facebook.com/docs/instagram/oembed-legacy name: 'instagram', title: 'Instagram', icon: embedInstagramIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'instagram', responsive: true } }, { name: 'wordpress', title: 'WordPress', icon: embedWordPressIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'), attributes: { providerNameSlug: 'wordpress' } }, { name: 'soundcloud', title: 'SoundCloud', icon: embedAudioIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'), patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], attributes: { providerNameSlug: 'soundcloud', responsive: true } }, { name: 'spotify', title: 'Spotify', icon: embedSpotifyIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'), patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], attributes: { providerNameSlug: 'spotify', responsive: true } }, { name: 'flickr', title: 'Flickr', icon: embedFlickrIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('image')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'), patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i], attributes: { providerNameSlug: 'flickr', responsive: true } }, { name: 'vimeo', title: 'Vimeo', icon: embedVimeoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'), patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], attributes: { providerNameSlug: 'vimeo', responsive: true } }, { name: 'animoto', title: 'Animoto', icon: embedAnimotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'), patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], attributes: { providerNameSlug: 'animoto', responsive: true } }, { name: 'cloudup', title: 'Cloudup', icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'), patterns: [/^https?:\/\/cloudup\.com\/.+/i], attributes: { providerNameSlug: 'cloudup', responsive: true } }, { // Deprecated since CollegeHumor content is now powered by YouTube. name: 'collegehumor', title: 'CollegeHumor', icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'collegehumor', responsive: true } }, { name: 'crowdsignal', title: 'Crowdsignal', icon: embedContentIcon, keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'), patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i], attributes: { providerNameSlug: 'crowdsignal', responsive: true } }, { name: 'dailymotion', title: 'Dailymotion', icon: embedDailymotionIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'), patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], attributes: { providerNameSlug: 'dailymotion', responsive: true } }, { name: 'imgur', title: 'Imgur', icon: embedPhotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'), patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], attributes: { providerNameSlug: 'imgur', responsive: true } }, { name: 'issuu', title: 'Issuu', icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'), patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], attributes: { providerNameSlug: 'issuu', responsive: true } }, { name: 'kickstarter', title: 'Kickstarter', icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'), patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i], attributes: { providerNameSlug: 'kickstarter', responsive: true } }, { name: 'mixcloud', title: 'Mixcloud', icon: embedAudioIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'), patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], attributes: { providerNameSlug: 'mixcloud', responsive: true } }, { name: 'pocket-casts', title: 'Pocket Casts', icon: embedPocketCastsIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('podcast'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a podcast player from Pocket Casts.'), patterns: [/^https:\/\/pca.st\/\w+/i], attributes: { providerNameSlug: 'pocket-casts', responsive: true } }, { name: 'reddit', title: 'Reddit', icon: embedRedditIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'), patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], attributes: { providerNameSlug: 'reddit', responsive: true } }, { name: 'reverbnation', title: 'ReverbNation', icon: embedAudioIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'), patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], attributes: { providerNameSlug: 'reverbnation', responsive: true } }, { name: 'screencast', title: 'Screencast', icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'), patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i], attributes: { providerNameSlug: 'screencast', responsive: true } }, { name: 'scribd', title: 'Scribd', icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'), patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], attributes: { providerNameSlug: 'scribd', responsive: true } }, { name: 'smugmug', title: 'SmugMug', icon: embedPhotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'), patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], attributes: { providerNameSlug: 'smugmug', previewable: false, responsive: true } }, { name: 'speaker-deck', title: 'Speaker Deck', icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'), patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], attributes: { providerNameSlug: 'speaker-deck', responsive: true } }, { name: 'tiktok', title: 'TikTok', icon: embedVideoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'), patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], attributes: { providerNameSlug: 'tiktok', responsive: true } }, { name: 'ted', title: 'TED', icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'), patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], attributes: { providerNameSlug: 'ted', responsive: true } }, { name: 'tumblr', title: 'Tumblr', icon: embedTumblrIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'), patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], attributes: { providerNameSlug: 'tumblr', responsive: true } }, { name: 'videopress', title: 'VideoPress', icon: embedVideoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'), patterns: [/^https?:\/\/videopress\.com\/.+/i], attributes: { providerNameSlug: 'videopress', responsive: true } }, { name: 'wordpress-tv', title: 'WordPress.tv', icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'), patterns: [/^https?:\/\/wordpress\.tv\/.+/i], attributes: { providerNameSlug: 'wordpress-tv', responsive: true } }, { name: 'amazon-kindle', title: 'Amazon Kindle', icon: embedAmazonIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'), patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i], attributes: { providerNameSlug: 'amazon-kindle' } }, { name: 'pinterest', title: 'Pinterest', icon: embedPinterestIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'), patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i], attributes: { providerNameSlug: 'pinterest' } }, { name: 'wolfram-cloud', title: 'Wolfram', icon: embedWolframIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'), patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], attributes: { providerNameSlug: 'wolfram-cloud', responsive: true } }, { name: 'bluesky', title: 'Bluesky', icon: embedBlueskyIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a Bluesky post.'), patterns: [/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i], attributes: { providerNameSlug: 'bluesky' } }]; /** * Add `isActive` function to all `embed` variations, if not defined. * `isActive` function is used to find a variation match from a created * Block by providing its attributes. */ embed_variations_variations.forEach(variation => { if (variation.isActive) { return; } variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug; }); /* harmony default export */ const embed_variations = (embed_variations_variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js /** * External dependencies */ /** * Internal dependencies */ const embed_deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", __experimentalRole: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", __experimentalRole: "content" }, type: { type: "string", __experimentalRole: "content" }, providerNameSlug: { type: "string", __experimentalRole: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, __experimentalRole: "content" }, previewable: { type: "boolean", "default": true, __experimentalRole: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; /** * WordPress dependencies */ const { attributes: embed_deprecated_blockAttributes } = embed_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname // to the embed figcaption element. const deprecated_v2 = { attributes: embed_deprecated_blockAttributes, save({ attributes }) { const { url, caption, type, providerNameSlug } = attributes; if (!url) { return null; } const className = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: `\n${url}\n` /* URL needs to be on its own line. */ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; const embed_deprecated_v1 = { attributes: embed_deprecated_blockAttributes, save({ attributes: { url, caption, type, providerNameSlug } }) { if (!url) { return null; } const embedClassName = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: embedClassName, children: [`\n${url}\n` /* URL needs to be on its own line. */, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1]; /* harmony default export */ const embed_deprecated = (embed_deprecated_deprecated); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/embed/index.js /** * Internal dependencies */ const embed_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", __experimentalRole: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", __experimentalRole: "content" }, type: { type: "string", __experimentalRole: "content" }, providerNameSlug: { type: "string", __experimentalRole: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, __experimentalRole: "content" }, previewable: { type: "boolean", "default": true, __experimentalRole: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; const { name: embed_name } = embed_metadata; const embed_settings = { icon: embedContentIcon, edit: embed_edit, save: embed_save_save, transforms: embed_transforms, variations: embed_variations, deprecated: embed_deprecated }; const embed_init = () => initBlock({ name: embed_name, metadata: embed_metadata, settings: embed_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js /** * WordPress dependencies */ const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); /* harmony default export */ const library_file = (file); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ // Version of the file block without PR#43050 removing the translated aria-label. const deprecated_v3 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileId: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'id' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; // In #41239 the button was made an element button which added a `wp-element-button` classname // to the download link element. const file_deprecated_v2 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileId: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'id' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: "wp-block-file__button", download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; // Version of the file block without PR#28062 accessibility fix. const file_deprecated_v1 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: "wp-block-file__button", download: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1]; /* harmony default export */ const file_deprecated = (file_deprecated_deprecated); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/inspector.js /** * WordPress dependencies */ /** * Internal dependencies */ function FileBlockInspector({ hrefs, openInNewWindow, showDownloadButton, changeLinkDestinationOption, changeOpenInNewWindow, changeShowDownloadButton, displayPreview, changeDisplayPreview, previewHeight, changePreviewHeight }) { const { href, textLinkHref, attachmentPage } = hrefs; let linkDestinationOptions = [{ value: href, label: (0,external_wp_i18n_namespaceObject.__)('URL') }]; if (attachmentPage) { linkDestinationOptions = [{ value: href, label: (0,external_wp_i18n_namespaceObject.__)('Media file') }, { value: attachmentPage, label: (0,external_wp_i18n_namespaceObject.__)('Attachment page') }]; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: [href.endsWith('.pdf') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('PDF settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'), help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, checked: !!displayPreview, onChange: changeDisplayPreview }), displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'), min: MIN_PREVIEW_HEIGHT, max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight), value: previewHeight, onChange: changePreviewHeight })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to'), value: textLinkHref, options: linkDestinationOptions, onChange: changeLinkDestinationOption }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), checked: openInNewWindow, onChange: changeOpenInNewWindow }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show download button'), checked: showDownloadButton, onChange: changeShowDownloadButton })] })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. * * @return {boolean} Whether or not the browser supports inline PDFs. */ const browserSupportsPdfs = () => { // Most mobile devices include "Mobi" in their UA. if (window.navigator.userAgent.indexOf('Mobi') > -1) { return false; } // Android tablets are the noteable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } // iPad pretends to be a Mac. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { return false; } // IE only supports PDFs when there's an ActiveX object available for it. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { return false; } return true; }; /** * Helper function for creating ActiveX objects, catching any errors that are thrown * when it's generated. * * @param {string} type The name of the ActiveX object to create. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. */ const createActiveXObject = type => { let ax; try { ax = new window.ActiveXObject(type); } catch (e) { ax = undefined; } return ax; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const MIN_PREVIEW_HEIGHT = 200; const MAX_PREVIEW_HEIGHT = 2000; function ClipboardToolbarButton({ text, disabled }) { const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { isDismissible: true, type: 'snackbar' }); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-clipboard-toolbar-button", ref: ref, disabled: disabled, children: (0,external_wp_i18n_namespaceObject.__)('Copy URL') }); } function FileEdit({ attributes, isSelected, setAttributes, clientId }) { const { id, fileName, href, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const { media } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id) }), [id]); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { toggleSelection, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); useUploadMediaFromBlobURL({ url: href, onChange: onSelectFile, onError: onUploadError }); // Note: Handle setting a default value for `downloadButtonText` via HTML API // when it supports replacing text content for HTML tags. (0,external_wp_element_namespaceObject.useEffect)(() => { if (external_wp_blockEditor_namespaceObject.RichText.isEmpty(downloadButtonText)) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ downloadButtonText: (0,external_wp_i18n_namespaceObject._x)('Download', 'button label') }); } // Reason: This effect should only run on mount. // eslint-disable-next-line react-hooks/exhaustive-deps }, []); function onSelectFile(newMedia) { if (!newMedia || !newMedia.url) { return; } const isPdf = newMedia.url.endsWith('.pdf'); setAttributes({ href: newMedia.url, fileName: newMedia.title, textLinkHref: newMedia.url, id: newMedia.id, displayPreview: isPdf ? true : undefined, previewHeight: isPdf ? 600 : undefined, fileId: `wp-block-file--media-${clientId}` }); } function onUploadError(message) { setAttributes({ href: undefined }); createErrorNotice(message, { type: 'snackbar' }); } function changeLinkDestinationOption(newHref) { // Choose Media File or Attachment Page (when file is in Media Library). setAttributes({ textLinkHref: newHref }); } function changeOpenInNewWindow(newValue) { setAttributes({ textLinkTarget: newValue ? '_blank' : false }); } function changeShowDownloadButton(newValue) { setAttributes({ showDownloadButton: newValue }); } function changeDisplayPreview(newValue) { setAttributes({ displayPreview: newValue }); } function handleOnResizeStop(event, direction, elt, delta) { toggleSelection(true); const newHeight = parseInt(previewHeight + delta.height, 10); setAttributes({ previewHeight: newHeight }); } function changePreviewHeight(newValue) { const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT); setAttributes({ previewHeight: newHeight }); } const attachmentPage = media && media.link; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx((0,external_wp_blob_namespaceObject.isBlobURL)(href) && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({ type: 'loading' }), { 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(href) }) }); const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; if (!href) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_file }), labels: { title: (0,external_wp_i18n_namespaceObject.__)('File'), instructions: (0,external_wp_i18n_namespaceObject.__)('Upload a file or pick one from your media library.') }, onSelect: onSelectFile, onError: onUploadError, accept: "*" }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FileBlockInspector, { hrefs: { href, textLinkHref, attachmentPage }, openInNewWindow: !!textLinkTarget, showDownloadButton, changeLinkDestinationOption, changeOpenInNewWindow, changeShowDownloadButton, displayPreview, changeDisplayPreview, previewHeight, changePreviewHeight }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: href, accept: "*", onSelect: onSelectFile, onError: onUploadError }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClipboardToolbarButton, { text: href, disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [displayPreviewInEditor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, { size: { height: previewHeight }, minHeight: MIN_PREVIEW_HEIGHT, maxHeight: MAX_PREVIEW_HEIGHT, minWidth: "100%", grid: [10, 10], enable: { top: false, right: false, bottom: true, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, onResizeStart: () => toggleSelection(false), onResizeStop: handleOnResizeStop, showHandle: isSelected, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__preview", data: href, type: "application/pdf", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.') }), !isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-file__preview-overlay" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-file__content-wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "fileName", tagName: "a", value: fileName, placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'), withoutInteractiveFormatting: true, onChange: text => setAttributes({ fileName: removeAnchorTag(text) }), href: textLinkHref }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-file__button-richtext-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "downloadButtonText", tagName: "div" // Must be block-level or else cursor disappears. , "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'), className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), value: downloadButtonText, withoutInteractiveFormatting: true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'), onChange: text => setAttributes({ downloadButtonText: removeAnchorTag(text) }) }) })] })] })] }); } /* harmony default export */ const file_edit = (FileEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/save.js /** * External dependencies */ /** * WordPress dependencies */ function file_save_save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF embed' : // To do: use toPlainText, but we need ensure it's RichTextData. See // https://github.com/WordPress/gutenberg/pull/56710. fileName.toString(); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/transforms.js /** * WordPress dependencies */ const file_transforms_transforms = { from: [{ type: 'files', isMatch(files) { return files.length > 0; }, // We define a lower priorty (higher number) than the default of 10. This // ensures that the File block is only created as a fallback. priority: 15, transform: files => { const blocks = []; files.forEach(file => { const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount() blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: blobURL, fileName: file.name, textLinkHref: blobURL })); }); return blocks; } }, { type: 'block', blocks: ['core/audio'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/video'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/image'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.url, fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url), textLinkHref: attributes.url, id: attributes.id, anchor: attributes.anchor }); } }], to: [{ type: 'block', blocks: ['core/audio'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('audio'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { src: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/video'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('video'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { src: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/image'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('image'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { url: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }] }; /* harmony default export */ const file_transforms = (file_transforms_transforms); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const file_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/file", title: "File", category: "media", description: "Add a link to a downloadable file.", keywords: ["document", "pdf", "download"], textdomain: "default", attributes: { id: { type: "number" }, href: { type: "string" }, fileId: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "id" }, fileName: { type: "rich-text", source: "rich-text", selector: "a:not([download])" }, textLinkHref: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "href" }, textLinkTarget: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "target" }, showDownloadButton: { type: "boolean", "default": true }, downloadButtonText: { type: "rich-text", source: "rich-text", selector: "a[download]" }, displayPreview: { type: "boolean" }, previewHeight: { type: "number", "default": 600 } }, supports: { anchor: true, align: true, spacing: { margin: true, padding: true }, color: { gradients: true, link: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, interactivity: true }, editorStyle: "wp-block-file-editor", style: "wp-block-file" }; const { name: file_name } = file_metadata; const file_settings = { icon: library_file, example: { attributes: { href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg', fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file') } }, transforms: file_transforms, deprecated: file_deprecated, edit: file_edit, save: file_save_save }; const file_init = () => initBlock({ name: file_name, metadata: file_metadata, settings: file_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/utils.js /** * WordPress dependencies */ const formSubmissionNotificationSuccess = ['core/form-submission-notification', { type: 'success' }, [['core/paragraph', { content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully') + '</mark>' }]]]; const formSubmissionNotificationError = ['core/form-submission-notification', { type: 'error' }, [['core/paragraph', { content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.') + '</mark>' }]]]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_edit_TEMPLATE = [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/form-input', { type: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Name'), required: true }], ['core/form-input', { type: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Email'), required: true }], ['core/form-input', { type: 'textarea', label: (0,external_wp_i18n_namespaceObject.__)('Comment'), required: true }], ['core/form-submit-button', {}]]; const form_edit_Edit = ({ attributes, setAttributes, clientId }) => { const { action, method, email, submissionMethod } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { hasInnerBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock } = select(external_wp_blockEditor_namespaceObject.store); const block = getBlock(clientId); return { hasInnerBlocks: !!(block && block.innerBlocks.length) }; }, [clientId]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_edit_TEMPLATE, renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl // __nextHasNoMarginBottom // size={ '__unstable-large' } , { label: (0,external_wp_i18n_namespaceObject.__)('Submissions method'), options: [ // TODO: Allow plugins to add their own submission methods. { label: (0,external_wp_i18n_namespaceObject.__)('Send email'), value: 'email' }, { label: (0,external_wp_i18n_namespaceObject.__)('- Custom -'), value: 'custom' }], value: submissionMethod, onChange: value => setAttributes({ submissionMethod: value }), help: submissionMethod === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') }), submissionMethod === 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Email for form submissions'), value: email, required: true, onChange: value => { setAttributes({ email: value }); setAttributes({ action: `mailto:${value}` }); setAttributes({ method: 'post' }); }, help: (0,external_wp_i18n_namespaceObject.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.') })] }) }), submissionMethod !== 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Method'), options: [{ label: 'Get', value: 'get' }, { label: 'Post', value: 'post' }], value: method, onChange: value => setAttributes({ method: value }), help: (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Form action'), value: action, onChange: newVal => { setAttributes({ action: newVal }); }, help: (0,external_wp_i18n_namespaceObject.__)('The URL where the form should be submitted.') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { ...innerBlocksProps, className: "wp-block-form", encType: submissionMethod === 'email' ? 'text/plain' : null })] }); }; /* harmony default export */ const form_edit = (form_edit_Edit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/save.js /** * WordPress dependencies */ function form_save_save({ attributes }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const { submissionMethod } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { ...blockProps, className: "wp-block-form", encType: submissionMethod === 'email' ? 'text/plain' : null, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_variations_variations = [{ name: 'comment-form', title: (0,external_wp_i18n_namespaceObject.__)('Experimental Comment form'), description: (0,external_wp_i18n_namespaceObject.__)('A comment form for posts and pages.'), attributes: { submissionMethod: 'custom', action: '{SITE_URL}/wp-comments-post.php', method: 'post', anchor: 'comment-form' }, isDefault: false, innerBlocks: [['core/form-input', { type: 'text', name: 'author', label: (0,external_wp_i18n_namespaceObject.__)('Name'), required: true, visibilityPermissions: 'logged-out' }], ['core/form-input', { type: 'email', name: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Email'), required: true, visibilityPermissions: 'logged-out' }], ['core/form-input', { type: 'textarea', name: 'comment', label: (0,external_wp_i18n_namespaceObject.__)('Comment'), required: true, visibilityPermissions: 'all' }], ['core/form-submit-button', {}]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }, { name: 'wp-privacy-form', title: (0,external_wp_i18n_namespaceObject.__)('Experimental privacy request form'), keywords: ['GDPR'], description: (0,external_wp_i18n_namespaceObject.__)('A form to request data exports and/or deletion.'), attributes: { submissionMethod: 'custom', action: '', method: 'post', anchor: 'gdpr-form' }, isDefault: false, innerBlocks: [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.') }], ['core/form-input', { type: 'email', name: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Enter your email address.'), required: true, visibilityPermissions: 'all' }], ['core/form-input', { type: 'checkbox', name: 'export_personal_data', label: (0,external_wp_i18n_namespaceObject.__)('Request data export'), required: false, visibilityPermissions: 'all' }], ['core/form-input', { type: 'checkbox', name: 'remove_personal_data', label: (0,external_wp_i18n_namespaceObject.__)('Request data deletion'), required: false, visibilityPermissions: 'all' }], ['core/form-submit-button', {}], ['core/form-input', { type: 'hidden', name: 'wp-action', value: 'wp_privacy_send_request' }], ['core/form-input', { type: 'hidden', name: 'wp-privacy-request', value: '1' }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }]; /* harmony default export */ const form_variations = (form_variations_variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form/index.js /** * Internal dependencies */ const form_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form", title: "Form", category: "common", allowedBlocks: ["core/paragraph", "core/heading", "core/form-input", "core/form-submit-button", "core/form-submission-notification", "core/group", "core/columns"], description: "A form.", keywords: ["container", "wrapper", "row", "section"], textdomain: "default", icon: "feedback", attributes: { submissionMethod: { type: "string", "default": "email" }, method: { type: "string", "default": "post" }, action: { type: "string" }, email: { type: "string" } }, supports: { anchor: true, className: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalSelector: "form" }, viewScript: "file:./view.min.js" }; /** * WordPress dependencies */ const { name: form_name } = form_metadata; const form_settings = { edit: form_edit, save: form_save_save, variations: form_variations }; const form_init = () => { // Prevent adding forms inside forms. const DISALLOWED_PARENTS = ['core/form']; (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/preventInsertingFormIntoAnotherForm', (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { if (blockType.name !== 'core/form') { return canInsert; } for (const disallowedParentType of DISALLOWED_PARENTS) { const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; if (hasDisallowedParent) { return false; } } return true; }); return initBlock({ name: form_name, metadata: form_metadata, settings: form_settings }); }; // EXTERNAL MODULE: ./node_modules/remove-accents/index.js var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// CONCATENATED MODULE: external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const getNameFromLabelV1 = content => { return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) // Convert anything that's not a letter or number to a hyphen. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase .toLowerCase() // Remove any remaining leading or trailing hyphens. .replace(/(^-+)|(-+$)/g, ''); }; // Version without wrapper div in saved markup // See: https://github.com/WordPress/gutenberg/pull/56507 const form_input_deprecated_v1 = { attributes: { type: { type: 'string', default: 'text' }, name: { type: 'string' }, label: { type: 'string', default: 'Label', selector: '.wp-block-form-input__label-content', source: 'html', __experimentalRole: 'content' }, inlineLabel: { type: 'boolean', default: false }, required: { type: 'boolean', default: false, selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'required' }, placeholder: { type: 'string', selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'placeholder', __experimentalRole: 'content' }, value: { type: 'string', default: '', selector: 'input', source: 'attribute', attribute: 'value' }, visibilityPermissions: { type: 'string', default: 'all' } }, supports: { className: false, anchor: true, reusable: false, spacing: { margin: ['top', 'bottom'] }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } } }, save({ attributes }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const inputStyle = { ...borderProps.style, ...colorProps.style }; const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); const TagName = type === 'textarea' ? 'textarea' : 'input'; if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: type, name: name, value: value }); } /* eslint-disable jsx-a11y/label-has-associated-control */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { className: inputClasses, type: 'textarea' === type ? undefined : type, name: name || getNameFromLabelV1(label), required: required, "aria-required": required, placeholder: placeholder || undefined, style: inputStyle })] }); /* eslint-enable jsx-a11y/label-has-associated-control */ } }; const form_input_deprecated_deprecated = [form_input_deprecated_v1]; /* harmony default export */ const form_input_deprecated = (form_input_deprecated_deprecated); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/edit.js /** * External dependencies */ /** * WordPress dependencies */ function InputFieldBlock({ attributes, setAttributes, className }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const ref = (0,external_wp_element_namespaceObject.useRef)(); const TagName = type === 'textarea' ? 'textarea' : 'input'; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); if (ref.current) { ref.current.focus(); } const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: ['hidden' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: ['checkbox' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { label: (0,external_wp_i18n_namespaceObject.__)('Inline label'), checked: inlineLabel, onChange: newVal => { setAttributes({ inlineLabel: newVal }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { label: (0,external_wp_i18n_namespaceObject.__)('Required'), checked: required, onChange: newVal => { setAttributes({ required: newVal }); } })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: name, onChange: newVal => { setAttributes({ name: newVal }); }, help: (0,external_wp_i18n_namespaceObject.__)('Affects the "name" atribute of the input element, and is used as a name for the form submission results.') }) })] }); if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: "hidden", className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Value'), value: value, onChange: event => setAttributes({ value: event.target.value }) })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel || 'checkbox' === type }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "span", className: "wp-block-form-input__label-content", value: label, onChange: newLabel => setAttributes({ label: newLabel }), "aria-label": label ? (0,external_wp_i18n_namespaceObject.__)('Label') : (0,external_wp_i18n_namespaceObject.__)('Empty label'), "data-empty": label ? false : true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Type the label for this input') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { type: 'textarea' === type ? undefined : type, className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This // stops screen readers from reading the placeholder field's placeholder // which is confusing. , placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), value: placeholder, onChange: event => setAttributes({ placeholder: event.target.value }), "aria-required": required, style: { ...borderProps.style, ...colorProps.style } })] })] }); } /* harmony default export */ const form_input_edit = (InputFieldBlock); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/save.js /** * External dependencies */ /** * WordPress dependencies */ /** * Get the name attribute from a content string. * * @param {string} content The block content. * * @return {string} Returns the slug. */ const getNameFromLabel = content => { return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) // Convert anything that's not a letter or number to a hyphen. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase .toLowerCase() // Remove any remaining leading or trailing hyphens. .replace(/(^-+)|(-+$)/g, ''); }; function form_input_save_save({ attributes }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const inputStyle = { ...borderProps.style, ...colorProps.style }; const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); const TagName = type === 'textarea' ? 'textarea' : 'input'; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: type, name: name, value: value }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { className: inputClasses, type: 'textarea' === type ? undefined : type, name: name || getNameFromLabel(label), required: required, "aria-required": required, placeholder: placeholder || undefined, style: inputStyle })] }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/variations.js /** * WordPress dependencies */ const form_input_variations_variations = [{ name: 'text', title: (0,external_wp_i18n_namespaceObject.__)('Text Input'), icon: 'edit-page', description: (0,external_wp_i18n_namespaceObject.__)('A generic text input.'), attributes: { type: 'text' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }, { name: 'textarea', title: (0,external_wp_i18n_namespaceObject.__)('Textarea Input'), icon: 'testimonial', description: (0,external_wp_i18n_namespaceObject.__)('A textarea input to allow entering multiple lines of text.'), attributes: { type: 'textarea' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'textarea' }, { name: 'checkbox', title: (0,external_wp_i18n_namespaceObject.__)('Checkbox Input'), description: (0,external_wp_i18n_namespaceObject.__)('A simple checkbox input.'), icon: 'forms', attributes: { type: 'checkbox', inlineLabel: true }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'checkbox' }, { name: 'email', title: (0,external_wp_i18n_namespaceObject.__)('Email Input'), icon: 'email', description: (0,external_wp_i18n_namespaceObject.__)('Used for email addresses.'), attributes: { type: 'email' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'email' }, { name: 'url', title: (0,external_wp_i18n_namespaceObject.__)('URL Input'), icon: 'admin-site', description: (0,external_wp_i18n_namespaceObject.__)('Used for URLs.'), attributes: { type: 'url' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'url' }, { name: 'tel', title: (0,external_wp_i18n_namespaceObject.__)('Telephone Input'), icon: 'phone', description: (0,external_wp_i18n_namespaceObject.__)('Used for phone numbers.'), attributes: { type: 'tel' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'tel' }, { name: 'number', title: (0,external_wp_i18n_namespaceObject.__)('Number Input'), icon: 'edit-page', description: (0,external_wp_i18n_namespaceObject.__)('A numeric input.'), attributes: { type: 'number' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'number' }]; /* harmony default export */ const form_input_variations = (form_input_variations_variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-input/index.js /** * Internal dependencies */ const form_input_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-input", title: "Input Field", category: "common", ancestor: ["core/form"], description: "The basic building block for forms.", keywords: ["input", "form"], textdomain: "default", icon: "forms", attributes: { type: { type: "string", "default": "text" }, name: { type: "string" }, label: { type: "rich-text", "default": "Label", selector: ".wp-block-form-input__label-content", source: "rich-text", __experimentalRole: "content" }, inlineLabel: { type: "boolean", "default": false }, required: { type: "boolean", "default": false, selector: ".wp-block-form-input__input", source: "attribute", attribute: "required" }, placeholder: { type: "string", selector: ".wp-block-form-input__input", source: "attribute", attribute: "placeholder", __experimentalRole: "content" }, value: { type: "string", "default": "", selector: "input", source: "attribute", attribute: "value" }, visibilityPermissions: { type: "string", "default": "all" } }, supports: { anchor: true, reusable: false, spacing: { margin: ["top", "bottom"] }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } } }, style: ["wp-block-form-input"] }; const { name: form_input_name } = form_input_metadata; const form_input_settings = { deprecated: form_input_deprecated, edit: form_input_edit, save: form_input_save_save, variations: form_input_variations }; const form_input_init = () => initBlock({ name: form_input_name, metadata: form_input_metadata, settings: form_input_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/edit.js /** * WordPress dependencies */ const form_submit_button_edit_TEMPLATE = [['core/buttons', {}, [['core/button', { text: (0,external_wp_i18n_namespaceObject.__)('Submit'), tagName: 'button', type: 'submit' }]]]]; const form_submit_button_edit_Edit = () => { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_submit_button_edit_TEMPLATE, templateLock: 'all' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-form-submit-wrapper", ...innerBlocksProps }); }; /* harmony default export */ const form_submit_button_edit = (form_submit_button_edit_Edit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/save.js /** * WordPress dependencies */ function form_submit_button_save_save() { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-form-submit-wrapper", ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js /** * Internal dependencies */ const form_submit_button_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-submit-button", title: "Form Submit Button", category: "common", icon: "button", ancestor: ["core/form"], allowedBlocks: ["core/buttons", "core/button"], description: "A submission button for forms.", keywords: ["submit", "button", "form"], textdomain: "default", style: ["wp-block-form-submit-button"] }; const { name: form_submit_button_name } = form_submit_button_metadata; const form_submit_button_settings = { edit: form_submit_button_edit, save: form_submit_button_save_save }; const form_submit_button_init = () => initBlock({ name: form_submit_button_name, metadata: form_submit_button_metadata, settings: form_submit_button_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/group.js /** * WordPress dependencies */ const group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) }); /* harmony default export */ const library_group = (group); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/edit.js /** * WordPress dependencies */ /** * External dependencies */ const form_submission_notification_edit_TEMPLATE = [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)("Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.") }]]; const form_submission_notification_edit_Edit = ({ attributes, clientId }) => { const { type } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('wp-block-form-submission-notification', { [`form-notification-type-${type}`]: type }) }); const { hasInnerBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock } = select(external_wp_blockEditor_namespaceObject.store); const block = getBlock(clientId); return { hasInnerBlocks: !!(block && block.innerBlocks.length) }; }, [clientId]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_submission_notification_edit_TEMPLATE, renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps, "data-message-success": (0,external_wp_i18n_namespaceObject.__)('Submission success notification'), "data-message-error": (0,external_wp_i18n_namespaceObject.__)('Submission error notification') }); }; /* harmony default export */ const form_submission_notification_edit = (form_submission_notification_edit_Edit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/save.js /** * WordPress dependencies */ /** * External dependencies */ function form_submission_notification_save_save({ attributes }) { const { type } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx('wp-block-form-submission-notification', { [`form-notification-type-${type}`]: type }) })) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/variations.js /** * WordPress dependencies */ const form_submission_notification_variations_variations = [{ name: 'form-submission-success', title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Success'), description: (0,external_wp_i18n_namespaceObject.__)('Success message for form submissions.'), attributes: { type: 'success' }, isDefault: true, innerBlocks: [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully.'), backgroundColor: '#00D084', textColor: '#000000', style: { elements: { link: { color: { text: '#000000' } } } } }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'success' }, { name: 'form-submission-error', title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Error'), description: (0,external_wp_i18n_namespaceObject.__)('Error/failure message for form submissions.'), attributes: { type: 'error' }, isDefault: false, innerBlocks: [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.'), backgroundColor: '#CF2E2E', textColor: '#FFFFFF', style: { elements: { link: { color: { text: '#FFFFFF' } } } } }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'error' }]; /* harmony default export */ const form_submission_notification_variations = (form_submission_notification_variations_variations); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_submission_notification_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-submission-notification", title: "Form Submission Notification", category: "common", ancestor: ["core/form"], description: "Provide a notification message after the form has been submitted.", keywords: ["form", "feedback", "notification", "message"], textdomain: "default", icon: "feedback", attributes: { type: { type: "string", "default": "success" } } }; const { name: form_submission_notification_name } = form_submission_notification_metadata; const form_submission_notification_settings = { icon: library_group, edit: form_submission_notification_edit, save: form_submission_notification_save_save, variations: form_submission_notification_variations }; const form_submission_notification_init = () => initBlock({ name: form_submission_notification_name, metadata: form_submission_notification_metadata, settings: form_submission_notification_settings }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/gallery.js /** * WordPress dependencies */ const gallery = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_gallery = (gallery); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/constants.js const LINK_DESTINATION_NONE = 'none'; const LINK_DESTINATION_MEDIA = 'media'; const LINK_DESTINATION_ATTACHMENT = 'attachment'; const LINK_DESTINATION_MEDIA_WP_CORE = 'file'; const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/shared.js /** * WordPress dependencies */ function defaultColumnsNumber(imageCount) { return imageCount ? Math.min(3, imageCount) : 3; } const pickRelevantMediaFiles = (image, sizeSlug = 'large') => { const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link'].includes(key))); imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; if (fullUrl) { imageProps.fullUrl = fullUrl; } return imageProps; }; function getGalleryBlockV2Enabled() { // We want to fail early here, at least during beta testing phase, to ensure // there aren't instances where undefined values cause false negatives. if (!window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean') { throw 'window.wp.galleryBlockV2Enabled is not defined'; } return window.wp.galleryBlockV2Enabled; } /** * The new gallery block format is not compatible with the use_BalanceTags option * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The * window.wp.galleryBlockV2Enabled flag is set in lib/compat.php. This method * can be removed when minimum supported WP version >=5.9. */ function isGalleryV2Enabled() { if (external_wp_element_namespaceObject.Platform.isNative) { return getGalleryBlockV2Enabled(); } return true; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const DEPRECATED_LINK_DESTINATION_MEDIA = 'file'; const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post'; /** * Original function to determine default number of columns from a block's * attributes. * * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks. * * @param {Object} attributes Block attributes. * @return {number} Default number of columns for the gallery. */ function defaultColumnsNumberV1(attributes) { return Math.min(3, attributes?.images?.length); } /** * Original function to determine new href and linkDestination values for an image block from the * supplied Gallery link destination. * * Used in deprecations: v1-6. * * @param {Object} image Gallery image. * @param {string} destination Gallery's selected link destination. * @return {Object} New attributes to assign to image block. */ function getHrefAndDestination(image, destination) { // Need to determine the URL that the selected destination maps to. // Gutenberg and WordPress use different constants so the new link // destination also needs to be tweaked. switch (destination) { case DEPRECATED_LINK_DESTINATION_MEDIA: return { href: image?.source_url || image?.url, // eslint-disable-line camelcase linkDestination: LINK_DESTINATION_MEDIA }; case DEPRECATED_LINK_DESTINATION_ATTACHMENT: return { href: image?.link, linkDestination: LINK_DESTINATION_ATTACHMENT }; case LINK_DESTINATION_MEDIA: return { href: image?.source_url || image?.url, // eslint-disable-line camelcase linkDestination: LINK_DESTINATION_MEDIA }; case LINK_DESTINATION_ATTACHMENT: return { href: image?.link, linkDestination: LINK_DESTINATION_ATTACHMENT }; case LINK_DESTINATION_NONE: return { href: undefined, linkDestination: LINK_DESTINATION_NONE }; } return {}; } function runV2Migration(attributes) { let linkTo = attributes.linkTo ? attributes.linkTo : 'none'; if (linkTo === 'post') { linkTo = 'attachment'; } else if (linkTo === 'file') { linkTo = 'media'; } const imageBlocks = attributes.images.map(image => { return getImageBlock(image, attributes.sizeSlug, linkTo); }); const { images, ids, ...restAttributes } = attributes; return [{ ...restAttributes, linkTo, allowResize: false }, imageBlocks]; } /** * Gets an Image block from gallery image data * * Used to migrate Galleries to nested Image InnerBlocks. * * @param {Object} image Image properties. * @param {string} sizeSlug Gallery sizeSlug attribute. * @param {string} linkTo Gallery linkTo attribute. * @return {Object} Image block. */ function getImageBlock(image, sizeSlug, linkTo) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && { id: parseInt(image.id) }), url: image.url, alt: image.alt, caption: image.caption, sizeSlug, ...getHrefAndDestination(image, linkTo) }); } // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname // to the gallery figcaption element. const deprecated_v7 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', items: { type: 'number' }, default: [] }, shortCodeTransforms: { type: 'array', default: [], items: { type: 'object' } }, columns: { type: 'number', minimum: 1, maximum: 8 }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, fixedHeight: { type: 'boolean', default: true }, linkTarget: { type: 'string' }, linkTo: { type: 'string' }, sizeSlug: { type: 'string', default: 'large' }, allowResize: { type: 'boolean', default: false } }, save({ attributes }) { const { caption, columns, imageCrop } = attributes; const className = dist_clsx('has-nested-images', { [`columns-${columns}`]: columns !== undefined, [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }); const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...innerBlocksProps, children: [innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })] }); } }; const deprecated_v6 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', items: { type: 'number' }, default: [] }, columns: { type: 'number', minimum: 1, maximum: 8 }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, fixedHeight: { type: 'boolean', default: true }, linkTo: { type: 'string' }, sizeSlug: { type: 'string', default: 'large' } }, supports: { anchor: true, align: true }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, caption, linkTo } = attributes; const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({
•
Search:
•
Replace:
1
2
3
4
5
6
7
Function
Edit by line
Download
Information
Rename
Copy
Move
Delete
Chmod
List