diff --git a/.deployignore b/.deployignore deleted file mode 100644 index 29039ea66..000000000 --- a/.deployignore +++ /dev/null @@ -1,31 +0,0 @@ -.DS_Store -*.zip -tags -composer.lock -vendor -node_modules -npm-debug.log - -# IDEs -.idea -.vscode - -# Directories and files that we do not want to be included with the built -# version and deployed to WordPress.org. -.babelrc -.editorconfig -.eslintignore -.eslintrc.json -.github -.travis.yml -assets/js/pluginsidebar -assets/js/util -bin -composer.json -package.json -package-lock.json -phpcs.xml.dist -phpunit.xml.dist -README.md -tests -webpack.config.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 7e4af6942..000000000 --- a/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -root = true - -# For all files: -# - UTF-8 -# - Unix newlines -# - Insert new line at the end -# - trim whitespace at end of lines -# - Use 2 spaces for indentation -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -tab_style = space -indent_size = 2 - -# For PHP files only: -# - Use tabs (following WordPress conventions) for indentation -# - Show tab width as 2 spaces (inherit from indent_size) -[*.php] -indent_style = tab diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 118471156..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "jest": true, - "node": true - }, - "extends": ["airbnb", "airbnb/hooks"], - "ignorePatterns": [ - "!assets/js", - "assets/js/*", - "!assets/js/components", - "!assets/js/config", - "!assets/js/pluginsidebar", - "!assets/js/services", - "!assets/js/util", - "build", - "vendor" - ], - "parser": "@babel/eslint-parser", - "parserOptions": { - "ecmaFeatures": { - "globalReturn": true, - "impliedStrict": true, - "jsx": true - }, - "sourceType": "module" - } -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 804636ebb..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - push: - tags: - - 'v*.*.*' # Push events to matching v* (eg. v2.0.8) - - '!*-built' # Exclude built branches (eg. v2.0.8-built) - -name: Trigger Build - -jobs: - build: - name: Trigger Build - runs-on: ubuntu-latest - - steps: - - name: 'curl to build server' - shell: bash - env: - URL: ${{ secrets.DB_BUILD_URL }} - TOKEN: ${{ secrets.DB_BUILD_SECRET }} - ENV_ID: ${{ secrets.DB_BUILD_ENV }} - run: | - curl -s "$URL" \ - -X POST \ - -H "X-Api-Token: $TOKEN" \ - -d "{\"environment_id\":${ENV_ID},\"deploy_from_scratch\":true,\"trigger_notifications\":true,\"comment\":\"Build Trigger from GitHub Actions\"}" diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml deleted file mode 100644 index 37dde86c3..000000000 --- a/.github/workflows/linting.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Linting - -on: - pull_request: - -jobs: - PHPCompatibility: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: ['7.4', '7.3', '7.2', '7.1', '7.0', '5.6'] - - name: PHPCompatibility - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Get Composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Set up Composer caching - uses: actions/cache@v2 - env: - cache-name: cache-composer-dependencies - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd - tools: composer:v2 - coverage: none - - - name: Install composer dependencies - if: ${{ matrix.php != '5.6' }} - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer install - - - name: Install phpcs - if: ${{ matrix.php == '5.6' }} - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer global require "phpunit/phpunit=5.7.*" "alleyinteractive/alley-coding-standards" - - - name: PHPCompatibility for ${{ matrix.php }} - run: composer phpcs -- --standard=PHPCompatibility --extensions=php --runtime-set testVersion ${{ matrix.php }} --ignore="/vendor/*" --ignore="/node-modules/*" - - coding-standards: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - name: Coding Standards - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Get Composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Set up Composer caching - uses: actions/cache@v2 - env: - cache-name: cache-composer-dependencies - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd - tools: composer:v2 - coverage: none - - - name: Install composer dependencies - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer install - - - name: Coding standards - run: composer phpcs diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml deleted file mode 100644 index 71ca88900..000000000 --- a/.github/workflows/node-tests.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Node Tests - -on: - pull_request: - -jobs: - npm-ci: - name: (npm) Install, build, and test - runs-on: ubuntu-latest - strategy: - fail-fast: true - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: 14 - - name: Install npm 7 - run: npm i -g npm@7 - - name: Install node dependencies (npm ci) - run: npm ci - - name: Run npm lint - run: npm run lint - - name: Run npm test - run: npm run test - - name: Run npm build - run: npm run build diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index de8010972..000000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Unit Tests - -on: - pull_request: - -jobs: - tests: - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - continue-on-error: ${{ matrix.can_fail }} - strategy: - fail-fast: true - matrix: - wp_version: ["latest"] - can_fail: [false] - multisite: [0,1] - - name: phpunit '7.4' @ WP ${{ matrix.wp_version }} WP_MULTISITE=${{ matrix.multisite }} - env: - CACHEDIR: /tmp/test-cache - WP_CORE_DIR: /tmp/wordpress/ - WP_VERSION: ${{ matrix.wp_version }} - WP_MULTISITE: ${{ matrix.multisite }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Get Composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Set up Composer caching - uses: actions/cache@v2 - env: - cache-name: cache-composer-dependencies - with: - path: | - ${{ steps.composer-cache.outputs.dir }} - /tmp/test-cache - /tmp/wordpress - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd - tools: composer:v2 - coverage: none - - - name: Validate Composer - run: composer validate --strict - - - name: Install dependencies - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer install - - - name: Install WordPress and Copy Project - shell: bash - run: | - bash bin/install-wp-tests.sh wordpress_unit_tests root '' 127.0.0.1 $WP_VERSION - - # Go into the core directory and replace wp-content. - # mkdir -p ${WP_CORE_DIR}/wp-content/plugins/apple-news - rm -rf ${WP_CORE_DIR}/wp-content/plugins/apple-news - rsync -aWq --no-compress . ${WP_CORE_DIR}/wp-content/plugins/apple-news - - - name: Test Plugin - shell: bash - run: | - cd ${WP_CORE_DIR}/wp-content/plugins/apple-news - composer run phpunit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 24fb4daf8..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - push: - tags: - - 'v*-built' # Create releases for built branches (eg. v2.0.8-built) - -name: Create -built release - -jobs: - release: - name: Create release - runs-on: ubuntu-latest - - steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by Actions - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: A version that contains pre-built JavaScript assets for Gutenberg. This version matches what is deployed to WordPress.org, minus some development and wiki image files, and is suitable for inclusion via submodule. - draft: false - prerelease: true diff --git a/.gitignore b/.gitignore index 0621cd6a1..29039ea66 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,27 @@ composer.lock vendor node_modules npm-debug.log -build -## IDE +# IDEs .idea .vscode + +# Directories and files that we do not want to be included with the built +# version and deployed to WordPress.org. +.babelrc +.editorconfig +.eslintignore +.eslintrc.json +.github +.travis.yml +assets/js/pluginsidebar +assets/js/util +bin +composer.json +package.json +package-lock.json +phpcs.xml.dist +phpunit.xml.dist +README.md +tests +webpack.config.js diff --git a/README.md b/README.md deleted file mode 100644 index ba72031da..000000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Publish to Apple News - -The Publish to Apple News plugin enables your WordPress blog content to be published to your Apple News channel. - -* Convert your WordPress content into Apple News format automatically. -* Create a custom design for your Apple News content with no programming knowledge required. -* Automatically or manually publish posts from WordPress to Apple News. -* Control individual posts with options to publish, update, or delete. -* Publish individual posts or in bulk. -* Handles image galleries and popular embeds like YouTube and Vimeo that are supported by Apple News. -* Automatically adjust advertisement settings. - -To enable content from your WordPress blog to be published to your Apple News channel, you must obtain and enter Apple News API credentials from Apple. - -Please see the [Apple Developer](https://developer.apple.com/) and [Apple News Publisher documentation](https://developer.apple.com/news-publisher/) and terms on Apple's website for complete information. - -# Wiki - -Please visit our [wiki](https://github.com/alleyinteractive/apple-news/wiki) for detailed [installation instructions](https://github.com/alleyinteractive/apple-news/wiki/Installation) as well as [configuration](https://github.com/alleyinteractive/apple-news/wiki/Configuration) and [usage instructions](https://github.com/alleyinteractive/apple-news/wiki/Usage), [troubleshooting information](https://github.com/alleyinteractive/apple-news/wiki/Usage#troubleshooting) and [details about contributing](https://github.com/alleyinteractive/apple-news/wiki/Contributing). diff --git a/assets/js/components/image-picker/README.md b/assets/js/components/image-picker/README.md deleted file mode 100644 index 685552ff2..000000000 --- a/assets/js/components/image-picker/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# ImagePicker -Allows a user to select or remove an image using the media modal. This component -is a thin wrapper around `MediaPicker` and simply sets the allowed types for the -`MediaPicker` to `image`. - -For more information on how to use this component, see -[MediaPicker](../media-picker/README.md). - - -## Usage -Render a simple media upload/replace/remove feature for media for blocks. - -``` js - setAttributes({ imageId: 0 })}, - onUpdate={({ id }) => setAttributes({ imageId: id })} - value={imageId} -/> -``` - -## Props -| Prop | Default | Required | Type | Description | -|--------------|-------------|----------|----------|----------------------------------------------------------------------------| -| className | | No | string | Class name. | -| imageSize | 'thumbnail' | No | string | Image size to fetch url for previewing. | -| onReset | | Yes | function | Function to reset imageId to 0. | -| onUpdate | | Yes | function | Function to set imageId value on image selection/upload. | -| value | | Yes | integer | Image id or 0 | diff --git a/assets/js/components/media-picker/README.md b/assets/js/components/media-picker/README.md deleted file mode 100644 index 525b713ba..000000000 --- a/assets/js/components/media-picker/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# MediaPicker -Allows for a simple media upload/replace/remove feature for media for blocks. - -## Usage -Render a media picker, complete with URL preview, update, and remove button: - -``` js - setAttributes({ imageId: 0 })}, - onUpdate={({ id }) => setAttributes({ imageId: id })} - value={imageId} -/> -``` - -The value of `mediaId` is the ID of the media element, and is destructured from -`props.attributes`. - -## Props -| Prop | Default | Required | Type | Description | -|--------------|-------------|----------|----------|----------------------------------------------------------------------------| -| allowedTypes | all types | No | array | Array with the types of the media to upload/select from the media library. | -| className | | No | string | Class name. | -| imageSize | 'thumbnail' | No | string | Image size to fetch url for previewing. | -| onReset | | Yes | function | Function to reset imageId to 0. | -| onUpdate | | Yes | function | Function to set imageId value on image selection/upload. | -| value | | Yes | integer | Media id or 0 | diff --git a/assets/js/pluginsidebar/index.jsx b/assets/js/pluginsidebar/index.jsx deleted file mode 100644 index 29c325b93..000000000 --- a/assets/js/pluginsidebar/index.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import { registerPlugin } from '@wordpress/plugins'; -import React from 'react'; - -// Components. -import Icon from '../components/icon'; -import Sidebar from './sidebar'; - -registerPlugin('publish-to-apple-news', { - icon: , - render: Sidebar, -}); diff --git a/assets/js/pluginsidebar/panels/cover-image.jsx b/assets/js/pluginsidebar/panels/cover-image.jsx deleted file mode 100644 index 20b867108..000000000 --- a/assets/js/pluginsidebar/panels/cover-image.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import { BaseControl, PanelBody, TextareaControl } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -// Components. -import ImagePicker from '../../components/image-picker'; - -const CoverImage = ({ - coverImageCaption, - coverImageId, - onChangeCoverImageCaption, - onChangeCoverImageId, -}) => ( - - - onChangeCoverImageId(0)} - onUpdate={({ id }) => onChangeCoverImageId(id)} - value={coverImageId} - /> - - - -); - -CoverImage.propTypes = { - coverImageCaption: PropTypes.string.isRequired, - coverImageId: PropTypes.number.isRequired, - onChangeCoverImageCaption: PropTypes.func.isRequired, - onChangeCoverImageId: PropTypes.func.isRequired, -}; - -export default CoverImage; diff --git a/assets/js/pluginsidebar/panels/maturity-rating.jsx b/assets/js/pluginsidebar/panels/maturity-rating.jsx deleted file mode 100644 index c2e389960..000000000 --- a/assets/js/pluginsidebar/panels/maturity-rating.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import { PanelBody, SelectControl } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const MaturityRating = ({ - maturityRating, - onChangeMaturityRating, -}) => ( - - - -); - -MaturityRating.propTypes = { - maturityRating: PropTypes.string.isRequired, - onChangeMaturityRating: PropTypes.func.isRequired, -}; - -export default MaturityRating; diff --git a/assets/js/pluginsidebar/panels/metadata.jsx b/assets/js/pluginsidebar/panels/metadata.jsx deleted file mode 100644 index 4351dcf1b..000000000 --- a/assets/js/pluginsidebar/panels/metadata.jsx +++ /dev/null @@ -1,129 +0,0 @@ -import { - Button, - CheckboxControl, - PanelBody, - SelectControl, - TextControl, -} from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -// Config. -import { METADATA_SHAPE } from '../../config/prop-types'; - -// Util. -import deleteAtIndex from '../../util/delete-at-index'; -import updateValueAtIndex from '../../util/update-value-at-index'; - -const Metadata = ({ - isHidden, - isPaid, - isPreview, - isSponsored, - metadata, - onChangeIsHidden, - onChangeIsPaid, - onChangeIsPreview, - onChangeIsSponsored, - onChangeMetadata, -}) => ( - - - - -); - -Metadata.propTypes = { - isHidden: PropTypes.bool.isRequired, - isPaid: PropTypes.bool.isRequired, - isPreview: PropTypes.bool.isRequired, - isSponsored: PropTypes.bool.isRequired, - metadata: PropTypes.arrayOf(PropTypes.shape(METADATA_SHAPE)).isRequired, - onChangeIsHidden: PropTypes.func.isRequired, - onChangeIsPaid: PropTypes.func.isRequired, - onChangeIsPreview: PropTypes.func.isRequired, - onChangeIsSponsored: PropTypes.func.isRequired, - onChangeMetadata: PropTypes.func.isRequired, -}; - -export default Metadata; diff --git a/assets/js/pluginsidebar/panels/publish-controls.jsx b/assets/js/pluginsidebar/panels/publish-controls.jsx deleted file mode 100644 index 520037622..000000000 --- a/assets/js/pluginsidebar/panels/publish-controls.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import { Button, Spinner } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const PublishControls = ({ - apiAutosync, - apiAutosyncDelete, - apiAutosyncUpdate, - deletePost, - loading, - postIsDirty, - postStatus, - publishPost, - publishState, - updatePost, - userCanPublish, -}) => { - // If the post isn't published, or the user can't publish to Apple News, bail. - if (postStatus !== 'publish' || !userCanPublish) { - return null; - } - - // If we're loading, spin. - if (loading) { - return ; - } - - return ( - <> - {postIsDirty ? ( -
- - {__('Please click the Update button above to ensure that all changes are saved before publishing to Apple News.', 'apple-news')} - -
- ) : null} - {publishState !== 'N/A' && !apiAutosyncUpdate ? ( - - ) : null} - {publishState !== 'N/A' && !apiAutosyncDelete ? ( - - ) : null} - {publishState === 'N/A' && !apiAutosync ? ( - - ) : null} - - ); -}; - -PublishControls.propTypes = { - apiAutosync: PropTypes.bool.isRequired, - apiAutosyncDelete: PropTypes.bool.isRequired, - apiAutosyncUpdate: PropTypes.bool.isRequired, - deletePost: PropTypes.func.isRequired, - loading: PropTypes.bool.isRequired, - postIsDirty: PropTypes.bool.isRequired, - postStatus: PropTypes.string.isRequired, - publishPost: PropTypes.func.isRequired, - publishState: PropTypes.string.isRequired, - updatePost: PropTypes.func.isRequired, - userCanPublish: PropTypes.bool.isRequired, -}; - -export default PublishControls; diff --git a/assets/js/pluginsidebar/panels/publish-info.jsx b/assets/js/pluginsidebar/panels/publish-info.jsx deleted file mode 100644 index 4ceafeb4e..000000000 --- a/assets/js/pluginsidebar/panels/publish-info.jsx +++ /dev/null @@ -1,48 +0,0 @@ -import { PanelBody } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const PublishInfo = ({ - apiId, - dateCreated, - dateModified, - revision, - shareUrl, - publishState, -}) => { - if (!publishState || publishState === 'N/A') { - return null; - } - - return ( - -

{__('API Id', 'apple-news')}

-

{apiId}

-

{__('Created On', 'apple-news')}

-

{dateCreated}

-

{__('Last Updated On', 'apple-news')}

-

{dateModified}

-

{__('Share URL', 'apple-news')}

-

{shareUrl}

-

{__('Revision', 'apple-news')}

-

{revision}

-

{__('Publish State', 'apple-news')}

-

{publishState}

-
- ); -}; - -PublishInfo.propTypes = { - apiId: PropTypes.string.isRequired, - dateCreated: PropTypes.string.isRequired, - dateModified: PropTypes.string.isRequired, - revision: PropTypes.string.isRequired, - shareUrl: PropTypes.string.isRequired, - publishState: PropTypes.string.isRequired, -}; - -export default PublishInfo; diff --git a/assets/js/pluginsidebar/panels/pull-quote.jsx b/assets/js/pluginsidebar/panels/pull-quote.jsx deleted file mode 100644 index 6e24fd036..000000000 --- a/assets/js/pluginsidebar/panels/pull-quote.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import { - PanelBody, - SelectControl, - TextareaControl, -} from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const PullQuote = ({ - onChangePullquotePosition, - onChangePullquoteText, - pullquotePosition, - pullquoteText, -}) => ( - - - - -); - -PullQuote.propTypes = { - onChangePullquotePosition: PropTypes.func.isRequired, - onChangePullquoteText: PropTypes.func.isRequired, - pullquotePosition: PropTypes.string.isRequired, - pullquoteText: PropTypes.string.isRequired, -}; - -export default PullQuote; diff --git a/assets/js/pluginsidebar/panels/sections.jsx b/assets/js/pluginsidebar/panels/sections.jsx deleted file mode 100644 index 979a25ed3..000000000 --- a/assets/js/pluginsidebar/panels/sections.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import { - BaseControl, - CheckboxControl, - PanelBody, - Spinner, -} from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -// Config. -import { SECTION_SHAPE } from '../../config/prop-types'; - -const Sections = ({ - autoAssignCategories, - automaticAssignment, - onChangeAutoAssignCategories, - onChangeSelectedSections, - sections, - selectedSections, -}) => ( - - {!Array.isArray(sections) || sections.length === 0 ? ( - - ) : ( - <> - {automaticAssignment ? ( - - ) : null} - {automaticAssignment && !autoAssignCategories ?
: null} - {(!automaticAssignment || !autoAssignCategories) ? ( - - {sections.map(({ id, name }) => ( - onChangeSelectedSections(id)} - /> - ))} - - ) : null} - - )} -
-); - -Sections.propTypes = { - autoAssignCategories: PropTypes.bool.isRequired, - automaticAssignment: PropTypes.bool.isRequired, - onChangeAutoAssignCategories: PropTypes.func.isRequired, - onChangeSelectedSections: PropTypes.func.isRequired, - sections: PropTypes.arrayOf(PropTypes.shape(SECTION_SHAPE)).isRequired, - selectedSections: PropTypes.arrayOf(PropTypes.string).isRequired, -}; - -export default Sections; diff --git a/assets/js/pluginsidebar/panels/slug.jsx b/assets/js/pluginsidebar/panels/slug.jsx deleted file mode 100644 index 084fa2411..000000000 --- a/assets/js/pluginsidebar/panels/slug.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import { - PanelBody, - TextControl, -} from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; -import React from 'react'; - -const Slug = ({ - onChangeSlug, - slug, -}) => ( - - - -); - -Slug.propTypes = { - onChangeSlug: PropTypes.func.isRequired, - slug: PropTypes.string.isRequired, -}; - -export default Slug; diff --git a/assets/js/pluginsidebar/sidebar.jsx b/assets/js/pluginsidebar/sidebar.jsx deleted file mode 100644 index cbe2bc159..000000000 --- a/assets/js/pluginsidebar/sidebar.jsx +++ /dev/null @@ -1,275 +0,0 @@ -import apiFetch from '@wordpress/api-fetch'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { - PluginSidebar, - PluginSidebarMoreMenuItem, -} from '@wordpress/edit-post'; -import { __ } from '@wordpress/i18n'; -import DOMPurify from 'dompurify'; -import React, { useCallback, useEffect, useState } from 'react'; - -// Hooks. -import usePostMeta from '../services/hooks/use-post-meta'; - -// Panels. -import CoverImage from './panels/cover-image'; -import MaturityRating from './panels/maturity-rating'; -import Metadata from './panels/metadata'; -import PublishControls from './panels/publish-controls'; -import PublishInfo from './panels/publish-info'; -import PullQuote from './panels/pull-quote'; -import Sections from './panels/sections'; -import Slug from './panels/slug'; - -// Utils. -import safeJsonParseArray from '../util/safe-json-parse-array'; - -const Sidebar = () => { - const [state, setState] = useState({ - autoAssignCategories: false, - loading: false, - publishState: 'N/A', - sections: [], - settings: { - apiAutosync: false, - apiAutosyncDelete: false, - apiAutosyncUpdate: false, - automaticAssignment: false, - }, - userCanPublish: false, - }); - - // Destructure values out of state for easier access. - const { - autoAssignCategories, - loading, - publishState, - sections, - settings: { - apiAutosync, - apiAutosyncDelete, - apiAutosyncUpdate, - automaticAssignment, - }, - userCanPublish, - } = state; - - // Get a reference to the dispatch function for notices for use later. - const dispatchNotice = useDispatch('core/notices'); - - // Get the current post ID. - const { - notices, - postId, - postIsDirty, - postStatus, - } = useSelect((select) => { - const editor = select('core/editor'); - return { - notices: editor.getEditedPostAttribute('apple_news_notices'), - postId: editor.getCurrentPostId(), - postIsDirty: editor.isEditedPostDirty(), - postStatus: editor.getEditedPostAttribute('status'), - }; - }); - - // Getter/setter for postmeta managed by this PluginSidebar. - const [{ - apple_news_api_created_at: dateCreated = '', - apple_news_api_id: apiId = '', - apple_news_api_modified_at: dateModified = '', - apple_news_api_revision: revision = '', - apple_news_api_share_url: shareUrl = '', - apple_news_coverimage: coverImageId = 0, - apple_news_coverimage_caption: coverImageCaption = '', - apple_news_is_hidden: isHidden = false, - apple_news_is_paid: isPaid = false, - apple_news_is_preview: isPreview = false, - apple_news_is_sponsored: isSponsored = false, - apple_news_maturity_rating: maturityRating = '', - apple_news_metadata: metadataRaw = '', - apple_news_pullquote: pullquoteText = '', - apple_news_pullquote_position: pullquotePosition = '', - apple_news_sections: selectedSectionsRaw = '', - apple_news_slug: slug = '', - }, setMeta] = usePostMeta(); - - // Decode selected sections. - const metadata = safeJsonParseArray(metadataRaw); - const selectedSections = safeJsonParseArray(selectedSectionsRaw); - - /** - * A helper function for displaying a notification to the user. - * @param {string} message - The notification message displayed to the user. - * @param {string} type - Optional. The type of message to display. Defaults to success. - */ - const displayNotification = useCallback((message, type = 'success') => (type === 'success' - ? dispatchNotice.createInfoNotice(DOMPurify.sanitize(message), { type: 'snackbar' }) - : dispatchNotice.createErrorNotice(DOMPurify.sanitize(message)) - ), [dispatchNotice]); - - /** - * Sends a request to the REST API to modify the post. - * @param {string} operation - One of delete, publish, update. - */ - const modifyPost = async (operation) => { - setState({ - ...state, - loading: true, - }); - - try { - const { - notifications = [], - publishState: nextPublishState = '', - } = await apiFetch({ - data: { - id: postId, - }, - method: 'POST', - path: `/apple-news/v1/${operation}`, - }); - notifications.forEach((notification) => displayNotification( - notification.message, - notification.type, - )); - setState({ - ...state, - loading: false, - publishState: nextPublishState, - }); - } catch (error) { - displayNotification(error.message, 'error'); - setState({ - ...state, - loading: false, - }); - } - }; - - /** - * A helper function to update which sections are selected. - * @param {string} id - The id of the section to toggle. - */ - const toggleSelectedSection = (id) => setMeta('apple_news_sections', - selectedSections.includes(id) - ? JSON.stringify(selectedSections.filter((section) => section !== id)) - : JSON.stringify([...selectedSections, id])); - - // On initial load, fetch info from the API into state. - useEffect(() => { - (async () => { - const fetches = [ - await apiFetch({ path: `/apple-news/v1/get-published-state/${postId}` }), - await apiFetch({ path: '/apple-news/v1/sections' }), - await apiFetch({ path: '/apple-news/v1/get-settings' }), - await apiFetch({ path: `/apple-news/v1/user-can-publish/${postId}` }), - ]; - - // Wait for everything to load, update state, and handle errors. - try { - const data = await Promise.all(fetches); - setState({ - ...state, - autoAssignCategories: (selectedSections === null || selectedSections.length === 0) - && data[2].automaticAssignment === true, - ...data[0], - sections: data[1], - settings: data[2], - ...data[3], - }); - } catch (error) { - displayNotification(error.message, 'error'); - } - })(); - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - // Display notices whenever they change. - useEffect(() => { - notices.forEach((notice) => displayNotification(notice.message, notice.type)); - }, [displayNotification, notices]); - - return ( - <> - - {__('Apple News Options', 'apple-news')} - - - { - setState({ - ...state, - autoAssignCategories: next, - }); - setMeta('apple_news_sections', ''); - }} - onChangeSelectedSections={toggleSelectedSection} - sections={sections} - selectedSections={selectedSections} - /> - setMeta('apple_news_is_hidden', next)} - onChangeIsPaid={(next) => setMeta('apple_news_is_paid', next)} - onChangeIsPreview={(next) => setMeta('apple_news_is_preview', next)} - onChangeIsSponsored={(next) => setMeta('apple_news_is_sponsored', next)} - onChangeMetadata={(next) => setMeta('apple_news_metadata', JSON.stringify(next))} - /> - setMeta('apple_news_maturity_rating', next)} - /> - setMeta('apple_news_slug', next)} - slug={slug} - /> - setMeta('apple_news_pullquote_position', next)} - onChangePullquoteText={(next) => setMeta('apple_news_pullquote', next)} - pullquotePosition={pullquotePosition} - pullquoteText={pullquoteText} - /> - setMeta('apple_news_coverimage_caption', next)} - onChangeCoverImageId={(next) => setMeta('apple_news_coverimage', next)} - /> - {publishState !== 'N/A' ? ( - - ) : null} - modifyPost('delete')} - loading={loading} - postIsDirty={postIsDirty} - postStatus={postStatus} - publishPost={() => modifyPost('publish')} - publishState={publishState} - updatePost={() => modifyPost('update')} - userCanPublish={userCanPublish} - /> - - - ); -}; - -export default Sidebar; diff --git a/assets/js/services/hooks/use-post-meta/README.md b/assets/js/services/hooks/use-post-meta/README.md deleted file mode 100644 index f06287528..000000000 --- a/assets/js/services/hooks/use-post-meta/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Custom Hooks: usePostMeta - -A custom React hook that wraps `useEntityProp` for working with postmeta. It -returns an array that contains a copy of postmeta as well as a helper -function that sets a meta value for a given key. This hook is intended to -reduce boilerplate code in components that need to read and write postmeta. -By default, it operates on postmeta for the current post, but you can -optionally pass a post type and post ID in order to get and set post meta -for an arbitrary post. - -## Usage - -### Editing the Current Post's Meta - -```jsx -const MyComponent = () => { - const [{ - my_meta_key: myMetaKey = 'myDefaultValue', - }, setMeta] = usePostMeta(); - - return ( - setMeta('my_meta_key', next)} - value={myMetaKey} - /> - ); -}; -``` - -### Editing Another Post's Meta - -```jsx -const MyComponent = ({ - postId, - postType, -}) => { - const [{ - my_meta_key: myMetaKey = 'myDefaultValue', - }, setMeta] = usePostMeta(postType, postId); - - return ( - setMeta('my_meta_key', next)} - value={myMetaKey} - /> - ); -}; -``` diff --git a/assets/js/util/delete-at-index.js b/assets/js/util/delete-at-index.js deleted file mode 100644 index 06d94bc40..000000000 --- a/assets/js/util/delete-at-index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Given an array of values, returns a copy of the array with the value at the - * given index removed. - * @param {Array} values - The array of values to modify. - * @param {number} index - The index to remove. - * @returns {Array} A copy of the values array with the value at the specified index removed. - */ -const deleteAtIndex = (values, index) => values.filter((value, idx) => index !== idx); - -export default deleteAtIndex; diff --git a/assets/js/util/delete-at-index.test.js b/assets/js/util/delete-at-index.test.js deleted file mode 100644 index 1529ffdfe..000000000 --- a/assets/js/util/delete-at-index.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import deleteAtIndex from './delete-at-index'; - -test('deleteAtIndex should properly delete items at a given index.', () => { - const values = ['a', 'b', 'c']; - expect(deleteAtIndex(values, 0)).toEqual(['b', 'c']); - expect(deleteAtIndex(values, 1)).toEqual(['a', 'c']); - expect(deleteAtIndex(values, 2)).toEqual(['a', 'b']); -}); diff --git a/assets/js/util/safe-json-parse-array.js b/assets/js/util/safe-json-parse-array.js deleted file mode 100644 index 515ff502b..000000000 --- a/assets/js/util/safe-json-parse-array.js +++ /dev/null @@ -1,21 +0,0 @@ -import safeJsonParse from './safe-json-parse'; - -/** - * Given a value, run JSON.parse on it, but if parsing fails, or if - * what results from the parse is not an array, return an empty - * array rather than a syntax error or a value of another type. - * @param {*} value - The value to attempt to parse. - * @returns {array} - The parsed value, or an empty array on failure. - */ -const safeJsonParseArray = (value) => { - const parsedValue = safeJsonParse(value); - - // Make absolutely sure that the parsed value is an array. - if (!Array.isArray(parsedValue)) { - return []; - } - - return parsedValue; -}; - -export default safeJsonParseArray; diff --git a/assets/js/util/safe-json-parse-array.test.js b/assets/js/util/safe-json-parse-array.test.js deleted file mode 100644 index 1f91cea86..000000000 --- a/assets/js/util/safe-json-parse-array.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import safeJsonParseArray from './safe-json-parse-array'; - -test('safeJsonParseArray should properly return a parsed array.', () => { - expect(safeJsonParseArray('[1, 5, "false"]')).toEqual([1, 5, 'false']); - expect(safeJsonParseArray('["a", "b", "c"]')).toEqual(['a', 'b', 'c']); -}); - -test('safeJsonParseArray should return an empty array for any non-array types.', () => { - expect(safeJsonParseArray('true')).toEqual([]); - expect(safeJsonParseArray('"foo"')).toEqual([]); - expect(safeJsonParseArray('null')).toEqual([]); - expect(safeJsonParseArray('{}')).toEqual([]); - expect(safeJsonParseArray('{"a": "b"}')).toEqual([]); - expect(safeJsonParseArray('')).toEqual([]); - expect(safeJsonParseArray(undefined)).toEqual([]); -}); diff --git a/assets/js/util/safe-json-parse-object.js b/assets/js/util/safe-json-parse-object.js deleted file mode 100644 index 952c7883c..000000000 --- a/assets/js/util/safe-json-parse-object.js +++ /dev/null @@ -1,25 +0,0 @@ -import safeJsonParse from './safe-json-parse'; - -/** - * Given a value, run JSON.parse on it, but if parsing fails, or if - * what results from the parse is not a standard object, return an empty - * object rather than a syntax error or a value of another type. - * @param {*} value - The value to attempt to parse. - * @returns {object} - The parsed value, or an empty object on failure. - */ -const safeJsonParseObject = (value) => { - const parsedValue = safeJsonParse(value); - - // Make absolutely sure that the object is a standard object. - if (parsedValue === null - || typeof parsedValue !== 'object' - || Array.isArray(parsedValue) - || JSON.stringify(parsedValue).indexOf('{') !== 0 - ) { - return {}; - } - - return parsedValue; -}; - -export default safeJsonParseObject; diff --git a/assets/js/util/safe-json-parse-object.test.js b/assets/js/util/safe-json-parse-object.test.js deleted file mode 100644 index fe607b1fe..000000000 --- a/assets/js/util/safe-json-parse-object.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import safeJsonParseObject from './safe-json-parse-object'; - -test('safeJsonParseObject should properly return a parsed object.', () => { - expect(safeJsonParseObject('{}')).toEqual({}); - expect(safeJsonParseObject('{"a": "b"}')).toEqual({ a: 'b' }); -}); - -test('safeJsonParseObject should return an empty object for any non-object types.', () => { - expect(safeJsonParseObject('true')).toEqual({}); - expect(safeJsonParseObject('"foo"')).toEqual({}); - expect(safeJsonParseObject('[1, 5, "false"]')).toEqual({}); - expect(safeJsonParseObject('null')).toEqual({}); - expect(safeJsonParseObject('["a", "b", "c"]')).toEqual({}); - expect(safeJsonParseObject('')).toEqual({}); - expect(safeJsonParseObject(undefined)).toEqual({}); -}); diff --git a/assets/js/util/safe-json-parse.js b/assets/js/util/safe-json-parse.js deleted file mode 100644 index 786a8799e..000000000 --- a/assets/js/util/safe-json-parse.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Given a value, run JSON.parse on it, but if parsing fails, return null - * instead of throwing a SyntaxError. - * @param {*} value - The value to attempt to parse. - * @returns {*} - The parsed value, or null on failure. - */ -const safeJsonParse = (value) => { - try { - return JSON.parse(value); - } catch (e) { - return null; - } -}; - -export default safeJsonParse; diff --git a/assets/js/util/safe-json-parse.test.js b/assets/js/util/safe-json-parse.test.js deleted file mode 100644 index 82884632a..000000000 --- a/assets/js/util/safe-json-parse.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import safeJsonParse from './safe-json-parse'; - -test('safeJsonParse should properly decode valid JSON.', () => { - expect(safeJsonParse('{}')).toEqual({}); - expect(safeJsonParse('true')).toEqual(true); - expect(safeJsonParse('"foo"')).toEqual('foo'); - expect(safeJsonParse('[1, 5, "false"]')).toEqual([1, 5, 'false']); - expect(safeJsonParse('null')).toEqual(null); - expect(safeJsonParse('["a", "b", "c"]')).toEqual(['a', 'b', 'c']); - expect(safeJsonParse('{"a": "b"}')).toEqual({ a: 'b' }); -}); - -test('Should not choke on invalid JSON.', () => { - expect(safeJsonParse('')).toEqual(null); - expect(safeJsonParse(undefined)).toEqual(null); -}); diff --git a/assets/js/util/update-value-at-index.js b/assets/js/util/update-value-at-index.js deleted file mode 100644 index 7ac7dfd22..000000000 --- a/assets/js/util/update-value-at-index.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Given an array of objects, a key, and a value, returns a copy of the array - * with the value for the key set at the given index. - * @param {Array} values - An array of objects. - * @param {string} key - The object key to update. - * @param {*} value - The value to set for the key. - * @param {number} index - The index to set the value on. - * @returns {Array} A copy of the array with the value set for the key at the given index. - */ -const updateValueAtIndex = (values, key, value, index) => { - const valuesCopy = values.map((item) => ({ ...item })); - valuesCopy[index][key] = value; - return valuesCopy; -}; - -export default updateValueAtIndex; diff --git a/assets/js/util/update-value-at-index.test.js b/assets/js/util/update-value-at-index.test.js deleted file mode 100644 index 388d62773..000000000 --- a/assets/js/util/update-value-at-index.test.js +++ /dev/null @@ -1,39 +0,0 @@ -import updateValueAtIndex from './update-value-at-index'; - -test('updateValueAtIndex should properly update values at indices.', () => { - const values = [ - { a: 'b', c: 'd' }, - { e: 'f', g: 'h' }, - { i: 'j', k: 'l' }, - ]; - expect(updateValueAtIndex(values, 'a', 'x', 0)).toEqual([ - { a: 'x', c: 'd' }, - { e: 'f', g: 'h' }, - { i: 'j', k: 'l' }, - ]); - expect(updateValueAtIndex(values, 'c', 'x', 0)).toEqual([ - { a: 'b', c: 'x' }, - { e: 'f', g: 'h' }, - { i: 'j', k: 'l' }, - ]); - expect(updateValueAtIndex(values, 'e', 'x', 1)).toEqual([ - { a: 'b', c: 'd' }, - { e: 'x', g: 'h' }, - { i: 'j', k: 'l' }, - ]); - expect(updateValueAtIndex(values, 'g', 'x', 1)).toEqual([ - { a: 'b', c: 'd' }, - { e: 'f', g: 'x' }, - { i: 'j', k: 'l' }, - ]); - expect(updateValueAtIndex(values, 'i', 'x', 2)).toEqual([ - { a: 'b', c: 'd' }, - { e: 'f', g: 'h' }, - { i: 'x', k: 'l' }, - ]); - expect(updateValueAtIndex(values, 'k', 'x', 2)).toEqual([ - { a: 'b', c: 'd' }, - { e: 'f', g: 'h' }, - { i: 'j', k: 'x' }, - ]); -}); diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh deleted file mode 100755 index 4f5335586..000000000 --- a/bin/install-wp-tests.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash - -if [ $# -lt 3 ]; then - echo "usage: $0 [db-host] [wp-version]" - exit 1 -fi - -DB_NAME=$1 -DB_USER=$2 -DB_PASS=$3 -DB_HOST=${4-localhost} -WP_VERSION=${5-latest} - -WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} -WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} - -download() { - if [ `which curl` ]; then - curl -s "$1" > "$2"; - elif [ `which wget` ]; then - wget -nv -O "$2" "$1" - fi -} - -if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then - WP_TESTS_TAG="tags/$WP_VERSION" -elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - WP_TESTS_TAG="trunk" -else - # http serves a single offer, whereas https serves multiple. we only want one - download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json - grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json - LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') - if [[ -z "$LATEST_VERSION" ]]; then - echo "Latest WordPress version could not be found" - exit 1 - fi - WP_TESTS_TAG="tags/$LATEST_VERSION" -fi - -set -ex - -install_wp() { - - if [ -d $WP_CORE_DIR ]; then - return; - fi - - mkdir -p $WP_CORE_DIR - - if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - mkdir -p /tmp/wordpress-nightly - download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip - unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/ - mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR - else - if [ $WP_VERSION == 'latest' ]; then - local ARCHIVE_NAME='latest' - else - local ARCHIVE_NAME="wordpress-$WP_VERSION" - fi - download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz - tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR - fi - - download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php -} - -install_test_suite() { - # portable in-place argument for both GNU sed and Mac OSX sed - if [[ $(uname -s) == 'Darwin' ]]; then - local ioption='-i .bak' - else - local ioption='-i' - fi - - # set up testing suite if it doesn't yet exist - if [ ! -d $WP_TESTS_DIR ]; then - # set up testing suite - mkdir -p $WP_TESTS_DIR - svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes - fi - - if [ ! -f wp-tests-config.php ]; then - download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php - fi - -} - -install_db() { - # parse DB_HOST for port or socket references - local PARTS=(${DB_HOST//\:/ }) - local DB_HOSTNAME=${PARTS[0]}; - local DB_SOCK_OR_PORT=${PARTS[1]}; - local EXTRA="" - - if ! [ -z $DB_HOSTNAME ] ; then - if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then - EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" - elif ! [ -z $DB_SOCK_OR_PORT ] ; then - EXTRA=" --socket=$DB_SOCK_OR_PORT" - elif ! [ -z $DB_HOSTNAME ] ; then - EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" - fi - fi - - # create database - mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA -} - -install_wp -install_test_suite -install_db diff --git a/build/pluginSidebar.asset.php b/build/pluginSidebar.asset.php new file mode 100644 index 000000000..ac86546aa --- /dev/null +++ b/build/pluginSidebar.asset.php @@ -0,0 +1 @@ + array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-i18n', 'wp-plugins'), 'version' => '399a6e300bdaabf151f1faecd2cfb13e'); \ No newline at end of file diff --git a/build/pluginSidebar.js b/build/pluginSidebar.js new file mode 100644 index 000000000..e06394756 --- /dev/null +++ b/build/pluginSidebar.js @@ -0,0 +1,3 @@ +/*! For license information please see pluginSidebar.js.LICENSE.txt */ +!function(){var e={856:function(e){e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,a=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,r=Object.freeze,o=Object.seal,l=Object.create,s="undefined"!=typeof Reflect&&Reflect,p=s.apply,c=s.construct;p||(p=function(e,t,n){return e.apply(t,n)}),r||(r=function(e){return e}),o||(o=function(e){return e}),c||(c=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?n-1:0),i=1;i/gm),F=o(/^data-[\-\w.\u00B7-\uFFFF]/),z=o(/^aria-[\-\w]+$/),B=o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=o(/^(?:\w+script|data):/i),j=o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function G(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:V(),n=function(t){return e(t)};if(n.version="2.3.0",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var a=t.document,i=t.document,o=t.DocumentFragment,l=t.HTMLTemplateElement,s=t.Node,p=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,C=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,$=t.Text,J=t.Comment,Y=t.DOMParser,Q=t.trustedTypes,X=p.prototype,Z=S(X,"cloneNode"),ee=S(X,"nextSibling"),te=S(X,"childNodes"),ne=S(X,"parentNode");if("function"==typeof l){var ae=i.createElement("template");ae.content&&ae.content.ownerDocument&&(i=ae.content.ownerDocument)}var ie=K(Q,a),re=ie&&Le?ie.createHTML(""):"",oe=i,le=oe.implementation,se=oe.createNodeIterator,pe=oe.createDocumentFragment,ce=oe.getElementsByTagName,ue=a.importNode,de={};try{de=E(i).documentMode?i.documentMode:{}}catch(e){}var me={};n.isSupported="function"==typeof ne&&le&&void 0!==le.createHTMLDocument&&9!==de;var fe=L,ge=U,he=F,ye=z,_e=H,ve=j,be=B,we=null,Ce=A({},[].concat(G(T),G(R),G(k),G(P),G(I))),Ae=null,Ee=A({},[].concat(G(q),G(N),G(D),G(M))),Se=null,Te=null,Re=!0,ke=!0,xe=!1,Pe=!1,Oe=!1,Ie=!1,qe=!1,Ne=!1,De=!1,Me=!0,Le=!1,Ue=!0,Fe=!0,ze=!1,Be={},He=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),je=null,We=A({},["audio","video","img","source","image","track"]),Ge=null,Ve=A({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",$e="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml",Ye=Je,Qe=!1,Xe=null,Ze=i.createElement("form"),et=function(e){Xe&&Xe===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=E(e),we="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS):Ce,Ae="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR):Ee,Ge="ADD_URI_SAFE_ATTR"in e?A(E(Ve),e.ADD_URI_SAFE_ATTR):Ve,je="ADD_DATA_URI_TAGS"in e?A(E(We),e.ADD_DATA_URI_TAGS):We,Se="FORBID_TAGS"in e?A({},e.FORBID_TAGS):{},Te="FORBID_ATTR"in e?A({},e.FORBID_ATTR):{},Be="USE_PROFILES"in e&&e.USE_PROFILES,Re=!1!==e.ALLOW_ARIA_ATTR,ke=!1!==e.ALLOW_DATA_ATTR,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.SAFE_FOR_TEMPLATES||!1,Oe=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Me=!1!==e.RETURN_DOM_IMPORT,Le=e.RETURN_TRUSTED_TYPE||!1,qe=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,Fe=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,Ye=e.NAMESPACE||Je,Pe&&(ke=!1),De&&(Ne=!0),Be&&(we=A({},[].concat(G(I))),Ae=[],!0===Be.html&&(A(we,T),A(Ae,q)),!0===Be.svg&&(A(we,R),A(Ae,N),A(Ae,M)),!0===Be.svgFilters&&(A(we,k),A(Ae,N),A(Ae,M)),!0===Be.mathMl&&(A(we,P),A(Ae,D),A(Ae,M))),e.ADD_TAGS&&(we===Ce&&(we=E(we)),A(we,e.ADD_TAGS)),e.ADD_ATTR&&(Ae===Ee&&(Ae=E(Ae)),A(Ae,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&A(Ge,e.ADD_URI_SAFE_ATTR),Fe&&(we["#text"]=!0),Oe&&A(we,["html","head","body"]),we.table&&(A(we,["tbody"]),delete Se.tbody),r&&r(e),Xe=e)},tt=A({},["mi","mo","mn","ms","mtext"]),nt=A({},["foreignobject","desc","title","annotation-xml"]),at=A({},R);A(at,k),A(at,x);var it=A({},P);A(it,O);var rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});var n=g(e.tagName),a=g(t.tagName);if(e.namespaceURI===$e)return t.namespaceURI===Je?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===a||tt[a]):Boolean(at[n]);if(e.namespaceURI===Ke)return t.namespaceURI===Je?"math"===n:t.namespaceURI===$e?"math"===n&&nt[a]:Boolean(it[n]);if(e.namespaceURI===Je){if(t.namespaceURI===$e&&!nt[a])return!1;if(t.namespaceURI===Ke&&!tt[a])return!1;var i=A({},["title","style","font","a","script"]);return!it[n]&&(i[n]||!at[n])}return!1},ot=function(e){f(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=re}catch(t){e.remove()}}},lt=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ae[e])if(Ne||De)try{ot(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},st=function(e){var t=void 0,n=void 0;if(qe)e=""+e;else{var a=h(e,/^[\r\n\t ]+/);n=a&&a[0]}var r=ie?ie.createHTML(e):e;if(Ye===Je)try{t=(new Y).parseFromString(r,"text/html")}catch(e){}if(!t||!t.documentElement){t=le.createDocument(Ye,"template",null);try{t.documentElement.innerHTML=Qe?"":r}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Ye===Je?ce.call(t,Oe?"html":"body")[0]:Oe?t.documentElement:o},pt=function(e){return se.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},ct=function(e){return!(e instanceof $||e instanceof J||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof C&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===s?"undefined":W(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":W(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},dt=function(e,t,a){me[e]&&d(me[e],(function(e){e.call(n,t,a,Xe)}))},mt=function(e){var t=void 0;if(dt("beforeSanitizeElements",e,null),ct(e))return ot(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return ot(e),!0;var a=g(e.nodeName);if(dt("uponSanitizeElement",e,{tagName:a,allowedTags:we}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ot(e),!0;if(!we[a]||Se[a]){if(Fe&&!He[a]){var i=ne(e)||e.parentNode,r=te(e)||e.childNodes;if(r&&i)for(var o=r.length-1;o>=0;--o)i.insertBefore(Z(r[o],!0),ee(e))}return ot(e),!0}return e instanceof p&&!rt(e)?(ot(e),!0):"noscript"!==a&&"noembed"!==a||!b(/<\/no(script|embed)/i,e.innerHTML)?(Pe&&3===e.nodeType&&(t=e.textContent,t=y(t,fe," "),t=y(t,ge," "),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),dt("afterSanitizeElements",e,null),!1):(ot(e),!0)},ft=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in i||n in Ze))return!1;if(ke&&!Te[t]&&b(he,t));else if(Re&&b(ye,t));else{if(!Ae[t]||Te[t])return!1;if(Ge[t]);else if(b(be,y(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!je[e])if(xe&&!b(_e,y(n,ve,"")));else if(n)return!1}return!0},gt=function(e){var t=void 0,a=void 0,i=void 0,r=void 0;dt("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae};for(r=o.length;r--;){var s=t=o[r],p=s.name,c=s.namespaceURI;if(a=v(t.value),i=g(p),l.attrName=i,l.attrValue=a,l.keepAttr=!0,l.forceKeepAttr=void 0,dt("uponSanitizeAttribute",e,l),a=l.attrValue,!l.forceKeepAttr&&(lt(p,e),l.keepAttr))if(b(/\/>/i,a))lt(p,e);else{Pe&&(a=y(a,fe," "),a=y(a,ge," "));var u=e.nodeName.toLowerCase();if(ft(u,i,a))try{c?e.setAttributeNS(c,p,a):e.setAttribute(p,a),m(n.removed)}catch(e){}}}dt("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,a=pt(t);for(dt("beforeSanitizeShadowDOM",t,null);n=a.nextNode();)dt("uponSanitizeShadowNode",n,null),mt(n)||(n.content instanceof o&&e(n.content),gt(n));dt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,i){var r=void 0,l=void 0,p=void 0,c=void 0,u=void 0;if((Qe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported){if("object"===W(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Ie||et(i),n.removed=[],"string"==typeof e&&(ze=!1),ze);else if(e instanceof s)1===(l=(r=st("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?r=l:r.appendChild(l);else{if(!Ne&&!Pe&&!Oe&&-1===e.indexOf("<"))return ie&&Le?ie.createHTML(e):e;if(!(r=st(e)))return Ne?null:re}r&&qe&&ot(r.firstChild);for(var d=pt(ze?e:r);p=d.nextNode();)3===p.nodeType&&p===c||mt(p)||(p.content instanceof o&&ht(p.content),gt(p),c=p);if(c=null,ze)return e;if(Ne){if(De)for(u=pe.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return Me&&(u=ue.call(a,u,!0)),u}var m=Oe?r.outerHTML:r.innerHTML;return Pe&&(m=y(m,fe," "),m=y(m,ge," ")),ie&&Le?ie.createHTML(m):m},n.setConfig=function(e){et(e),Ie=!0},n.clearConfig=function(){Xe=null,Ie=!1},n.isValidAttribute=function(e,t,n){Xe||et({});var a=g(e),i=g(t);return ft(a,i,n)},n.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],f(me[e],t))},n.removeHook=function(e){me[e]&&m(me[e])},n.removeHooks=function(e){me[e]&&(me[e]=[])},n.removeAllHooks=function(){me={}},n}()}()},703:function(e,t,n){"use strict";var a=n(414);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,o){if(o!==a){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return n.PropTypes=n,n}},697:function(e,t,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a].call(r.exports,r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.plugins,t=window.React,a=n.n(t),i=()=>a().createElement("svg",{enableBackground:"new 0 0 26.77438 26.77438",height:"26.77438px",version:"1.1",viewBox:"0 0 26.77438 26.77438",width:"26.77438px",x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px"},a().createElement("g",null,a().createElement("g",null,a().createElement("g",null,a().createElement("path",{d:"M4.71813,13.5345v4.77055l0.00002,0.65257 c0,0.0568-0.00002,0.11365,0.00035,0.17044c0.00025,0.04783,0.00081,0.0957,0.00209,0.14355 c0.00283,0.10423,0.00899,0.20939,0.02751,0.31251c0.01879,0.10458,0.04945,0.20193,0.0978,0.29693 c0.04756,0.0934,0.10962,0.17891,0.1837,0.253c0.07406,0.07407,0.15948,0.13619,0.25284,0.18372 c0.09503,0.0484,0.19239,0.07911,0.29701,0.09791c0.10299,0.01855,0.20809,0.02465,0.31225,0.02748 c0.04783,0.0013,0.09566,0.00183,0.14351,0.00215c0.05676,0.00033,0.11354,0.00031,0.17035,0.00031l0.65231,0.00002h4.77141 c0.13713,0,0.1819-0.18436,0.05989-0.24694c-2.91487-1.49526-5.22884-3.80922-6.72409-6.72407 c-0.02514-0.04903-0.06995-0.07114-0.11456-0.07114C4.78411,13.40348,4.71813,13.45246,4.71813,13.5345 M6.20869,4.71816 c-0.05692,0-0.11382,0.00002-0.17074,0.00035C5.99004,4.71878,5.9421,4.71937,5.89418,4.72066 C5.78975,4.72349,5.68438,4.72962,5.58112,4.74818C5.47637,4.76705,5.37885,4.79772,5.28367,4.84613 C5.1901,4.89378,5.10448,4.95595,5.03024,5.03016C4.95604,5.10438,4.8938,5.18993,4.84622,5.28341 c-0.0485,0.09524-0.07925,0.19277-0.09809,0.29751C4.72958,5.68414,4.72344,5.78941,4.72059,5.89376 C4.71932,5.94165,4.71875,5.98955,4.7185,6.03746c-0.00035,0.048-0.00037,0.09602-0.00037,0.14401v0.02665v1.96427 c0,0.40087,0.07796,0.6084,0.37512,0.90561l10.99255,10.9925c0.30093,0.30094,0.50562,0.37513,0.90561,0.37513h1.96366 c0.05688,0,0.11384,0,0.17074-0.00036c0.04794-0.00028,0.09584-0.00084,0.14378-0.00216 c0.10446-0.00281,0.20978-0.00894,0.31304-0.02751c0.10479-0.01884,0.20229-0.04954,0.29747-0.09796 c0.09358-0.04766,0.17919-0.10981,0.25338-0.18402c0.07428-0.07423,0.13647-0.15976,0.18408-0.25323 c0.04852-0.09524,0.07924-0.19277,0.09809-0.29752c0.01855-0.10318,0.0247-0.20845,0.0275-0.31283 c0.0013-0.04788,0.00187-0.09577,0.00214-0.14376c0.00031-0.04819,0.00034-0.09648,0.00034-0.14476v-1.99007 c0-0.40094-0.07794-0.60844-0.37513-0.90564L9.07799,5.09329C8.77706,4.79237,8.57234,4.71818,8.17237,4.71816H6.20869 M13.53452,4.71816c-0.13717,0-0.18194,0.18436-0.05994,0.24694c2.9149,1.49524,5.22883,3.8092,6.72409,6.72407 c0.06261,0.12206,0.24697,0.07725,0.24697-0.05992V6.85873l-0.00005-0.65257c0-0.05679,0.00005-0.11363-0.00028-0.17043 c-0.00027-0.04786-0.00084-0.0957-0.00216-0.14353c-0.0028-0.10428-0.00891-0.20943-0.02746-0.31252 c-0.0188-0.1046-0.04947-0.20194-0.09784-0.29695c-0.0475-0.09343-0.10962-0.17888-0.18367-0.25297 c-0.0741-0.0741-0.15947-0.1362-0.25285-0.18375c-0.09504-0.04841-0.19239-0.0791-0.297-0.09789 c-0.10299-0.01854-0.2081-0.02468-0.31226-0.02751c-0.04781-0.00125-0.09565-0.00183-0.14348-0.00211 c-0.0568-0.00035-0.1136-0.00032-0.17037-0.00032l-0.65233-0.00002H13.53452"}))))),r=window.wp.apiFetch,o=n.n(r),l=window.wp.data,s=window.wp.editPost,p=window.wp.i18n,c=n(856),u=n.n(c),d=window.wp.coreData,m=window.wp.components,f=n(697),g=n.n(f),h=window.wp.blockEditor,y=(e,t="full")=>{const{media_details:{sizes:{[t]:{source_url:n=""}={},full:{source_url:a=""}={}}={}}={},sizes:{[t]:{url:i=""}={},full:{url:r=""}={}}={},source_url:o="",url:l=""}=e;return n||i||a||r||o||l||""};const _=({allowedTypes:e,className:t,value:n,imageSize:i,onReset:r,onUpdate:o})=>{const{media:s=null}=(0,l.useSelect)((e=>({media:e("core").getMedia(n)})),[n]);return 0!==n&&null===s?a().createElement(m.Spinner,null):a().createElement("div",{className:t,style:{backgroundColor:"#007CBA",display:"inline-block",position:"relative"}},a().createElement(h.MediaUploadCheck,null,a().createElement(h.MediaUpload,{title:(0,p.__)("Select/add File","apple-news"),onSelect:o,allowedTypes:e,value:n,render:({open:e})=>a().createElement(a().Fragment,null,0!==n&&null!==s?a().createElement("div",null,a().createElement("img",{alt:"",src:y(s,i)}),a().createElement("div",{style:{background:"white",left:"50%",padding:5,position:"absolute",top:"50%",transform:"translate(-50%, -50%)",zIndex:10}},a().createElement(m.Button,{isPrimary:!0,isLarge:!0,onClick:e,style:{marginBottom:0}},(0,p.__)("Replace File","apple-news")),a().createElement(m.Button,{isLink:!0,isDestructive:!0,onClick:r,style:{marginBottom:0}},(0,p.__)("Remove File","apple-news")))):null,0===n?a().createElement("div",{style:{background:"white",padding:5}},a().createElement(m.Button,{isPrimary:!0,onClick:e},(0,p.__)("Select/add File","apple-news"))):null)})))};_.defaultProps={allowedTypes:[],className:"",imageSize:"thumbnail"},_.propTypes={allowedTypes:g().arrayOf([g().string]),className:g().string,value:g().number.isRequired,imageSize:g().string,onReset:g().func.isRequired,onUpdate:g().func.isRequired};var v=_;const b=({className:e,imageSize:t,onReset:n,onUpdate:i,value:r})=>a().createElement(v,{className:e,allowedTypes:["image"],imageSize:t,onUpdate:i,onReset:n,value:r});b.defaultProps={className:"",imageSize:"thumbnail"},b.propTypes={className:g().string,imageSize:g().string,onReset:g().func.isRequired,onUpdate:g().func.isRequired,value:g().number.isRequired};var w=b;const C=({coverImageCaption:e,coverImageId:t,onChangeCoverImageCaption:n,onChangeCoverImageId:i})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Cover Image","apple-news")},a().createElement(m.BaseControl,null,a().createElement(w,{onReset:()=>i(0),onUpdate:({id:e})=>i(e),value:t})),a().createElement(m.TextareaControl,{help:(0,p.__)("This is optional and can be left blank.","apple-news"),label:(0,p.__)("Caption","apple-news"),onChange:n,placeholder:(0,p.__)("Add an image caption here.","apple-news"),value:e}));C.propTypes={coverImageCaption:g().string.isRequired,coverImageId:g().number.isRequired,onChangeCoverImageCaption:g().func.isRequired,onChangeCoverImageId:g().func.isRequired};var A=C;const E=({maturityRating:e,onChangeMaturityRating:t})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Maturity Rating","apple-news")},a().createElement(m.SelectControl,{help:(0,p.__)("Select the optional maturity rating for this post.","apple-news"),label:(0,p.__)("Select Maturity Rating","apple-news"),onChange:t,options:[{label:"",value:""},{label:(0,p.__)("Kids","apple-news"),value:"KIDS"},{label:(0,p.__)("Mature","apple-news"),value:"MATURE"},{label:(0,p.__)("General","apple-news"),value:"GENERAL"}],value:e}));E.propTypes={maturityRating:g().string.isRequired,onChangeMaturityRating:g().func.isRequired};var S=E;const T={key:g().string.isRequired,type:g().oneOf(["array","boolean","number","string"]),value:g().oneOfType([g().arrayOf(g().string),g().bool,g().number,g().string])},R={id:g().string.isRequired,name:g().string.isRequired};var k=(e,t,n,a)=>{const i=e.map((e=>({...e})));return i[a][t]=n,i};const x=({isHidden:e,isPaid:t,isPreview:n,isSponsored:i,metadata:r,onChangeIsHidden:o,onChangeIsPaid:l,onChangeIsPreview:s,onChangeIsSponsored:c,onChangeMetadata:u})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Metadata","apple-news")},a().createElement(m.CheckboxControl,{checked:t,help:(0,p.__)("Check this to indicate that viewing the article requires a paid subscription. Note that Apple must approve your channel for paid content before using this feature.","apple-news"),label:(0,p.__)("Paid Article","apple-news"),onChange:l}),a().createElement(m.CheckboxControl,{checked:n,help:(0,p.__)("Check this to publish the article as a draft.","apple-news"),label:(0,p.__)("Preview Article","apple-news"),onChange:s}),a().createElement(m.CheckboxControl,{checked:e,help:(0,p.__)("Check this to publish the article as a hidden article. Hidden articles are visible to users who have a link to the article, but do not appear in feeds.","apple-news"),label:(0,p.__)("Hidden Article","apple-news"),onChange:o}),a().createElement(m.CheckboxControl,{checked:i,help:(0,p.__)("Check this to indicate this article is sponsored content.","apple-news"),label:(0,p.__)("Sponsored Article","apple-news"),onChange:c}),a().createElement("h3",null,(0,p.__)("Custom Metadata","apple-news")),r.map((({key:e,type:t,value:n},i)=>a().createElement("div",{key:i},a().createElement(m.TextControl,{label:(0,p.__)("Key","apple-news"),onChange:e=>u(k(r,"key",e,i)),value:e}),a().createElement(m.SelectControl,{label:(0,p.__)("Type","apple-news"),onChange:e=>u(k(r,"type",e,i)),options:[{label:(0,p.__)("string","apple-news"),value:"string"},{label:(0,p.__)("boolean","apple-news"),value:"boolean"},{label:(0,p.__)("number","apple-news"),value:"number"},{label:(0,p.__)("array","apple-news"),value:"array"}],value:t}),"boolean"===t?a().createElement(m.SelectControl,{label:(0,p.__)("Value","apple-news"),onChange:e=>u(k(r,"value","true"===e,i)),options:[{label:(0,p.__)("","apple-news"),value:""},{label:(0,p.__)("true","apple-news"),value:"true"},{label:(0,p.__)("false","apple-news"),value:"false"}],value:n}):a().createElement(m.TextControl,{label:(0,p.__)("Value","apple-news"),onChange:e=>u(k(r,"value","number"===t?parseFloat(e):e,i)),type:"number"===t?"number":"text",value:n}),a().createElement(m.Button,{isDestructive:!0,onClick:()=>u(((e,t)=>e.filter(((e,n)=>t!==n)))(r,i)),style:{marginBottom:"1em"}},(0,p.__)("Remove","apple-news"))))),a().createElement(m.Button,{isPrimary:!0,onClick:()=>u([...r,{key:"",type:"string",value:""}])},(0,p.__)("Add Metadata","apple-news")));x.propTypes={isHidden:g().bool.isRequired,isPaid:g().bool.isRequired,isPreview:g().bool.isRequired,isSponsored:g().bool.isRequired,metadata:g().arrayOf(g().shape(T)).isRequired,onChangeIsHidden:g().func.isRequired,onChangeIsPaid:g().func.isRequired,onChangeIsPreview:g().func.isRequired,onChangeIsSponsored:g().func.isRequired,onChangeMetadata:g().func.isRequired};var P=x;const O=({apiAutosync:e,apiAutosyncDelete:t,apiAutosyncUpdate:n,deletePost:i,loading:r,postIsDirty:o,postStatus:l,publishPost:s,publishState:c,updatePost:u,userCanPublish:d})=>"publish"===l&&d?r?a().createElement(m.Spinner,null):a().createElement(a().Fragment,null,o?a().createElement("div",{className:"components-notice is-warning"},a().createElement("strong",null,(0,p.__)("Please click the Update button above to ensure that all changes are saved before publishing to Apple News.","apple-news"))):null,"N/A"===c||n?null:a().createElement(m.Button,{isPrimary:!0,onClick:u,style:{margin:"1em"}},(0,p.__)("Update","apple-news")),"N/A"===c||t?null:a().createElement(m.Button,{isSecondary:!0,onClick:i,style:{margin:"1em"}},(0,p.__)("Delete","apple-news")),"N/A"!==c||e?null:a().createElement(m.Button,{isPrimary:!0,onClick:s,style:{margin:"1em"}},(0,p.__)("Publish","apple-news"))):null;O.propTypes={apiAutosync:g().bool.isRequired,apiAutosyncDelete:g().bool.isRequired,apiAutosyncUpdate:g().bool.isRequired,deletePost:g().func.isRequired,loading:g().bool.isRequired,postIsDirty:g().bool.isRequired,postStatus:g().string.isRequired,publishPost:g().func.isRequired,publishState:g().string.isRequired,updatePost:g().func.isRequired,userCanPublish:g().bool.isRequired};var I=O;const q=({apiId:e,dateCreated:t,dateModified:n,revision:i,shareUrl:r,publishState:o})=>o&&"N/A"!==o?a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Publish Information","apple-news")},a().createElement("h3",null,(0,p.__)("API Id","apple-news")),a().createElement("p",null,e),a().createElement("h3",null,(0,p.__)("Created On","apple-news")),a().createElement("p",null,t),a().createElement("h3",null,(0,p.__)("Last Updated On","apple-news")),a().createElement("p",null,n),a().createElement("h3",null,(0,p.__)("Share URL","apple-news")),a().createElement("p",null,r),a().createElement("h3",null,(0,p.__)("Revision","apple-news")),a().createElement("p",null,i),a().createElement("h3",null,(0,p.__)("Publish State","apple-news")),a().createElement("p",null,o)):null;q.propTypes={apiId:g().string.isRequired,dateCreated:g().string.isRequired,dateModified:g().string.isRequired,revision:g().string.isRequired,shareUrl:g().string.isRequired,publishState:g().string.isRequired};var N=q;const D=({onChangePullquotePosition:e,onChangePullquoteText:t,pullquotePosition:n,pullquoteText:i})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Pull Quote","apple-news")},a().createElement(m.TextareaControl,{help:(0,p.__)("A pull quote is a key phrase, quotation, or excerpt that has been pulled from an article and used as a graphic element, serving to entice readers into the article or to highlight a key topic. This is optional and can be left blank.","apple-news"),label:(0,p.__)("Pull Quote Text","apple-news"),onChange:t,value:i}),a().createElement(m.SelectControl,{help:(0,p.__)("The position in the article where the pull quote will appear.","apple-news"),label:(0,p.__)("Pull Quote Position","apple-news"),onChange:e,options:[{label:(0,p.__)("top","apple-news"),value:"top"},{label:(0,p.__)("middle","apple-news"),value:"middle"},{label:(0,p.__)("bottom","apple-news"),value:"bottom"}],value:n||"middle"}));D.propTypes={onChangePullquotePosition:g().func.isRequired,onChangePullquoteText:g().func.isRequired,pullquotePosition:g().string.isRequired,pullquoteText:g().string.isRequired};var M=D;const L=({autoAssignCategories:e,automaticAssignment:t,onChangeAutoAssignCategories:n,onChangeSelectedSections:i,sections:r,selectedSections:o})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Sections","apple-news")},Array.isArray(r)&&0!==r.length?a().createElement(a().Fragment,null,t?a().createElement(m.CheckboxControl,{checked:e,label:(0,p.__)("Assign sections by category","apple-news"),onChange:n}):null,t&&!e?a().createElement("hr",null):null,t&&e?null:a().createElement(m.BaseControl,{help:(0,p.__)("Select the sections in which to publish this article. If none are selected, it will be published to the default section.","apple-news")},r.map((({id:e,name:t})=>a().createElement(m.CheckboxControl,{checked:o.includes(e),key:e,label:t,onChange:()=>i(e)}))))):a().createElement(m.Spinner,null));L.propTypes={autoAssignCategories:g().bool.isRequired,automaticAssignment:g().bool.isRequired,onChangeAutoAssignCategories:g().func.isRequired,onChangeSelectedSections:g().func.isRequired,sections:g().arrayOf(g().shape(R)).isRequired,selectedSections:g().arrayOf(g().string).isRequired};var U=L;const F=({onChangeSlug:e,slug:t})=>a().createElement(m.PanelBody,{initialOpen:!1,title:(0,p.__)("Slug","apple-news")},a().createElement(m.TextControl,{help:(0,p.__)("A word or phrase that will appear near the title, if the Slug component is enabled in theme settings. This is optional and can be left blank.","apple-news"),label:(0,p.__)("Slug Text","apple-news"),onChange:e,value:t}));F.propTypes={onChangeSlug:g().func.isRequired,slug:g().string.isRequired};var z=F,B=e=>{const t=(e=>{try{return JSON.parse(e)}catch(e){return null}})(e);return Array.isArray(t)?t:[]};(0,e.registerPlugin)("publish-to-apple-news",{icon:a().createElement(i,null),render:()=>{const[e,n]=(0,t.useState)({autoAssignCategories:!1,loading:!1,publishState:"N/A",sections:[],settings:{apiAutosync:!1,apiAutosyncDelete:!1,apiAutosyncUpdate:!1,automaticAssignment:!1},userCanPublish:!1}),{autoAssignCategories:i,loading:r,publishState:c,sections:m,settings:{apiAutosync:f,apiAutosyncDelete:g,apiAutosyncUpdate:h,automaticAssignment:y},userCanPublish:_}=e,v=(0,l.useDispatch)("core/notices"),{notices:b,postId:w,postIsDirty:C,postStatus:E}=(0,l.useSelect)((e=>{const t=e("core/editor");return{notices:t.getEditedPostAttribute("apple_news_notices"),postId:t.getCurrentPostId(),postIsDirty:t.isEditedPostDirty(),postStatus:t.getEditedPostAttribute("status")}})),[{apple_news_api_created_at:T="",apple_news_api_id:R="",apple_news_api_modified_at:k="",apple_news_api_revision:x="",apple_news_api_share_url:O="",apple_news_coverimage:q=0,apple_news_coverimage_caption:D="",apple_news_is_hidden:L=!1,apple_news_is_paid:F=!1,apple_news_is_preview:H=!1,apple_news_is_sponsored:j=!1,apple_news_maturity_rating:W="",apple_news_metadata:G="",apple_news_pullquote:V="",apple_news_pullquote_position:K="",apple_news_sections:$="",apple_news_slug:J=""},Y]=((e=null,t=null)=>{const n=(0,l.useSelect)((t=>e||t("core/editor").getCurrentPostType()),[]),[a,i]=(0,d.useEntityProp)("postType",n,"meta",t);return[a,(e,t)=>i({...a,[e]:t})]})(),Q=B(G),X=B($),Z=(0,t.useCallback)(((e,t="success")=>"success"===t?v.createInfoNotice(u().sanitize(e),{type:"snackbar"}):v.createErrorNotice(u().sanitize(e))),[v]),ee=async t=>{n({...e,loading:!0});try{const{notifications:a=[],publishState:i=""}=await o()({data:{id:w},method:"POST",path:`/apple-news/v1/${t}`});a.forEach((e=>Z(e.message,e.type))),n({...e,loading:!1,publishState:i})}catch(t){Z(t.message,"error"),n({...e,loading:!1})}};return(0,t.useEffect)((()=>{(async()=>{const t=[await o()({path:`/apple-news/v1/get-published-state/${w}`}),await o()({path:"/apple-news/v1/sections"}),await o()({path:"/apple-news/v1/get-settings"}),await o()({path:`/apple-news/v1/user-can-publish/${w}`})];try{const a=await Promise.all(t);n({...e,autoAssignCategories:(null===X||0===X.length)&&!0===a[2].automaticAssignment,...a[0],sections:a[1],settings:a[2],...a[3]})}catch(e){Z(e.message,"error")}})()}),[]),(0,t.useEffect)((()=>{b.forEach((e=>Z(e.message,e.type)))}),[Z,b]),a().createElement(a().Fragment,null,a().createElement(s.PluginSidebarMoreMenuItem,{target:"publish-to-apple-news"},(0,p.__)("Apple News Options","apple-news")),a().createElement(s.PluginSidebar,{name:"publish-to-apple-news",title:(0,p.__)("Publish to Apple News Options","apple-news")},a().createElement(U,{autoAssignCategories:i,automaticAssignment:y,onChangeAutoAssignCategories:t=>{n({...e,autoAssignCategories:t}),Y("apple_news_sections","")},onChangeSelectedSections:e=>Y("apple_news_sections",X.includes(e)?JSON.stringify(X.filter((t=>t!==e))):JSON.stringify([...X,e])),sections:m,selectedSections:X}),a().createElement(P,{isHidden:L,isPaid:F,isPreview:H,isSponsored:j,metadata:Q,onChangeIsHidden:e=>Y("apple_news_is_hidden",e),onChangeIsPaid:e=>Y("apple_news_is_paid",e),onChangeIsPreview:e=>Y("apple_news_is_preview",e),onChangeIsSponsored:e=>Y("apple_news_is_sponsored",e),onChangeMetadata:e=>Y("apple_news_metadata",JSON.stringify(e))}),a().createElement(S,{maturityRating:W,onChangeMaturityRating:e=>Y("apple_news_maturity_rating",e)}),a().createElement(z,{onChangeSlug:e=>Y("apple_news_slug",e),slug:J}),a().createElement(M,{onChangePullquotePosition:e=>Y("apple_news_pullquote_position",e),onChangePullquoteText:e=>Y("apple_news_pullquote",e),pullquotePosition:K,pullquoteText:V}),a().createElement(A,{coverImageCaption:D,coverImageId:q,onChangeCoverImageCaption:e=>Y("apple_news_coverimage_caption",e),onChangeCoverImageId:e=>Y("apple_news_coverimage",e)}),"N/A"!==c?a().createElement(N,{apiId:R,dateCreated:T,dateModified:k,publishState:c,revision:x,shareUrl:O}):null,a().createElement(I,{apiAutosync:f,apiAutosyncDelete:g,apiAutosyncUpdate:h,deletePost:()=>ee("delete"),loading:r,postIsDirty:C,postStatus:E,publishPost:()=>ee("publish"),publishState:c,updatePost:()=>ee("update"),userCanPublish:_})))}})}()}(); +//# sourceMappingURL=pluginSidebar.js.map \ No newline at end of file diff --git a/build/pluginSidebar.js.LICENSE.txt b/build/pluginSidebar.js.LICENSE.txt new file mode 100644 index 000000000..f0abe65ef --- /dev/null +++ b/build/pluginSidebar.js.LICENSE.txt @@ -0,0 +1 @@ +/*! @license DOMPurify 2.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.0/LICENSE */ diff --git a/build/pluginSidebar.js.map b/build/pluginSidebar.js.map new file mode 100644 index 000000000..d612fc5aa --- /dev/null +++ b/build/pluginSidebar.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://publish-to-apple-news/./node_modules/dompurify/dist/purify.js","webpack://publish-to-apple-news/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://publish-to-apple-news/./node_modules/prop-types/index.js","webpack://publish-to-apple-news/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://publish-to-apple-news/webpack/bootstrap","webpack://publish-to-apple-news/webpack/runtime/compat get default export","webpack://publish-to-apple-news/webpack/runtime/define property getters","webpack://publish-to-apple-news/webpack/runtime/hasOwnProperty shorthand","webpack://publish-to-apple-news/external [\"wp\",\"plugins\"]","webpack://publish-to-apple-news/external \"React\"","webpack://publish-to-apple-news/./assets/js/components/icon/index.jsx","webpack://publish-to-apple-news/external [\"wp\",\"apiFetch\"]","webpack://publish-to-apple-news/external [\"wp\",\"data\"]","webpack://publish-to-apple-news/external [\"wp\",\"editPost\"]","webpack://publish-to-apple-news/external [\"wp\",\"i18n\"]","webpack://publish-to-apple-news/external [\"wp\",\"coreData\"]","webpack://publish-to-apple-news/external [\"wp\",\"components\"]","webpack://publish-to-apple-news/external [\"wp\",\"blockEditor\"]","webpack://publish-to-apple-news/./assets/js/services/media/get-media-url.js","webpack://publish-to-apple-news/./assets/js/components/media-picker/index.jsx","webpack://publish-to-apple-news/./assets/js/components/image-picker/index.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/cover-image.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/maturity-rating.jsx","webpack://publish-to-apple-news/./assets/js/config/prop-types.js","webpack://publish-to-apple-news/./assets/js/util/delete-at-index.js","webpack://publish-to-apple-news/./assets/js/util/update-value-at-index.js","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/metadata.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/publish-controls.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/publish-info.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/pull-quote.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/sections.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/panels/slug.jsx","webpack://publish-to-apple-news/./assets/js/util/safe-json-parse-array.js","webpack://publish-to-apple-news/./assets/js/util/safe-json-parse.js","webpack://publish-to-apple-news/./assets/js/pluginsidebar/index.jsx","webpack://publish-to-apple-news/./assets/js/pluginsidebar/sidebar.jsx","webpack://publish-to-apple-news/./assets/js/services/hooks/use-post-meta/index.js"],"names":["module","exports","hasOwnProperty","Object","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","create","_ref","Reflect","apply","construct","fun","thisValue","args","x","Func","Function","prototype","bind","concat","arr","Array","isArray","i","arr2","length","from","_toConsumableArray","func","arrayForEach","unapply","forEach","arrayPop","pop","arrayPush","push","stringToLowerCase","String","toLowerCase","stringMatch","match","stringReplace","replace","stringIndexOf","indexOf","stringTrim","trim","regExpTest","RegExp","test","typeErrorCreate","TypeError","_len2","arguments","_key2","thisArg","_len","_key","addToSet","set","array","l","element","lcElement","clone","object","newObject","property","lookupGetter","prop","desc","get","value","console","warn","html","svg","svgFilters","svgDisallowed","mathMl","mathMlDisallowed","text","html$1","svg$1","mathMl$1","xml","MUSTACHE_EXPR","ERB_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","_typeof","Symbol","iterator","obj","constructor","_toConsumableArray$1","getGlobal","window","_createTrustedTypesPolicy","trustedTypes","document","createPolicy","suffix","ATTR_NAME","currentScript","hasAttribute","getAttribute","policyName","createHTML","html$$1","_","createDOMPurify","undefined","DOMPurify","root","version","removed","nodeType","isSupported","originalDocument","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","_window$NamedNodeMap","NamedNodeMap","MozNamedAttrMap","Text","Comment","DOMParser","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","content","ownerDocument","trustedTypesPolicy","emptyHTML","RETURN_TRUSTED_TYPE","_document","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","documentMode","hooks","createHTMLDocument","MUSTACHE_EXPR$$1","ERB_EXPR$$1","DATA_ATTR$$1","ARIA_ATTR$$1","IS_SCRIPT_OR_DATA$$1","ATTR_WHITESPACE$$1","IS_ALLOWED_URI$$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_DOM_IMPORT","SANITIZE_DOM","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","CONFIG","formElement","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","namespaceURI","parentTagName","Boolean","commonSvgAndHTMLElements","_forceRemove","node","parentNode","removeChild","outerHTML","remove","_removeAttribute","name","attribute","getAttributeNode","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","body","insertBefore","createTextNode","childNodes","call","_createIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","_isClobbered","elm","nodeName","textContent","attributes","_isNode","_executeHook","entryPoint","currentNode","data","hook","_sanitizeElements","allowedTags","firstElementChild","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attr","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","_attr","forceKeepAttr","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","oldNode","returnNode","toString","toStaticHTML","appendChild","firstChild","nodeIterator","serializedHTML","setConfig","clearConfig","isValidAttribute","tag","addHook","hookFunction","removeHook","removeHooks","removeAllHooks","factory","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","bool","number","string","symbol","any","arrayOf","elementType","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","enableBackground","height","viewBox","width","xmlns","y","media","size","media_details","sizes","source_url","firstChoice","full","thirdChoice","url","secondChoice","fourthChoice","fifthChoice","sixthChoice","MediaPicker","allowedTypes","className","imageSize","onReset","onUpdate","useSelect","select","getMedia","Spinner","style","backgroundColor","display","position","MediaUploadCheck","MediaUpload","title","__","onSelect","render","open","alt","src","getMediaUrl","background","left","padding","top","transform","zIndex","Button","isPrimary","isLarge","onClick","marginBottom","isLink","isDestructive","defaultProps","propTypes","ImagePicker","CoverImage","coverImageCaption","coverImageId","onChangeCoverImageCaption","onChangeCoverImageId","PanelBody","initialOpen","BaseControl","id","TextareaControl","help","label","onChange","placeholder","MaturityRating","maturityRating","onChangeMaturityRating","SelectControl","options","METADATA_SHAPE","type","SECTION_SHAPE","values","index","valuesCopy","map","item","Metadata","isHidden","isPaid","isPreview","isSponsored","metadata","onChangeIsHidden","onChangeIsPaid","onChangeIsPreview","onChangeIsSponsored","onChangeMetadata","CheckboxControl","checked","TextControl","next","updateValueAtIndex","parseFloat","filter","idx","deleteAtIndex","PublishControls","apiAutosync","apiAutosyncDelete","apiAutosyncUpdate","deletePost","loading","postIsDirty","postStatus","publishPost","publishState","updatePost","userCanPublish","margin","isSecondary","PublishInfo","apiId","dateCreated","dateModified","revision","shareUrl","PullQuote","onChangePullquotePosition","onChangePullquoteText","pullquotePosition","pullquoteText","Sections","autoAssignCategories","automaticAssignment","onChangeAutoAssignCategories","onChangeSelectedSections","sections","selectedSections","includes","Slug","onChangeSlug","slug","parsedValue","JSON","parse","e","safeJsonParse","registerPlugin","icon","state","setState","useState","settings","dispatchNotice","useDispatch","notices","postId","editor","getEditedPostAttribute","getCurrentPostId","isEditedPostDirty","apple_news_api_created_at","apple_news_api_id","apple_news_api_modified_at","apple_news_api_revision","apple_news_api_share_url","apple_news_coverimage","apple_news_coverimage_caption","apple_news_is_hidden","apple_news_is_paid","apple_news_is_preview","apple_news_is_sponsored","apple_news_maturity_rating","apple_news_metadata","metadataRaw","apple_news_pullquote","apple_news_pullquote_position","apple_news_sections","selectedSectionsRaw","apple_news_slug","setMeta","postType","getCurrentPostType","meta","useEntityProp","usePostMeta","safeJsonParseArray","displayNotification","useCallback","message","createInfoNotice","createErrorNotice","modifyPost","async","notifications","nextPublishState","apiFetch","method","path","operation","notification","error","useEffect","fetches","Promise","all","notice","PluginSidebarMoreMenuItem","target","PluginSidebar","stringify","section"],"mappings":";mCAGiEA,EAAOC,QAGhE,WAAc,aAIpB,IAAIC,EAAiBC,OAAOD,eACxBE,EAAiBD,OAAOC,eACxBC,EAAWF,OAAOE,SAClBC,EAAiBH,OAAOG,eACxBC,EAA2BJ,OAAOI,yBAClCC,EAASL,OAAOK,OAChBC,EAAON,OAAOM,KACdC,EAASP,OAAOO,OAEhBC,EAA0B,oBAAZC,SAA2BA,QACzCC,EAAQF,EAAKE,MACbC,EAAYH,EAAKG,UAEhBD,IACHA,EAAQ,SAAeE,EAAKC,EAAWC,GACrC,OAAOF,EAAIF,MAAMG,EAAWC,KAI3BT,IACHA,EAAS,SAAgBU,GACvB,OAAOA,IAINT,IACHA,EAAO,SAAcS,GACnB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cA,EACdC,0BAA4BsC,GAASgF,EAAQ,gCAAiChF,GAC9ErC,qBAAuBqC,GAASgF,EAAQ,wBAAyBhF,KAEjD,QAAjBe,EACC,kBAAC,EAAD,CACEM,MAAOA,EACPC,YAAaA,EACbC,aAAcA,EACdR,aAAcA,EACdS,SAAUA,EACVC,SAAUA,IAEV,KACJ,kBAAC,EAAD,CACElB,YAAaA,EACbC,kBAAmBA,EACnBC,kBAAmBA,EACnBC,WAAY,IAAMkF,GAAW,UAC7BjF,QAASA,EACTC,YAAaA,EACbC,WAAYA,EACZC,YAAa,IAAM8E,GAAW,WAC9B7E,aAAcA,EACdC,WAAY,IAAM4E,GAAW,UAC7B3E,eAAgBA,S","file":"pluginSidebar.js","sourcesContent":["/*! @license DOMPurify 2.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.0/LICENSE */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.DOMPurify = factory());\n}(this, function () { 'use strict';\n\n function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n var hasOwnProperty = Object.hasOwnProperty,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\n\n var _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\n\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n\n if (!construct) {\n construct = function construct(Func, args) {\n return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();\n };\n }\n\n var arrayForEach = unapply(Array.prototype.forEach);\n var arrayPop = unapply(Array.prototype.pop);\n var arrayPush = unapply(Array.prototype.push);\n\n var stringToLowerCase = unapply(String.prototype.toLowerCase);\n var stringMatch = unapply(String.prototype.match);\n var stringReplace = unapply(String.prototype.replace);\n var stringIndexOf = unapply(String.prototype.indexOf);\n var stringTrim = unapply(String.prototype.trim);\n\n var regExpTest = unapply(RegExp.prototype.test);\n\n var typeErrorCreate = unconstruct(TypeError);\n\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return apply(func, thisArg, args);\n };\n }\n\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return construct(func, args);\n };\n }\n\n /* Add properties to a lookup table */\n function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }\n\n /* Shallow clone an object */\n function clone(object) {\n var newObject = create(null);\n\n var property = void 0;\n for (property in object) {\n if (apply(hasOwnProperty, object, [property])) {\n newObject[property] = object[property];\n }\n }\n\n return newObject;\n }\n\n /* IE10 doesn't support __lookupGetter__ so lets'\n * simulate it. It also automatically checks\n * if the prop is function or getter and behaves\n * accordingly. */\n function lookupGetter(object, prop) {\n while (object !== null) {\n var desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n }\n\n var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n\n var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n\n var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n\n var text = freeze(['#text']);\n\n var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n\n var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n\n var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n\n var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n var MUSTACHE_EXPR = seal(/\\{\\{[\\s\\S]*|[\\s\\S]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n var ERB_EXPR = seal(/<%[\\s\\S]*|[\\s\\S]*%>/gm);\n var DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n var ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n var IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n var ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n var getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {Document} document The document object (to determine policy name suffix)\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported).\n */\n var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {\n if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n var suffix = null;\n var ATTR_NAME = 'data-tt-policy-suffix';\n if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {\n suffix = document.currentScript.getAttribute(ATTR_NAME);\n }\n\n var policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML: function createHTML(html$$1) {\n return html$$1;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n\n function createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '2.3.0';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n Text = window.Text,\n Comment = window.Comment,\n DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n\n\n var ElementPrototype = Element.prototype;\n\n var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n var getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);\n var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';\n\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n createDocumentFragment = _document.createDocumentFragment,\n getElementsByTagName = _document.getElementsByTagName;\n var importNode = originalDocument.importNode;\n\n\n var documentMode = {};\n try {\n documentMode = clone(document).documentMode ? document.documentMode : {};\n } catch (_) {}\n\n var hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;\n\n var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,\n ERB_EXPR$$1 = ERB_EXPR,\n DATA_ATTR$$1 = DATA_ATTR,\n ARIA_ATTR$$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));\n\n /* Allowed attribute names */\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n var FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n var FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n var ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n var ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n var SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n var WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n var SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n var FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n var RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n var RETURN_DOM_FRAGMENT = false;\n\n /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM\n * `Node` is imported into the current `Document`. If this flag is not enabled the\n * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by\n * DOMPurify.\n *\n * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`\n * might cause XSS from attacks hidden in closed shadowroots in case the browser\n * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/\n */\n var RETURN_DOM_IMPORT = true;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n var RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks? */\n var SANITIZE_DOM = true;\n\n /* Keep element content when removing element? */\n var KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n var IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n var USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n var DATA_URI_TAGS = null;\n var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n var URI_SAFE_ATTRIBUTES = null;\n var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);\n\n var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n var NAMESPACE = HTML_NAMESPACE;\n var IS_EMPTY_INPUT = false;\n\n /* Keep a reference to config to pass to hooks */\n var CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n var _parseConfig = function _parseConfig(cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html);\n addToSet(ALLOWED_ATTR, html$1);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl);\n addToSet(ALLOWED_ATTR, mathMl$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n\n var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n var ALL_SVG_TAGS = addToSet({}, svg);\n addToSet(ALL_SVG_TAGS, svgFilters);\n addToSet(ALL_SVG_TAGS, svgDisallowed);\n\n var ALL_MATHML_TAGS = addToSet({}, mathMl);\n addToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n var _checkValidNamespace = function _checkValidNamespace(element) {\n var parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: HTML_NAMESPACE,\n tagName: 'template'\n };\n }\n\n var tagName = stringToLowerCase(element.tagName);\n var parentTagName = stringToLowerCase(parent.tagName);\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erronously deleted from\n // HTML namespace.\n var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG or MathML). Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n var _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, { element: node });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n try {\n node.outerHTML = emptyHTML;\n } catch (_) {\n node.remove();\n }\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc = void 0;\n var leadingWhitespace = void 0;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n var matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n var body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n var _isClobbered = function _isClobbered(elm) {\n if (elm instanceof Text || elm instanceof Comment) {\n return false;\n }\n\n if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {\n return true;\n }\n\n return false;\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n var _isNode = function _isNode(object) {\n return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content = void 0;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check if tagname contains Unicode */\n if (stringMatch(currentNode.nodeName, /[\\u0080-\\uFFFF]/)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n var tagName = stringToLowerCase(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n var parentNode = getParentNode(currentNode) || currentNode.parentNode;\n var childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n var childCount = childNodes.length;\n\n for (var i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\\/no(script|embed)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');\n content = stringReplace(content, ERB_EXPR$$1, ' ');\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n return false;\n\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {\n return false;\n }\n\n return true;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n var attr = void 0;\n var value = void 0;\n var lcName = void 0;\n var l = void 0;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n var attributes = currentNode.attributes;\n\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n var hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n var _attr = attr,\n name = _attr.name,\n namespaceURI = _attr.namespaceURI;\n\n value = stringTrim(attr.value);\n lcName = stringToLowerCase(name);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');\n value = stringReplace(value, ERB_EXPR$$1, ' ');\n }\n\n /* Is `value` valid for this attribute? */\n var lcTag = currentNode.nodeName.toLowerCase();\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n var shadowNode = void 0;\n var shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg) {\n var body = void 0;\n var importedNode = void 0;\n var currentNode = void 0;\n var oldNode = void 0;\n var returnNode = void 0;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw typeErrorCreate('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) ; else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : emptyHTML;\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n var nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n oldNode = null;\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n var lcTag = stringToLowerCase(tag);\n var lcName = stringToLowerCase(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n }\n\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","import React from 'react';\n\nconst Icon = () => (\n \n \n \n \n \n \n \n \n \n);\n\nexport default Icon;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Given a media object returned from the WordPress REST API, extracts the\n * URL for the media item at the requested size if it exists, or the full\n * size if it does not. Returns an empty string if unable to find either.\n * @param {object} media - A media object returned by the WordPress API.\n * @param {string} size - Media size to request. Default: full\n * @returns {string} - The URL to the asset, or an empty string on failure.\n */\nconst getMediaUrl = (media, size = 'full') => {\n const {\n media_details: {\n sizes: {\n [size]: {\n source_url: firstChoice = '',\n } = {},\n full: {\n source_url: thirdChoice = '',\n } = {},\n } = {},\n } = {},\n sizes: {\n [size]: {\n url: secondChoice = '',\n } = {},\n full: {\n url: fourthChoice = '',\n } = {},\n } = {},\n source_url: fifthChoice = '',\n url: sixthChoice = '',\n } = media;\n\n return firstChoice\n || secondChoice\n || thirdChoice\n || fourthChoice\n || fifthChoice\n || sixthChoice\n || '';\n};\n\nexport default getMediaUrl;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport { Button, Spinner } from '@wordpress/components';\nimport { MediaUpload, MediaUploadCheck } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n// Services.\nimport getMediaUrl from '../../services/media/get-media-url';\n\nconst MediaPicker = ({\n allowedTypes,\n className,\n value,\n imageSize,\n onReset,\n onUpdate,\n}) => {\n // Get the media object given the media ID.\n const {\n media = null,\n } = useSelect((select) => ({\n media: select('core').getMedia(value),\n }), [value]);\n\n // getEntityRecord returns `null` if the load is in progress.\n if (value !== 0 && media === null) {\n return (\n \n );\n }\n\n return (\n \n \n (\n <>\n {value !== 0 && media !== null ? (\n
\n \n \n \n { __('Replace File', 'apple-news')}\n \n \n { __('Remove File', 'apple-news')}\n \n
\n \n ) : null}\n {value === 0 ? (\n \n \n { __('Select/add File', 'apple-news')}\n \n \n ) : null}\n \n )}\n />\n
\n \n );\n};\n\nMediaPicker.defaultProps = {\n allowedTypes: [],\n className: '',\n imageSize: 'thumbnail',\n};\n\nMediaPicker.propTypes = {\n allowedTypes: PropTypes.arrayOf([PropTypes.string]),\n className: PropTypes.string,\n value: PropTypes.number.isRequired,\n imageSize: PropTypes.string,\n onReset: PropTypes.func.isRequired,\n onUpdate: PropTypes.func.isRequired,\n};\n\nexport default MediaPicker;\n","import PropTypes from 'prop-types';\nimport React from 'react';\n\n// Components.\nimport MediaPicker from '../media-picker';\n\nconst ImagePicker = ({\n className,\n imageSize,\n onReset,\n onUpdate,\n value,\n}) => (\n \n);\n\nImagePicker.defaultProps = {\n className: '',\n imageSize: 'thumbnail',\n};\n\nImagePicker.propTypes = {\n className: PropTypes.string,\n imageSize: PropTypes.string,\n onReset: PropTypes.func.isRequired,\n onUpdate: PropTypes.func.isRequired,\n value: PropTypes.number.isRequired,\n};\n\nexport default ImagePicker;\n","import { BaseControl, PanelBody, TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\n// Components.\nimport ImagePicker from '../../components/image-picker';\n\nconst CoverImage = ({\n coverImageCaption,\n coverImageId,\n onChangeCoverImageCaption,\n onChangeCoverImageId,\n}) => (\n \n \n onChangeCoverImageId(0)}\n onUpdate={({ id }) => onChangeCoverImageId(id)}\n value={coverImageId}\n />\n \n \n \n);\n\nCoverImage.propTypes = {\n coverImageCaption: PropTypes.string.isRequired,\n coverImageId: PropTypes.number.isRequired,\n onChangeCoverImageCaption: PropTypes.func.isRequired,\n onChangeCoverImageId: PropTypes.func.isRequired,\n};\n\nexport default CoverImage;\n","import { PanelBody, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nconst MaturityRating = ({\n maturityRating,\n onChangeMaturityRating,\n}) => (\n \n \n \n);\n\nMaturityRating.propTypes = {\n maturityRating: PropTypes.string.isRequired,\n onChangeMaturityRating: PropTypes.func.isRequired,\n};\n\nexport default MaturityRating;\n","/* eslint-disable import/prefer-default-export */\n\nimport PropTypes from 'prop-types';\n\nexport const METADATA_SHAPE = {\n key: PropTypes.string.isRequired,\n type: PropTypes.oneOf([\n 'array',\n 'boolean',\n 'number',\n 'string',\n ]),\n value: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.bool,\n PropTypes.number,\n PropTypes.string,\n ]),\n};\n\nexport const SECTION_SHAPE = {\n id: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n};\n","/**\n * Given an array of values, returns a copy of the array with the value at the\n * given index removed.\n * @param {Array} values - The array of values to modify.\n * @param {number} index - The index to remove.\n * @returns {Array} A copy of the values array with the value at the specified index removed.\n */\nconst deleteAtIndex = (values, index) => values.filter((value, idx) => index !== idx);\n\nexport default deleteAtIndex;\n","/**\n * Given an array of objects, a key, and a value, returns a copy of the array\n * with the value for the key set at the given index.\n * @param {Array} values - An array of objects.\n * @param {string} key - The object key to update.\n * @param {*} value - The value to set for the key.\n * @param {number} index - The index to set the value on.\n * @returns {Array} A copy of the array with the value set for the key at the given index.\n */\nconst updateValueAtIndex = (values, key, value, index) => {\n const valuesCopy = values.map((item) => ({ ...item }));\n valuesCopy[index][key] = value;\n return valuesCopy;\n};\n\nexport default updateValueAtIndex;\n","import {\n Button,\n CheckboxControl,\n PanelBody,\n SelectControl,\n TextControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\n// Config.\nimport { METADATA_SHAPE } from '../../config/prop-types';\n\n// Util.\nimport deleteAtIndex from '../../util/delete-at-index';\nimport updateValueAtIndex from '../../util/update-value-at-index';\n\nconst Metadata = ({\n isHidden,\n isPaid,\n isPreview,\n isSponsored,\n metadata,\n onChangeIsHidden,\n onChangeIsPaid,\n onChangeIsPreview,\n onChangeIsSponsored,\n onChangeMetadata,\n}) => (\n \n \n \n