diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/js/dist/edit-site.js --- a/wp/wp-includes/js/dist/edit-site.js Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/js/dist/edit-site.js Fri Sep 05 18:52:52 2025 +0200 @@ -1,725 +1,703 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ +/***/ 83: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + +var React = __webpack_require__(1609); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue; +function useSyncExternalStore$2(subscribe, getSnapshot) { + var value = getSnapshot(), + _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }), + inst = _useState[0].inst, + forceUpdate = _useState[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function useSyncExternalStore$1(subscribe, getSnapshot) { + return getSnapshot(); +} +var shim = + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ? useSyncExternalStore$1 + : useSyncExternalStore$2; +exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; + + +/***/ }), + +/***/ 422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +if (true) { + module.exports = __webpack_require__(83); +} else {} + + +/***/ }), + +/***/ 1609: +/***/ ((module) => { + +"use strict"; +module.exports = window["React"]; + +/***/ }), + /***/ 4660: /***/ ((module) => { +/** + * Credits: + * + * lib-font + * https://github.com/Pomax/lib-font + * https://github.com/Pomax/lib-font/blob/master/lib/inflate.js + * + * The MIT License (MIT) + * + * Copyright (c) 2020 pomax@nihongoresources.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* eslint eslint-comments/no-unlimited-disable: 0 */ /* eslint-disable */ -/* pako 1.0.10 nodeca/pako */ ( function ( f ) { - if ( true ) { - module.exports = f(); - } else { var g; } -} )( function () { - var define, module, exports; - return ( function () { - function r( e, n, t ) { - function o( i, f ) { - if ( ! n[ i ] ) { - if ( ! e[ i ] ) { - var c = undefined; - if ( ! f && c ) return require( i, ! 0 ); - if ( u ) return u( i, ! 0 ); - var a = new Error( "Cannot find module '" + i + "'" ); - throw ( ( a.code = 'MODULE_NOT_FOUND' ), a ); - } - var p = ( n[ i ] = { exports: {} } ); - e[ i ][ 0 ].call( - p.exports, - function ( r ) { - var n = e[ i ][ 1 ][ r ]; - return o( n || r ); - }, - p, - p.exports, - r, - e, - n, - t - ); - } - return n[ i ].exports; - } - for ( - var u = undefined, i = 0; - i < t.length; - i++ - ) - o( t[ i ] ); - return o; - } - return r; - } )()( - { - 1: [ - function ( require, module, exports ) { - 'use strict'; - - var TYPED_OK = - typeof Uint8Array !== 'undefined' && - typeof Uint16Array !== 'undefined' && - typeof Int32Array !== 'undefined'; - - function _has( obj, key ) { - return Object.prototype.hasOwnProperty.call( obj, key ); - } - - exports.assign = function ( - obj /*from1, from2, from3, ...*/ - ) { - var sources = Array.prototype.slice.call( - arguments, - 1 - ); - while ( sources.length ) { - var source = sources.shift(); - if ( ! source ) { - continue; - } - - if ( typeof source !== 'object' ) { - throw new TypeError( - source + 'must be non-object' - ); - } - - for ( var p in source ) { - if ( _has( source, p ) ) { - obj[ p ] = source[ p ]; - } - } - } - - return obj; - }; - - // reduce buffer size, avoiding mem copy - exports.shrinkBuf = function ( buf, size ) { - if ( buf.length === size ) { - return buf; - } - if ( buf.subarray ) { - return buf.subarray( 0, size ); - } - buf.length = size; - return buf; - }; - - var fnTyped = { - arraySet: function ( - dest, - src, - src_offs, - len, - dest_offs - ) { - if ( src.subarray && dest.subarray ) { - dest.set( - src.subarray( src_offs, src_offs + len ), - dest_offs - ); - return; - } - // Fallback to ordinary array - for ( var i = 0; i < len; i++ ) { - dest[ dest_offs + i ] = src[ src_offs + i ]; - } - }, - // Join array of chunks to single array. - flattenChunks: function ( chunks ) { - var i, l, len, pos, chunk, result; - - // calculate data length - len = 0; - for ( i = 0, l = chunks.length; i < l; i++ ) { - len += chunks[ i ].length; - } - - // join chunks - result = new Uint8Array( len ); - pos = 0; - for ( i = 0, l = chunks.length; i < l; i++ ) { - chunk = chunks[ i ]; - result.set( chunk, pos ); - pos += chunk.length; - } - - return result; - }, - }; - - var fnUntyped = { - arraySet: function ( - dest, - src, - src_offs, - len, - dest_offs - ) { - for ( var i = 0; i < len; i++ ) { - dest[ dest_offs + i ] = src[ src_offs + i ]; - } - }, - // Join array of chunks to single array. - flattenChunks: function ( chunks ) { - return [].concat.apply( [], chunks ); - }, - }; - - // Enable/Disable typed arrays use, for testing - // - exports.setTyped = function ( on ) { - if ( on ) { - exports.Buf8 = Uint8Array; - exports.Buf16 = Uint16Array; - exports.Buf32 = Int32Array; - exports.assign( exports, fnTyped ); - } else { - exports.Buf8 = Array; - exports.Buf16 = Array; - exports.Buf32 = Array; - exports.assign( exports, fnUntyped ); - } - }; - - exports.setTyped( TYPED_OK ); - }, - {}, - ], - 2: [ - function ( require, module, exports ) { - // String encode/decode helpers - 'use strict'; - - var utils = require( './common' ); - - // Quick check if we can use fast array to bin string conversion - // - // - apply(Array) can fail on Android 2.2 - // - apply(Uint8Array) can fail on iOS 5.1 Safari - // - var STR_APPLY_OK = true; - var STR_APPLY_UIA_OK = true; - - try { - String.fromCharCode.apply( null, [ 0 ] ); - } catch ( __ ) { - STR_APPLY_OK = false; - } - try { - String.fromCharCode.apply( null, new Uint8Array( 1 ) ); - } catch ( __ ) { - STR_APPLY_UIA_OK = false; - } - - // Table with utf8 lengths (calculated by first byte of sequence) - // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, - // because max possible codepoint is 0x10ffff - var _utf8len = new utils.Buf8( 256 ); - for ( var q = 0; q < 256; q++ ) { - _utf8len[ q ] = - q >= 252 - ? 6 - : q >= 248 - ? 5 - : q >= 240 - ? 4 - : q >= 224 - ? 3 - : q >= 192 - ? 2 - : 1; - } - _utf8len[ 254 ] = _utf8len[ 254 ] = 1; // Invalid sequence start - - // convert string to array (typed, when possible) - exports.string2buf = function ( str ) { - var buf, - c, - c2, - m_pos, - i, - str_len = str.length, - buf_len = 0; - - // count binary size - for ( m_pos = 0; m_pos < str_len; m_pos++ ) { - c = str.charCodeAt( m_pos ); - if ( - ( c & 0xfc00 ) === 0xd800 && - m_pos + 1 < str_len - ) { - c2 = str.charCodeAt( m_pos + 1 ); - if ( ( c2 & 0xfc00 ) === 0xdc00 ) { - c = - 0x10000 + - ( ( c - 0xd800 ) << 10 ) + - ( c2 - 0xdc00 ); - m_pos++; - } - } - buf_len += - c < 0x80 - ? 1 - : c < 0x800 - ? 2 - : c < 0x10000 - ? 3 - : 4; - } - - // allocate buffer - buf = new utils.Buf8( buf_len ); - - // convert - for ( i = 0, m_pos = 0; i < buf_len; m_pos++ ) { - c = str.charCodeAt( m_pos ); - if ( - ( c & 0xfc00 ) === 0xd800 && - m_pos + 1 < str_len - ) { - c2 = str.charCodeAt( m_pos + 1 ); - if ( ( c2 & 0xfc00 ) === 0xdc00 ) { - c = - 0x10000 + - ( ( c - 0xd800 ) << 10 ) + - ( c2 - 0xdc00 ); - m_pos++; - } - } - if ( c < 0x80 ) { - /* one byte */ - buf[ i++ ] = c; - } else if ( c < 0x800 ) { - /* two bytes */ - buf[ i++ ] = 0xc0 | ( c >>> 6 ); - buf[ i++ ] = 0x80 | ( c & 0x3f ); - } else if ( c < 0x10000 ) { - /* three bytes */ - buf[ i++ ] = 0xe0 | ( c >>> 12 ); - buf[ i++ ] = 0x80 | ( ( c >>> 6 ) & 0x3f ); - buf[ i++ ] = 0x80 | ( c & 0x3f ); - } else { - /* four bytes */ - buf[ i++ ] = 0xf0 | ( c >>> 18 ); - buf[ i++ ] = 0x80 | ( ( c >>> 12 ) & 0x3f ); - buf[ i++ ] = 0x80 | ( ( c >>> 6 ) & 0x3f ); - buf[ i++ ] = 0x80 | ( c & 0x3f ); - } - } - - return buf; - }; - - // Helper (used in 2 places) - function buf2binstring( buf, len ) { - // On Chrome, the arguments in a function call that are allowed is `65534`. - // If the length of the buffer is smaller than that, we can use this optimization, - // otherwise we will take a slower path. - if ( len < 65534 ) { - if ( - ( buf.subarray && STR_APPLY_UIA_OK ) || - ( ! buf.subarray && STR_APPLY_OK ) - ) { - return String.fromCharCode.apply( - null, - utils.shrinkBuf( buf, len ) - ); - } - } - - var result = ''; - for ( var i = 0; i < len; i++ ) { - result += String.fromCharCode( buf[ i ] ); - } - return result; - } - - // Convert byte array to binary string - exports.buf2binstring = function ( buf ) { - return buf2binstring( buf, buf.length ); - }; - - // Convert binary string (typed, when possible) - exports.binstring2buf = function ( str ) { - var buf = new utils.Buf8( str.length ); - for ( var i = 0, len = buf.length; i < len; i++ ) { - buf[ i ] = str.charCodeAt( i ); - } - return buf; - }; - - // convert array to string - exports.buf2string = function ( buf, max ) { - var i, out, c, c_len; - var len = max || buf.length; - - // Reserve max possible length (2 words per char) - // NB: by unknown reasons, Array is significantly faster for - // String.fromCharCode.apply than Uint16Array. - var utf16buf = new Array( len * 2 ); - - for ( out = 0, i = 0; i < len; ) { - c = buf[ i++ ]; - // quick process ascii - if ( c < 0x80 ) { - utf16buf[ out++ ] = c; - continue; - } - - c_len = _utf8len[ c ]; - // skip 5 & 6 byte codes - if ( c_len > 4 ) { - utf16buf[ out++ ] = 0xfffd; - i += c_len - 1; - continue; - } - - // apply mask on first byte - c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; - // join the rest - while ( c_len > 1 && i < len ) { - c = ( c << 6 ) | ( buf[ i++ ] & 0x3f ); - c_len--; - } - - // terminated by end of string? - if ( c_len > 1 ) { - utf16buf[ out++ ] = 0xfffd; - continue; - } - - if ( c < 0x10000 ) { - utf16buf[ out++ ] = c; - } else { - c -= 0x10000; - utf16buf[ out++ ] = - 0xd800 | ( ( c >> 10 ) & 0x3ff ); - utf16buf[ out++ ] = 0xdc00 | ( c & 0x3ff ); - } - } - - return buf2binstring( utf16buf, out ); - }; - - // Calculate max possible position in utf8 buffer, - // that will not break sequence. If that's not possible - // - (very small limits) return max size as is. - // - // buf[] - utf8 bytes array - // max - length limit (mandatory); - exports.utf8border = function ( buf, max ) { - var pos; - - max = max || buf.length; - if ( max > buf.length ) { - max = buf.length; - } - - // go back from last position, until start of sequence found - pos = max - 1; - while ( pos >= 0 && ( buf[ pos ] & 0xc0 ) === 0x80 ) { - pos--; - } - - // Very small and broken sequence, - // return max, because we should return something anyway. - if ( pos < 0 ) { - return max; - } - - // If we came to start of buffer - that means buffer is too small, - // return max too. - if ( pos === 0 ) { - return max; - } - - return pos + _utf8len[ buf[ pos ] ] > max ? pos : max; - }; - }, - { './common': 1 }, - ], - 3: [ - function ( require, module, exports ) { - 'use strict'; - - // Note: adler32 takes 12% for level 0 and 2% for level 6. - // It isn't worth it to make additional optimizations as in original. - // Small size is preferable. - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - function adler32( adler, buf, len, pos ) { - var s1 = ( adler & 0xffff ) | 0, - s2 = ( ( adler >>> 16 ) & 0xffff ) | 0, - n = 0; - - while ( len !== 0 ) { - // Set limit ~ twice less than 5552, to keep - // s2 in 31-bits, because we force signed ints. - // in other case %= will fail. - n = len > 2000 ? 2000 : len; - len -= n; - - do { - s1 = ( s1 + buf[ pos++ ] ) | 0; - s2 = ( s2 + s1 ) | 0; - } while ( --n ); - - s1 %= 65521; - s2 %= 65521; - } - - return s1 | ( s2 << 16 ) | 0; - } - - module.exports = adler32; - }, - {}, - ], - 4: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - module.exports = { - /* Allowed flush values; see deflate() and inflate() below for details */ - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - //Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - //Z_VERSION_ERROR: -6, - - /* compression levels */ - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - - /* Possible values of the data_type field (though see inflate()) */ - Z_BINARY: 0, - Z_TEXT: 1, - //Z_ASCII: 1, // = Z_TEXT (deprecated) - Z_UNKNOWN: 2, - - /* The deflate compression method */ - Z_DEFLATED: 8, - //Z_NULL: null // Use -1 or null inline, depending on var type - }; - }, - {}, - ], - 5: [ - function ( require, module, exports ) { - 'use strict'; - - // Note: we can't get significant speed boost here. - // So write code to minimize size - no pregenerated tables - // and array tools dependencies. - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - // Use ordinary array, since untyped makes no boost here - function makeTable() { - var c, - table = []; - - for ( var n = 0; n < 256; n++ ) { - c = n; - for ( var k = 0; k < 8; k++ ) { - c = c & 1 ? 0xedb88320 ^ ( c >>> 1 ) : c >>> 1; - } - table[ n ] = c; - } - - return table; - } - - // Create table on load. Just 255 signed longs. Not a problem. - var crcTable = makeTable(); - - function crc32( crc, buf, len, pos ) { - var t = crcTable, - end = pos + len; - - crc ^= -1; - - for ( var i = pos; i < end; i++ ) { - crc = - ( crc >>> 8 ) ^ t[ ( crc ^ buf[ i ] ) & 0xff ]; - } - - return crc ^ -1; // >>> 0; - } - - module.exports = crc32; - }, - {}, - ], - 6: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - function GZheader() { - /* true if compressed data believed to be text */ - this.text = 0; - /* modification time */ - this.time = 0; - /* extra flags (not used when writing a gzip file) */ - this.xflags = 0; - /* operating system */ - this.os = 0; - /* pointer to extra field or Z_NULL if none */ - this.extra = null; - /* extra field length (valid if extra != Z_NULL) */ - this.extra_len = 0; // Actually, we don't need it in JS, - // but leave for few code modifications - - // - // Setup limits is not necessary because in js we should not preallocate memory - // for inflate use constant limit in 65536 bytes - // - - /* space at extra (only when reading header) */ - // this.extra_max = 0; - /* pointer to zero-terminated file name or Z_NULL */ - this.name = ''; - /* space at name (only when reading header) */ - // this.name_max = 0; - /* pointer to zero-terminated comment or Z_NULL */ - this.comment = ''; - /* space at comment (only when reading header) */ - // this.comm_max = 0; - /* true if there was or will be a header crc */ - this.hcrc = 0; - /* true when done reading gzip header (not used when writing a gzip file) */ - this.done = false; - } - - module.exports = GZheader; - }, - {}, - ], - 7: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - // See state defs from inflate.js - var BAD = 30; /* got a data error -- remain here until reset */ - var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ - - /* +/* pako 1.0.10 nodeca/pako */(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); + } + _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + + // convert string to array (typed, when possible) + exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; + }; + + // Helper (used in 2 places) + function buf2binstring(buf, len) { + // On Chrome, the arguments in a function call that are allowed is `65534`. + // If the length of the buffer is smaller than that, we can use this optimization, + // otherwise we will take a slower path. + if (len < 65534) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; + } + + + // Convert byte array to binary string + exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); + }; + + + // Convert binary string (typed, when possible) + exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; + }; + + + // convert array to string + exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); + }; + + + // Calculate max possible position in utf8 buffer, + // that will not break sequence. If that's not possible + // - (very small limits) return max size as is. + // + // buf[] - utf8 bytes array + // max - length limit (mandatory); + exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; + }; + + },{"./common":1}],3:[function(require,module,exports){ + 'use strict'; + + // Note: adler32 takes 12% for level 0 and 2% for level 6. + // It isn't worth it to make additional optimizations as in original. + // Small size is preferable. + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; + } + + + module.exports = adler32; + + },{}],4:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type + }; + + },{}],5:[function(require,module,exports){ + 'use strict'; + + // Note: we can't get significant speed boost here. + // So write code to minimize size - no pregenerated tables + // and array tools dependencies. + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + // Use ordinary array, since untyped makes no boost here + function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; + } + + // Create table on load. Just 255 signed longs. Not a problem. + var crcTable = makeTable(); + + + function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; + } + + + module.exports = crc32; + + },{}],6:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; + } + + module.exports = GZheader; + + },{}],7:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + // See state defs from inflate.js + var BAD = 30; /* got a data error -- remain here until reset */ + var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + + /* Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is available, an end-of-block is encountered, or a data error is encountered. @@ -754,656 +732,570 @@ requires strm.avail_out >= 258 for each loop to avoid checking for output space. */ - module.exports = function inflate_fast( strm, start ) { - var state; - var _in; /* local strm.input */ - var last; /* have enough input while in < last */ - var _out; /* local strm.output */ - var beg; /* inflate()'s initial strm.output */ - var end; /* while out < end, enough space available */ - //#ifdef INFLATE_STRICT - var dmax; /* maximum distance from zlib header */ - //#endif - var wsize; /* window size or zero if not using window */ - var whave; /* valid bytes in the window */ - var wnext; /* window write index */ - // Use `s_window` instead `window`, avoid conflict with instrumentation tools - var s_window; /* allocated sliding window, if wsize != 0 */ - var hold; /* local strm.hold */ - var bits; /* local strm.bits */ - var lcode; /* local strm.lencode */ - var dcode; /* local strm.distcode */ - var lmask; /* mask for first level of length codes */ - var dmask; /* mask for first level of distance codes */ - var here; /* retrieved table entry */ - var op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - var len; /* match length, unused bytes */ - var dist; /* match distance */ - var from; /* where to copy match from */ - var from_source; - - var input, output; // JS specific, because we have no pointers - - /* copy state to local variables */ - state = strm.state; - //here = state.here; - _in = strm.next_in; - input = strm.input; - last = _in + ( strm.avail_in - 5 ); - _out = strm.next_out; - output = strm.output; - beg = _out - ( start - strm.avail_out ); - end = _out + ( strm.avail_out - 257 ); - //#ifdef INFLATE_STRICT - dmax = state.dmax; - //#endif - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = ( 1 << state.lenbits ) - 1; - dmask = ( 1 << state.distbits ) - 1; - - /* decode literals and length/distances until end-of-block or not enough + module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ + //#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ + //#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); + //#ifdef INFLATE_STRICT + dmax = state.dmax; + //#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough input data or output space */ - top: do { - if ( bits < 15 ) { - hold += input[ _in++ ] << bits; - bits += 8; - hold += input[ _in++ ] << bits; - bits += 8; - } - - here = lcode[ hold & lmask ]; - - dolen: for (;;) { - // Goto emulation - op = here >>> 24 /*here.bits*/; - hold >>>= op; - bits -= op; - op = ( here >>> 16 ) & 0xff /*here.op*/; - if ( op === 0 ) { - /* literal */ - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - output[ _out++ ] = - here & 0xffff /*here.val*/; - } else if ( op & 16 ) { - /* length base */ - len = here & 0xffff /*here.val*/; - op &= 15; /* number of extra bits */ - if ( op ) { - if ( bits < op ) { - hold += input[ _in++ ] << bits; - bits += 8; - } - len += hold & ( ( 1 << op ) - 1 ); - hold >>>= op; - bits -= op; - } - //Tracevv((stderr, "inflate: length %u\n", len)); - if ( bits < 15 ) { - hold += input[ _in++ ] << bits; - bits += 8; - hold += input[ _in++ ] << bits; - bits += 8; - } - here = dcode[ hold & dmask ]; - - dodist: for (;;) { - // goto emulation - op = here >>> 24 /*here.bits*/; - hold >>>= op; - bits -= op; - op = ( here >>> 16 ) & 0xff /*here.op*/; - - if ( op & 16 ) { - /* distance base */ - dist = here & 0xffff /*here.val*/; - op &= 15; /* number of extra bits */ - if ( bits < op ) { - hold += input[ _in++ ] << bits; - bits += 8; - if ( bits < op ) { - hold += - input[ _in++ ] << bits; - bits += 8; - } - } - dist += hold & ( ( 1 << op ) - 1 ); - //#ifdef INFLATE_STRICT - if ( dist > dmax ) { - strm.msg = - 'invalid distance too far back'; - state.mode = BAD; - break top; - } - //#endif - hold >>>= op; - bits -= op; - //Tracevv((stderr, "inflate: distance %u\n", dist)); - op = - _out - - beg; /* max distance in output */ - if ( dist > op ) { - /* see if copy from window */ - op = - dist - - op; /* distance back in window */ - if ( op > whave ) { - if ( state.sane ) { - strm.msg = - 'invalid distance too far back'; - state.mode = BAD; - break top; - } - - // (!) This block is disabled in zlib defaults, - // don't enable it for binary compatibility - //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR - // if (len <= op - whave) { - // do { - // output[_out++] = 0; - // } while (--len); - // continue top; - // } - // len -= op - whave; - // do { - // output[_out++] = 0; - // } while (--op > whave); - // if (op === 0) { - // from = _out - dist; - // do { - // output[_out++] = output[from++]; - // } while (--len); - // continue top; - // } - //#endif - } - from = 0; // window index - from_source = s_window; - if ( wnext === 0 ) { - /* very common case */ - from += wsize - op; - if ( op < len ) { - /* some from window */ - len -= op; - do { - output[ _out++ ] = - s_window[ - from++ - ]; - } while ( --op ); - from = - _out - - dist; /* rest from output */ - from_source = output; - } - } else if ( wnext < op ) { - /* wrap around window */ - from += wsize + wnext - op; - op -= wnext; - if ( op < len ) { - /* some from end of window */ - len -= op; - do { - output[ _out++ ] = - s_window[ - from++ - ]; - } while ( --op ); - from = 0; - if ( wnext < len ) { - /* some from start of window */ - op = wnext; - len -= op; - do { - output[ - _out++ - ] = - s_window[ - from++ - ]; - } while ( --op ); - from = - _out - - dist; /* rest from output */ - from_source = - output; - } - } - } else { - /* contiguous in window */ - from += wnext - op; - if ( op < len ) { - /* some from window */ - len -= op; - do { - output[ _out++ ] = - s_window[ - from++ - ]; - } while ( --op ); - from = - _out - - dist; /* rest from output */ - from_source = output; - } - } - while ( len > 2 ) { - output[ _out++ ] = - from_source[ from++ ]; - output[ _out++ ] = - from_source[ from++ ]; - output[ _out++ ] = - from_source[ from++ ]; - len -= 3; - } - if ( len ) { - output[ _out++ ] = - from_source[ from++ ]; - if ( len > 1 ) { - output[ _out++ ] = - from_source[ - from++ - ]; - } - } - } else { - from = - _out - - dist; /* copy direct from output */ - do { - /* minimum length is three */ - output[ _out++ ] = - output[ from++ ]; - output[ _out++ ] = - output[ from++ ]; - output[ _out++ ] = - output[ from++ ]; - len -= 3; - } while ( len > 2 ); - if ( len ) { - output[ _out++ ] = - output[ from++ ]; - if ( len > 1 ) { - output[ _out++ ] = - output[ from++ ]; - } - } - } - } else if ( ( op & 64 ) === 0 ) { - /* 2nd level distance code */ - here = - dcode[ - ( here & - 0xffff ) /*here.val*/ + - ( hold & - ( ( 1 << op ) - - 1 ) ) - ]; - continue dodist; - } else { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } else if ( ( op & 64 ) === 0 ) { - /* 2nd level length code */ - here = - lcode[ - ( here & 0xffff ) /*here.val*/ + - ( hold & ( ( 1 << op ) - 1 ) ) - ]; - continue dolen; - } else if ( op & 32 ) { - /* end-of-block */ - //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; - break top; - } else { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } while ( _in < last && _out < end ); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= ( 1 << bits ) - 1; - - /* update state and return */ - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = - _in < last - ? 5 + ( last - _in ) - : 5 - ( _in - last ); - strm.avail_out = - _out < end - ? 257 + ( end - _out ) - : 257 - ( _out - end ); - state.hold = hold; - state.bits = bits; - return; - }; - }, - {}, - ], - 8: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - var utils = require( '../utils/common' ); - var adler32 = require( './adler32' ); - var crc32 = require( './crc32' ); - var inflate_fast = require( './inffast' ); - var inflate_table = require( './inftrees' ); - - var CODES = 0; - var LENS = 1; - var DISTS = 2; - - /* Public constants ==========================================================*/ - /* ===========================================================================*/ - - /* Allowed flush values; see deflate() and inflate() below for details */ - //var Z_NO_FLUSH = 0; - //var Z_PARTIAL_FLUSH = 1; - //var Z_SYNC_FLUSH = 2; - //var Z_FULL_FLUSH = 3; - var Z_FINISH = 4; - var Z_BLOCK = 5; - var Z_TREES = 6; - - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_NEED_DICT = 2; - //var Z_ERRNO = -1; - var Z_STREAM_ERROR = -2; - var Z_DATA_ERROR = -3; - var Z_MEM_ERROR = -4; - var Z_BUF_ERROR = -5; - //var Z_VERSION_ERROR = -6; - - /* The deflate compression method */ - var Z_DEFLATED = 8; - - /* STATES ====================================================================*/ - /* ===========================================================================*/ - - var HEAD = 1; /* i: waiting for magic header */ - var FLAGS = 2; /* i: waiting for method and flags (gzip) */ - var TIME = 3; /* i: waiting for modification time (gzip) */ - var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ - var EXLEN = 5; /* i: waiting for extra length (gzip) */ - var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ - var NAME = 7; /* i: waiting for end of file name (gzip) */ - var COMMENT = 8; /* i: waiting for end of comment (gzip) */ - var HCRC = 9; /* i: waiting for header crc (gzip) */ - var DICTID = 10; /* i: waiting for dictionary check value */ - var DICT = 11; /* waiting for inflateSetDictionary() call */ - var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ - var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ - var STORED = 14; /* i: waiting for stored size (length and complement) */ - var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ - var COPY = 16; /* i/o: waiting for input or output to copy stored block */ - var TABLE = 17; /* i: waiting for dynamic block table lengths */ - var LENLENS = 18; /* i: waiting for code length code lengths */ - var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ - var LEN_ = 20; /* i: same as LEN below, but only first time in */ - var LEN = 21; /* i: waiting for length/lit/eob code */ - var LENEXT = 22; /* i: waiting for length extra bits */ - var DIST = 23; /* i: waiting for distance code */ - var DISTEXT = 24; /* i: waiting for distance extra bits */ - var MATCH = 25; /* o: waiting for output space to copy string */ - var LIT = 26; /* o: waiting for output space to write literal */ - var CHECK = 27; /* i: waiting for 32-bit check value */ - var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ - var DONE = 29; /* finished check, done -- remain here until reset */ - var BAD = 30; /* got a data error -- remain here until reset */ - var MEM = 31; /* got an inflate() memory error -- remain here until reset */ - var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ - - /* ===========================================================================*/ - - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - - var MAX_WBITS = 15; - /* 32K LZ77 window */ - var DEF_WBITS = MAX_WBITS; - - function zswap32( q ) { - return ( - ( ( q >>> 24 ) & 0xff ) + - ( ( q >>> 8 ) & 0xff00 ) + - ( ( q & 0xff00 ) << 8 ) + - ( ( q & 0xff ) << 24 ) - ); - } - - function InflateState() { - this.mode = 0; /* current inflate mode */ - this.last = false; /* true if processing last block */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.havedict = false; /* true if dictionary provided */ - this.flags = 0; /* gzip header method and flags (0 if zlib) */ - this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ - this.check = 0; /* protected copy of check value */ - this.total = 0; /* protected copy of output count */ - // TODO: may be {} - this.head = - null; /* where to save gzip header information */ - - /* sliding window */ - this.wbits = 0; /* log base 2 of requested window size */ - this.wsize = 0; /* window size or zero if not using window */ - this.whave = 0; /* valid bytes in the window */ - this.wnext = 0; /* window write index */ - this.window = - null; /* allocated sliding window, if needed */ - - /* bit accumulator */ - this.hold = 0; /* input bit accumulator */ - this.bits = 0; /* number of bits in "in" */ - - /* for string and stored block copying */ - this.length = 0; /* literal or length of data to copy */ - this.offset = 0; /* distance back to copy string from */ - - /* for table and code decoding */ - this.extra = 0; /* extra bits needed */ - - /* fixed and dynamic code tables */ - this.lencode = - null; /* starting table for length/literal codes */ - this.distcode = - null; /* starting table for distance codes */ - this.lenbits = 0; /* index bits for lencode */ - this.distbits = 0; /* index bits for distcode */ - - /* dynamic table building */ - this.ncode = 0; /* number of code length code lengths */ - this.nlen = 0; /* number of length code lengths */ - this.ndist = 0; /* number of distance code lengths */ - this.have = 0; /* number of code lengths in lens[] */ - this.next = null; /* next available space in codes[] */ - - this.lens = new utils.Buf16( - 320 - ); /* temporary storage for code lengths */ - this.work = new utils.Buf16( - 288 - ); /* work area for code table building */ - - /* + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); + //#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + //#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + + // (!) This block is disabled in zlib defaults, + // don't enable it for binary compatibility + //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + // if (len <= op - whave) { + // do { + // output[_out++] = 0; + // } while (--len); + // continue top; + // } + // len -= op - whave; + // do { + // output[_out++] = 0; + // } while (--op > whave); + // if (op === 0) { + // from = _out - dist; + // do { + // output[_out++] = output[from++]; + // } while (--len); + // continue top; + // } + //#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; + }; + + },{}],8:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + var utils = require('../utils/common'); + var adler32 = require('./adler32'); + var crc32 = require('./crc32'); + var inflate_fast = require('./inffast'); + var inflate_table = require('./inftrees'); + + var CODES = 0; + var LENS = 1; + var DISTS = 2; + + /* Public constants ==========================================================*/ + /* ===========================================================================*/ + + + /* Allowed flush values; see deflate() and inflate() below for details */ + //var Z_NO_FLUSH = 0; + //var Z_PARTIAL_FLUSH = 1; + //var Z_SYNC_FLUSH = 2; + //var Z_FULL_FLUSH = 3; + var Z_FINISH = 4; + var Z_BLOCK = 5; + var Z_TREES = 6; + + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_NEED_DICT = 2; + //var Z_ERRNO = -1; + var Z_STREAM_ERROR = -2; + var Z_DATA_ERROR = -3; + var Z_MEM_ERROR = -4; + var Z_BUF_ERROR = -5; + //var Z_VERSION_ERROR = -6; + + /* The deflate compression method */ + var Z_DEFLATED = 8; + + + /* STATES ====================================================================*/ + /* ===========================================================================*/ + + + var HEAD = 1; /* i: waiting for magic header */ + var FLAGS = 2; /* i: waiting for method and flags (gzip) */ + var TIME = 3; /* i: waiting for modification time (gzip) */ + var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ + var EXLEN = 5; /* i: waiting for extra length (gzip) */ + var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ + var NAME = 7; /* i: waiting for end of file name (gzip) */ + var COMMENT = 8; /* i: waiting for end of comment (gzip) */ + var HCRC = 9; /* i: waiting for header crc (gzip) */ + var DICTID = 10; /* i: waiting for dictionary check value */ + var DICT = 11; /* waiting for inflateSetDictionary() call */ + var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ + var STORED = 14; /* i: waiting for stored size (length and complement) */ + var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ + var COPY = 16; /* i/o: waiting for input or output to copy stored block */ + var TABLE = 17; /* i: waiting for dynamic block table lengths */ + var LENLENS = 18; /* i: waiting for code length code lengths */ + var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ + var LEN_ = 20; /* i: same as LEN below, but only first time in */ + var LEN = 21; /* i: waiting for length/lit/eob code */ + var LENEXT = 22; /* i: waiting for length extra bits */ + var DIST = 23; /* i: waiting for distance code */ + var DISTEXT = 24; /* i: waiting for distance extra bits */ + var MATCH = 25; /* o: waiting for output space to copy string */ + var LIT = 26; /* o: waiting for output space to write literal */ + var CHECK = 27; /* i: waiting for 32-bit check value */ + var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ + var DONE = 29; /* finished check, done -- remain here until reset */ + var BAD = 30; /* got a data error -- remain here until reset */ + var MEM = 31; /* got an inflate() memory error -- remain here until reset */ + var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + + /* ===========================================================================*/ + + + + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + + var MAX_WBITS = 15; + /* 32K LZ77 window */ + var DEF_WBITS = MAX_WBITS; + + + function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); + } + + + function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* because we don't have pointers in js, we use lencode and distcode directly as buffers so we don't need codes */ - //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ - this.lendyn = - null; /* dynamic table for length/literal codes (JS specific) */ - this.distdyn = - null; /* dynamic table for distance codes (JS specific) */ - this.sane = 0; /* if false, allow invalid distance too far */ - this.back = 0; /* bits back of last unprocessed length/lit */ - this.was = 0; /* initial length of match */ - } - - function inflateResetKeep( strm ) { - var state; - - if ( ! strm || ! strm.state ) { - return Z_STREAM_ERROR; - } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ''; /*Z_NULL*/ - if ( state.wrap ) { - /* to support ill-conceived Java test suite */ - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null /*Z_NULL*/; - state.hold = 0; - state.bits = 0; - //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new utils.Buf32( - ENOUGH_LENS - ); - state.distcode = state.distdyn = new utils.Buf32( - ENOUGH_DISTS - ); - - state.sane = 1; - state.back = -1; - //Tracev((stderr, "inflate: reset\n")); - return Z_OK; - } - - function inflateReset( strm ) { - var state; - - if ( ! strm || ! strm.state ) { - return Z_STREAM_ERROR; - } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep( strm ); - } - - function inflateReset2( strm, windowBits ) { - var wrap; - var state; - - /* get the state */ - if ( ! strm || ! strm.state ) { - return Z_STREAM_ERROR; - } - state = strm.state; - - /* extract wrap request from windowBits parameter */ - if ( windowBits < 0 ) { - wrap = 0; - windowBits = -windowBits; - } else { - wrap = ( windowBits >> 4 ) + 1; - if ( windowBits < 48 ) { - windowBits &= 15; - } - } - - /* set number of window bits, free window if different */ - if ( - windowBits && - ( windowBits < 8 || windowBits > 15 ) - ) { - return Z_STREAM_ERROR; - } - if ( - state.window !== null && - state.wbits !== windowBits - ) { - state.window = null; - } - - /* update state and reset the rest of it */ - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset( strm ); - } - - function inflateInit2( strm, windowBits ) { - var ret; - var state; - - if ( ! strm ) { - return Z_STREAM_ERROR; - } - //strm.msg = Z_NULL; /* in case we return an error */ - - state = new InflateState(); - - //if (state === Z_NULL) return Z_MEM_ERROR; - //Tracev((stderr, "inflate: allocated\n")); - strm.state = state; - state.window = null /*Z_NULL*/; - ret = inflateReset2( strm, windowBits ); - if ( ret !== Z_OK ) { - strm.state = null /*Z_NULL*/; - } - return ret; - } - - function inflateInit( strm ) { - return inflateInit2( strm, DEF_WBITS ); - } - - /* + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ + } + + function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; + } + + function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + + } + + function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); + } + + function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; + } + + function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); + } + + + /* Return state with length and distance decoding tables and index sizes set to fixed code decoding. Normally this returns fixed tables from inffixed.h. If BUILDFIXED is defined, then instead this routine builds the tables the @@ -1413,72 +1305,45 @@ used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ - var virgin = true; - - var lenfix, distfix; // We have no pointers in JS, so keep tables separate - - function fixedtables( state ) { - /* build fixed huffman tables if first call (may not be thread safe) */ - if ( virgin ) { - var sym; - - lenfix = new utils.Buf32( 512 ); - distfix = new utils.Buf32( 32 ); - - /* literal/length table */ - sym = 0; - while ( sym < 144 ) { - state.lens[ sym++ ] = 8; - } - while ( sym < 256 ) { - state.lens[ sym++ ] = 9; - } - while ( sym < 280 ) { - state.lens[ sym++ ] = 7; - } - while ( sym < 288 ) { - state.lens[ sym++ ] = 8; - } - - inflate_table( - LENS, - state.lens, - 0, - 288, - lenfix, - 0, - state.work, - { bits: 9 } - ); - - /* distance table */ - sym = 0; - while ( sym < 32 ) { - state.lens[ sym++ ] = 5; - } - - inflate_table( - DISTS, - state.lens, - 0, - 32, - distfix, - 0, - state.work, - { bits: 5 } - ); - - /* do this just once */ - virgin = false; - } - - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; - } - - /* + var virgin = true; + + var lenfix, distfix; // We have no pointers in JS, so keep tables separate + + function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; + } + + + /* Update the window with the last wsize (normally 32K) bytes written before returning. If window does not exist yet, create it. This is only called when a window is already in use, or when output has been written during this @@ -1492,1592 +1357,1216 @@ output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ - function updatewindow( strm, src, end, copy ) { - var dist; - var state = strm.state; - - /* if it hasn't been done already, allocate space for the window */ - if ( state.window === null ) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - - state.window = new utils.Buf8( state.wsize ); - } - - /* copy state->wsize or less output bytes into the circular window */ - if ( copy >= state.wsize ) { - utils.arraySet( - state.window, - src, - end - state.wsize, - state.wsize, - 0 - ); - state.wnext = 0; - state.whave = state.wsize; - } else { - dist = state.wsize - state.wnext; - if ( dist > copy ) { - dist = copy; - } - //zmemcpy(state->window + state->wnext, end - copy, dist); - utils.arraySet( - state.window, - src, - end - copy, - dist, - state.wnext - ); - copy -= dist; - if ( copy ) { - //zmemcpy(state->window, end - copy, copy); - utils.arraySet( - state.window, - src, - end - copy, - copy, - 0 - ); - state.wnext = copy; - state.whave = state.wsize; - } else { - state.wnext += dist; - if ( state.wnext === state.wsize ) { - state.wnext = 0; - } - if ( state.whave < state.wsize ) { - state.whave += dist; - } - } - } - return 0; - } - - function inflate( strm, flush ) { - var state; - var input, output; // input/output buffers - var next; /* next input INDEX */ - var put; /* next output INDEX */ - var have, left; /* available input and output */ - var hold; /* bit buffer */ - var bits; /* bits in bit buffer */ - var _in, - _out; /* save starting available input and output */ - var copy; /* number of stored or match bytes to copy */ - var from; /* where to copy match bytes from */ - var from_source; - var here = 0; /* current decoding table entry */ - var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) - //var last; /* parent table entry */ - var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) - var len; /* length to copy for repeats, bits to drop */ - var ret; /* return code */ - var hbuf = new utils.Buf8( - 4 - ); /* buffer for gzip header crc calculation */ - var opts; - - var n; // temporary var for NEED_BITS - - var order = - /* permutation of code lengths */ - [ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, - 13, 2, 14, 1, 15, - ]; - - if ( - ! strm || - ! strm.state || - ! strm.output || - ( ! strm.input && strm.avail_in !== 0 ) - ) { - return Z_STREAM_ERROR; - } - - state = strm.state; - if ( state.mode === TYPE ) { - state.mode = TYPEDO; - } /* skip check */ - - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - _in = have; - _out = left; - ret = Z_OK; - - // goto emulation - inf_leave: for (;;) { - switch ( state.mode ) { - case HEAD: - if ( state.wrap === 0 ) { - state.mode = TYPEDO; - break; - } - //=== NEEDBITS(16); - while ( bits < 16 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( state.wrap & 2 && hold === 0x8b1f ) { - /* gzip header */ - state.check = 0 /*crc32(0L, Z_NULL, 0)*/; - //=== CRC2(state.check, hold); - hbuf[ 0 ] = hold & 0xff; - hbuf[ 1 ] = ( hold >>> 8 ) & 0xff; - state.check = crc32( - state.check, - hbuf, - 2, - 0 - ); - //===// - - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = FLAGS; - break; - } - state.flags = 0; /* expect zlib header */ - if ( state.head ) { - state.head.done = false; - } - if ( - ! ( - state.wrap & 1 - ) /* check if zlib header allowed */ || - ( ( ( hold & 0xff ) /*BITS(8)*/ << 8 ) + - ( hold >> 8 ) ) % - 31 - ) { - strm.msg = 'incorrect header check'; - state.mode = BAD; - break; - } - if ( - ( hold & 0x0f ) /*BITS(4)*/ !== - Z_DEFLATED - ) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// - len = ( hold & 0x0f ) /*BITS(4)*/ + 8; - if ( state.wbits === 0 ) { - state.wbits = len; - } else if ( len > state.wbits ) { - strm.msg = 'invalid window size'; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - //Tracev((stderr, "inflate: zlib header ok\n")); - strm.adler = - state.check = 1 /*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE; - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - break; - case FLAGS: - //=== NEEDBITS(16); */ - while ( bits < 16 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.flags = hold; - if ( - ( state.flags & 0xff ) !== - Z_DEFLATED - ) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - if ( state.flags & 0xe000 ) { - strm.msg = 'unknown header flags set'; - state.mode = BAD; - break; - } - if ( state.head ) { - state.head.text = ( hold >> 8 ) & 1; - } - if ( state.flags & 0x0200 ) { - //=== CRC2(state.check, hold); - hbuf[ 0 ] = hold & 0xff; - hbuf[ 1 ] = ( hold >>> 8 ) & 0xff; - state.check = crc32( - state.check, - hbuf, - 2, - 0 - ); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = TIME; - /* falls through */ - case TIME: - //=== NEEDBITS(32); */ - while ( bits < 32 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( state.head ) { - state.head.time = hold; - } - if ( state.flags & 0x0200 ) { - //=== CRC4(state.check, hold) - hbuf[ 0 ] = hold & 0xff; - hbuf[ 1 ] = ( hold >>> 8 ) & 0xff; - hbuf[ 2 ] = ( hold >>> 16 ) & 0xff; - hbuf[ 3 ] = ( hold >>> 24 ) & 0xff; - state.check = crc32( - state.check, - hbuf, - 4, - 0 - ); - //=== - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = OS; - /* falls through */ - case OS: - //=== NEEDBITS(16); */ - while ( bits < 16 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( state.head ) { - state.head.xflags = hold & 0xff; - state.head.os = hold >> 8; - } - if ( state.flags & 0x0200 ) { - //=== CRC2(state.check, hold); - hbuf[ 0 ] = hold & 0xff; - hbuf[ 1 ] = ( hold >>> 8 ) & 0xff; - state.check = crc32( - state.check, - hbuf, - 2, - 0 - ); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = EXLEN; - /* falls through */ - case EXLEN: - if ( state.flags & 0x0400 ) { - //=== NEEDBITS(16); */ - while ( bits < 16 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.length = hold; - if ( state.head ) { - state.head.extra_len = hold; - } - if ( state.flags & 0x0200 ) { - //=== CRC2(state.check, hold); - hbuf[ 0 ] = hold & 0xff; - hbuf[ 1 ] = ( hold >>> 8 ) & 0xff; - state.check = crc32( - state.check, - hbuf, - 2, - 0 - ); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } else if ( state.head ) { - state.head.extra = null /*Z_NULL*/; - } - state.mode = EXTRA; - /* falls through */ - case EXTRA: - if ( state.flags & 0x0400 ) { - copy = state.length; - if ( copy > have ) { - copy = have; - } - if ( copy ) { - if ( state.head ) { - len = - state.head.extra_len - - state.length; - if ( ! state.head.extra ) { - // Use untyped array for more convenient processing later - state.head.extra = - new Array( - state.head.extra_len - ); - } - utils.arraySet( - state.head.extra, - input, - next, - // extra field is limited to 65536 bytes - // - no need for additional size check - copy, - /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ - len - ); - //zmemcpy(state.head.extra + len, next, - // len + copy > state.head.extra_max ? - // state.head.extra_max - len : copy); - } - if ( state.flags & 0x0200 ) { - state.check = crc32( - state.check, - input, - copy, - next - ); - } - have -= copy; - next += copy; - state.length -= copy; - } - if ( state.length ) { - break inf_leave; - } - } - state.length = 0; - state.mode = NAME; - /* falls through */ - case NAME: - if ( state.flags & 0x0800 ) { - if ( have === 0 ) { - break inf_leave; - } - copy = 0; - do { - // TODO: 2 or 1 bytes? - len = input[ next + copy++ ]; - /* use constant limit because in js we should not preallocate memory */ - if ( - state.head && - len && - state.length < - 65536 /*state.head.name_max*/ - ) { - state.head.name += - String.fromCharCode( len ); - } - } while ( len && copy < have ); - - if ( state.flags & 0x0200 ) { - state.check = crc32( - state.check, - input, - copy, - next - ); - } - have -= copy; - next += copy; - if ( len ) { - break inf_leave; - } - } else if ( state.head ) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - /* falls through */ - case COMMENT: - if ( state.flags & 0x1000 ) { - if ( have === 0 ) { - break inf_leave; - } - copy = 0; - do { - len = input[ next + copy++ ]; - /* use constant limit because in js we should not preallocate memory */ - if ( - state.head && - len && - state.length < - 65536 /*state.head.comm_max*/ - ) { - state.head.comment += - String.fromCharCode( len ); - } - } while ( len && copy < have ); - if ( state.flags & 0x0200 ) { - state.check = crc32( - state.check, - input, - copy, - next - ); - } - have -= copy; - next += copy; - if ( len ) { - break inf_leave; - } - } else if ( state.head ) { - state.head.comment = null; - } - state.mode = HCRC; - /* falls through */ - case HCRC: - if ( state.flags & 0x0200 ) { - //=== NEEDBITS(16); */ - while ( bits < 16 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( - hold !== - ( state.check & 0xffff ) - ) { - strm.msg = 'header crc mismatch'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - if ( state.head ) { - state.head.hcrc = - ( state.flags >> 9 ) & 1; - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - //=== NEEDBITS(32); */ - while ( bits < 32 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - strm.adler = state.check = zswap32( hold ); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = DICT; - /* falls through */ - case DICT: - if ( state.havedict === 0 ) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - return Z_NEED_DICT; - } - strm.adler = - state.check = 1 /*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE; - /* falls through */ - case TYPE: - if ( - flush === Z_BLOCK || - flush === Z_TREES - ) { - break inf_leave; - } - /* falls through */ - case TYPEDO: - if ( state.last ) { - //--- BYTEBITS() ---// - hold >>>= bits & 7; - bits -= bits & 7; - //---// - state.mode = CHECK; - break; - } - //=== NEEDBITS(3); */ - while ( bits < 3 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.last = hold & 0x01 /*BITS(1)*/; - //--- DROPBITS(1) ---// - hold >>>= 1; - bits -= 1; - //---// - - switch ( hold & 0x03 /*BITS(2)*/ ) { - case 0 /* stored block */: - //Tracev((stderr, "inflate: stored block%s\n", - // state.last ? " (last)" : "")); - state.mode = STORED; - break; - case 1 /* fixed block */: - fixedtables( state ); - //Tracev((stderr, "inflate: fixed codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = - LEN_; /* decode codes */ - if ( flush === Z_TREES ) { - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break inf_leave; - } - break; - case 2 /* dynamic block */: - //Tracev((stderr, "inflate: dynamic codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = TABLE; - break; - case 3: - strm.msg = 'invalid block type'; - state.mode = BAD; - } - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break; - case STORED: - //--- BYTEBITS() ---// /* go to byte boundary */ - hold >>>= bits & 7; - bits -= bits & 7; - //---// - //=== NEEDBITS(32); */ - while ( bits < 32 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( - ( hold & 0xffff ) !== - ( ( hold >>> 16 ) ^ 0xffff ) - ) { - strm.msg = - 'invalid stored block lengths'; - state.mode = BAD; - break; - } - state.length = hold & 0xffff; - //Tracev((stderr, "inflate: stored length %u\n", - // state.length)); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = COPY_; - if ( flush === Z_TREES ) { - break inf_leave; - } - /* falls through */ - case COPY_: - state.mode = COPY; - /* falls through */ - case COPY: - copy = state.length; - if ( copy ) { - if ( copy > have ) { - copy = have; - } - if ( copy > left ) { - copy = left; - } - if ( copy === 0 ) { - break inf_leave; - } - //--- zmemcpy(put, next, copy); --- - utils.arraySet( - output, - input, - next, - copy, - put - ); - //---// - have -= copy; - next += copy; - left -= copy; - put += copy; - state.length -= copy; - break; - } - //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE; - break; - case TABLE: - //=== NEEDBITS(14); */ - while ( bits < 14 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.nlen = - ( hold & 0x1f ) /*BITS(5)*/ + 257; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ndist = - ( hold & 0x1f ) /*BITS(5)*/ + 1; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ncode = - ( hold & 0x0f ) /*BITS(4)*/ + 4; - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// - //#ifndef PKZIP_BUG_WORKAROUND - if ( - state.nlen > 286 || - state.ndist > 30 - ) { - strm.msg = - 'too many length or distance symbols'; - state.mode = BAD; - break; - } - //#endif - //Tracev((stderr, "inflate: table sizes ok\n")); - state.have = 0; - state.mode = LENLENS; - /* falls through */ - case LENLENS: - while ( state.have < state.ncode ) { - //=== NEEDBITS(3); - while ( bits < 3 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.lens[ order[ state.have++ ] ] = - hold & 0x07; //BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - while ( state.have < 19 ) { - state.lens[ order[ state.have++ ] ] = 0; - } - // We have separate tables & no pointers. 2 commented lines below not needed. - //state.next = state.codes; - //state.lencode = state.next; - // Switch to use dynamic table - state.lencode = state.lendyn; - state.lenbits = 7; - - opts = { bits: state.lenbits }; - ret = inflate_table( - CODES, - state.lens, - 0, - 19, - state.lencode, - 0, - state.work, - opts - ); - state.lenbits = opts.bits; - - if ( ret ) { - strm.msg = 'invalid code lengths set'; - state.mode = BAD; - break; - } - //Tracev((stderr, "inflate: code lengths ok\n")); - state.have = 0; - state.mode = CODELENS; - /* falls through */ - case CODELENS: - while ( - state.have < - state.nlen + state.ndist - ) { - for (;;) { - here = - state.lencode[ - hold & - ( ( 1 << - state.lenbits ) - - 1 ) - ]; /*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = ( here >>> 16 ) & 0xff; - here_val = here & 0xffff; - - if ( here_bits <= bits ) { - break; - } - //--- PULLBYTE() ---// - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - //---// - } - if ( here_val < 16 ) { - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.lens[ state.have++ ] = - here_val; - } else { - if ( here_val === 16 ) { - //=== NEEDBITS(here.bits + 2); - n = here_bits + 2; - while ( bits < n ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += - input[ next++ ] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - if ( state.have === 0 ) { - strm.msg = - 'invalid bit length repeat'; - state.mode = BAD; - break; - } - len = - state.lens[ - state.have - 1 - ]; - copy = 3 + ( hold & 0x03 ); //BITS(2); - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - } else if ( here_val === 17 ) { - //=== NEEDBITS(here.bits + 3); - n = here_bits + 3; - while ( bits < n ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += - input[ next++ ] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 3 + ( hold & 0x07 ); //BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } else { - //=== NEEDBITS(here.bits + 7); - n = here_bits + 7; - while ( bits < n ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += - input[ next++ ] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 11 + ( hold & 0x7f ); //BITS(7); - //--- DROPBITS(7) ---// - hold >>>= 7; - bits -= 7; - //---// - } - if ( - state.have + copy > - state.nlen + state.ndist - ) { - strm.msg = - 'invalid bit length repeat'; - state.mode = BAD; - break; - } - while ( copy-- ) { - state.lens[ state.have++ ] = - len; - } - } - } - - /* handle error breaks in while */ - if ( state.mode === BAD ) { - break; - } - - /* check for end-of-block code (better have one) */ - if ( state.lens[ 256 ] === 0 ) { - strm.msg = - 'invalid code -- missing end-of-block'; - state.mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits + function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; + } + + function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more convenient processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + //#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } + //#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ - state.lenbits = 9; - - opts = { bits: state.lenbits }; - ret = inflate_table( - LENS, - state.lens, - 0, - state.nlen, - state.lencode, - 0, - state.work, - opts - ); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.lenbits = opts.bits; - // state.lencode = state.next; - - if ( ret ) { - strm.msg = - 'invalid literal/lengths set'; - state.mode = BAD; - break; - } - - state.distbits = 6; - //state.distcode.copy(state.codes); - // Switch to use dynamic table - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret = inflate_table( - DISTS, - state.lens, - state.nlen, - state.ndist, - state.distcode, - 0, - state.work, - opts - ); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.distbits = opts.bits; - // state.distcode = state.next; - - if ( ret ) { - strm.msg = 'invalid distances set'; - state.mode = BAD; - break; - } - //Tracev((stderr, 'inflate: codes ok\n')); - state.mode = LEN_; - if ( flush === Z_TREES ) { - break inf_leave; - } - /* falls through */ - case LEN_: - state.mode = LEN; - /* falls through */ - case LEN: - if ( have >= 6 && left >= 258 ) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - inflate_fast( strm, _out ); - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - if ( state.mode === TYPE ) { - state.back = -1; - } - break; - } - state.back = 0; - for (;;) { - here = - state.lencode[ - hold & - ( ( 1 << state.lenbits ) - - 1 ) - ]; /*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = ( here >>> 16 ) & 0xff; - here_val = here & 0xffff; - - if ( here_bits <= bits ) { - break; - } - //--- PULLBYTE() ---// - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - //---// - } - if ( here_op && ( here_op & 0xf0 ) === 0 ) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = - state.lencode[ - last_val + - ( ( hold & - ( ( 1 << - ( last_bits + - last_op ) ) - - 1 ) ) /*BITS(last.bits + last.op)*/ >> - last_bits ) - ]; - here_bits = here >>> 24; - here_op = ( here >>> 16 ) & 0xff; - here_val = here & 0xffff; - - if ( - last_bits + here_bits <= - bits - ) { - break; - } - //--- PULLBYTE() ---// - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - state.length = here_val; - if ( here_op === 0 ) { - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - state.mode = LIT; - break; - } - if ( here_op & 32 ) { - //Tracevv((stderr, "inflate: end of block\n")); - state.back = -1; - state.mode = TYPE; - break; - } - if ( here_op & 64 ) { - strm.msg = - 'invalid literal/length code'; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - /* falls through */ - case LENEXT: - if ( state.extra ) { - //=== NEEDBITS(state.extra); - n = state.extra; - while ( bits < n ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.length += - hold & - ( ( 1 << state.extra ) - - 1 ) /*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } - //Tracevv((stderr, "inflate: length %u\n", state.length)); - state.was = state.length; - state.mode = DIST; - /* falls through */ - case DIST: - for (;;) { - here = - state.distcode[ - hold & - ( ( 1 << state.distbits ) - - 1 ) - ]; /*BITS(state.distbits)*/ - here_bits = here >>> 24; - here_op = ( here >>> 16 ) & 0xff; - here_val = here & 0xffff; - - if ( here_bits <= bits ) { - break; - } - //--- PULLBYTE() ---// - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - //---// - } - if ( ( here_op & 0xf0 ) === 0 ) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = - state.distcode[ - last_val + - ( ( hold & - ( ( 1 << - ( last_bits + - last_op ) ) - - 1 ) ) /*BITS(last.bits + last.op)*/ >> - last_bits ) - ]; - here_bits = here >>> 24; - here_op = ( here >>> 16 ) & 0xff; - here_val = here & 0xffff; - - if ( - last_bits + here_bits <= - bits - ) { - break; - } - //--- PULLBYTE() ---// - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - if ( here_op & 64 ) { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = here_op & 15; - state.mode = DISTEXT; - /* falls through */ - case DISTEXT: - if ( state.extra ) { - //=== NEEDBITS(state.extra); - n = state.extra; - while ( bits < n ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - state.offset += - hold & - ( ( 1 << state.extra ) - - 1 ) /*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } - //#ifdef INFLATE_STRICT - if ( state.offset > state.dmax ) { - strm.msg = - 'invalid distance too far back'; - state.mode = BAD; - break; - } - //#endif - //Tracevv((stderr, "inflate: distance %u\n", state.offset)); - state.mode = MATCH; - /* falls through */ - case MATCH: - if ( left === 0 ) { - break inf_leave; - } - copy = _out - left; - if ( state.offset > copy ) { - /* copy from window */ - copy = state.offset - copy; - if ( copy > state.whave ) { - if ( state.sane ) { - strm.msg = - 'invalid distance too far back'; - state.mode = BAD; - break; - } - // (!) This block is disabled in zlib defaults, - // don't enable it for binary compatibility - //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR - // Trace((stderr, "inflate.c too far\n")); - // copy -= state.whave; - // if (copy > state.length) { copy = state.length; } - // if (copy > left) { copy = left; } - // left -= copy; - // state.length -= copy; - // do { - // output[put++] = 0; - // } while (--copy); - // if (state.length === 0) { state.mode = LEN; } - // break; - //#endif - } - if ( copy > state.wnext ) { - copy -= state.wnext; - from = state.wsize - copy; - } else { - from = state.wnext - copy; - } - if ( copy > state.length ) { - copy = state.length; - } - from_source = state.window; - } else { - /* copy from output */ - from_source = output; - from = put - state.offset; - copy = state.length; - } - if ( copy > left ) { - copy = left; - } - left -= copy; - state.length -= copy; - do { - output[ put++ ] = from_source[ from++ ]; - } while ( --copy ); - if ( state.length === 0 ) { - state.mode = LEN; - } - break; - case LIT: - if ( left === 0 ) { - break inf_leave; - } - output[ put++ ] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if ( state.wrap ) { - //=== NEEDBITS(32); - while ( bits < 32 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - // Use '|' instead of '+' to make sure that result is signed - hold |= input[ next++ ] << bits; - bits += 8; - } - //===// - _out -= left; - strm.total_out += _out; - state.total += _out; - if ( _out ) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - state.flags - ? crc32( - state.check, - output, - _out, - put - _out - ) - : adler32( - state.check, - output, - _out, - put - _out - ); - } - _out = left; - // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too - if ( - ( state.flags - ? hold - : zswap32( hold ) ) !== - state.check - ) { - strm.msg = 'incorrect data check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: check matches trailer\n")); - } - state.mode = LENGTH; - /* falls through */ - case LENGTH: - if ( state.wrap && state.flags ) { - //=== NEEDBITS(32); - while ( bits < 32 ) { - if ( have === 0 ) { - break inf_leave; - } - have--; - hold += input[ next++ ] << bits; - bits += 8; - } - //===// - if ( - hold !== - ( state.total & 0xffffffff ) - ) { - strm.msg = 'incorrect length check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: length matches trailer\n")); - } - state.mode = DONE; - /* falls through */ - case DONE: - ret = Z_STREAM_END; - break inf_leave; - case BAD: - ret = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - /* falls through */ - default: - return Z_STREAM_ERROR; - } - } - - // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" - - /* + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } + //#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } + // (!) This block is disabled in zlib defaults, + // don't enable it for binary compatibility + //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + // Trace((stderr, "inflate.c too far\n")); + // copy -= state.whave; + // if (copy > state.length) { copy = state.length; } + // if (copy > left) { copy = left; } + // left -= copy; + // state.length -= copy; + // do { + // output[put++] = 0; + // } while (--copy); + // if (state.length === 0) { state.mode = LEN; } + // break; + //#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' instead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* Return from inflate(), updating the total counts and the check value. If there was no progress during the inflate() call, return a buffer error. Call updatewindow() to create and/or update the window state. Note: a memory error from inflate() is non-recoverable. */ - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - - if ( - state.wsize || - ( _out !== strm.avail_out && - state.mode < BAD && - ( state.mode < CHECK || flush !== Z_FINISH ) ) - ) { - if ( - updatewindow( - strm, - strm.output, - strm.next_out, - _out - strm.avail_out - ) - ) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if ( state.wrap && _out ) { - strm.adler = state.check = - /*UPDATE(state.check, strm.next_out - _out, _out);*/ - state.flags - ? crc32( - state.check, - output, - _out, - strm.next_out - _out - ) - : adler32( - state.check, - output, - _out, - strm.next_out - _out - ); - } - strm.data_type = - state.bits + - ( state.last ? 64 : 0 ) + - ( state.mode === TYPE ? 128 : 0 ) + - ( state.mode === LEN_ || state.mode === COPY_ - ? 256 - : 0 ); - if ( - ( ( _in === 0 && _out === 0 ) || - flush === Z_FINISH ) && - ret === Z_OK - ) { - ret = Z_BUF_ERROR; - } - return ret; - } - - function inflateEnd( strm ) { - if ( - ! strm || - ! strm.state /*|| strm->zfree == (free_func)0*/ - ) { - return Z_STREAM_ERROR; - } - - var state = strm.state; - if ( state.window ) { - state.window = null; - } - strm.state = null; - return Z_OK; - } - - function inflateGetHeader( strm, head ) { - var state; - - /* check state */ - if ( ! strm || ! strm.state ) { - return Z_STREAM_ERROR; - } - state = strm.state; - if ( ( state.wrap & 2 ) === 0 ) { - return Z_STREAM_ERROR; - } - - /* save header structure */ - state.head = head; - head.done = false; - return Z_OK; - } - - function inflateSetDictionary( strm, dictionary ) { - var dictLength = dictionary.length; - - var state; - var dictid; - var ret; - - /* check state */ - if ( - ! strm /* == Z_NULL */ || - ! strm.state /* == Z_NULL */ - ) { - return Z_STREAM_ERROR; - } - state = strm.state; - - if ( state.wrap !== 0 && state.mode !== DICT ) { - return Z_STREAM_ERROR; - } - - /* check for correct dictionary identifier */ - if ( state.mode === DICT ) { - dictid = 1; /* adler32(0, null, 0)*/ - /* dictid = adler32(dictid, dictionary, dictLength); */ - dictid = adler32( - dictid, - dictionary, - dictLength, - 0 - ); - if ( dictid !== state.check ) { - return Z_DATA_ERROR; - } - } - /* copy dictionary to window using updatewindow(), which will amend the + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; + } + + function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; + } + + function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; + } + + function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the existing dictionary if appropriate */ - ret = updatewindow( - strm, - dictionary, - dictLength, - dictLength - ); - if ( ret ) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; - } - - exports.inflateReset = inflateReset; - exports.inflateReset2 = inflateReset2; - exports.inflateResetKeep = inflateResetKeep; - exports.inflateInit = inflateInit; - exports.inflateInit2 = inflateInit2; - exports.inflate = inflate; - exports.inflateEnd = inflateEnd; - exports.inflateGetHeader = inflateGetHeader; - exports.inflateSetDictionary = inflateSetDictionary; - exports.inflateInfo = 'pako inflate (from Nodeca project)'; - - /* Not implemented + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; + } + + exports.inflateReset = inflateReset; + exports.inflateReset2 = inflateReset2; + exports.inflateResetKeep = inflateResetKeep; + exports.inflateInit = inflateInit; + exports.inflateInit2 = inflateInit2; + exports.inflate = inflate; + exports.inflateEnd = inflateEnd; + exports.inflateGetHeader = inflateGetHeader; + exports.inflateSetDictionary = inflateSetDictionary; + exports.inflateInfo = 'pako inflate (from Nodeca project)'; + + /* Not implemented exports.inflateCopy = inflateCopy; exports.inflateGetDictionary = inflateGetDictionary; exports.inflateMark = inflateMark; @@ -3086,114 +2575,93 @@ exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ - }, - { - '../utils/common': 1, - './adler32': 3, - './crc32': 5, - './inffast': 7, - './inftrees': 9, - }, - ], - 9: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - var utils = require( '../utils/common' ); - - var MAXBITS = 15; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - - var CODES = 0; - var LENS = 1; - var DISTS = 2; - - var lbase = [ - /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, - 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, - 83, 99, 115, 131, 163, 195, 227, 258, 0, 0, - ]; - - var lext = [ - /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, - 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, - 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78, - ]; - - var dbase = [ - /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, - 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, - 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, - 24577, 0, 0, - ]; - - var dext = [ - /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, - 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, - 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64, - ]; - - module.exports = function inflate_table( - type, - lens, - lens_index, - codes, - table, - table_index, - work, - opts - ) { - var bits = opts.bits; - //here = opts.here; /* table entry for duplication */ - - var len = 0; /* a code's length in bits */ - var sym = 0; /* index of code symbols */ - var min = 0, - max = 0; /* minimum and maximum code lengths */ - var root = 0; /* number of index bits for root table */ - var curr = 0; /* number of index bits for current table */ - var drop = 0; /* code bits to drop for sub-table */ - var left = 0; /* number of prefix codes available */ - var used = 0; /* code entries in table used */ - var huff = 0; /* Huffman code */ - var incr; /* for incrementing code, index */ - var fill; /* index for replicating entries */ - var low; /* low bits for current root entry */ - var mask; /* mask for low root bits */ - var next; /* next available space in table */ - var base = null; /* base value table to use */ - var base_index = 0; - // var shoextra; /* extra bits table to use */ - var end; /* use base and extra for symbol > end */ - var count = new utils.Buf16( MAXBITS + 1 ); //[MAXBITS+1]; /* number of codes of each length */ - var offs = new utils.Buf16( MAXBITS + 1 ); //[MAXBITS+1]; /* offsets in table for each length */ - var extra = null; - var extra_index = 0; - - var here_bits, here_op, here_val; - - /* + + },{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + var utils = require('../utils/common'); + + var MAXBITS = 15; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + + var CODES = 0; + var LENS = 1; + var DISTS = 2; + + var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 + ]; + + var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 + ]; + + var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 + ]; + + var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 + ]; + + module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) + { + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; + // var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* Process a set of code lengths to create a canonical Huffman code. The code lengths are lens[0..codes-1]. Each length corresponds to the symbols 0..codes-1. The Huffman code is generated by first sorting the @@ -3224,78 +2692,71 @@ decoding tables. */ - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for ( len = 0; len <= MAXBITS; len++ ) { - count[ len ] = 0; - } - for ( sym = 0; sym < codes; sym++ ) { - count[ lens[ lens_index + sym ] ]++; - } - - /* bound code lengths, force root to be within code lengths */ - root = bits; - for ( max = MAXBITS; max >= 1; max-- ) { - if ( count[ max ] !== 0 ) { - break; - } - } - if ( root > max ) { - root = max; - } - if ( max === 0 ) { - /* no symbols to code at all */ - //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ - //table.bits[opts.table_index] = 1; //here.bits = (var char)1; - //table.val[opts.table_index++] = 0; //here.val = (var short)0; - table[ table_index++ ] = - ( 1 << 24 ) | ( 64 << 16 ) | 0; - - //table.op[opts.table_index] = 64; - //table.bits[opts.table_index] = 1; - //table.val[opts.table_index++] = 0; - table[ table_index++ ] = - ( 1 << 24 ) | ( 64 << 16 ) | 0; - - opts.bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for ( min = 1; min < max; min++ ) { - if ( count[ min ] !== 0 ) { - break; - } - } - if ( root < min ) { - root = min; - } - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for ( len = 1; len <= MAXBITS; len++ ) { - left <<= 1; - left -= count[ len ]; - if ( left < 0 ) { - return -1; - } /* over-subscribed */ - } - if ( left > 0 && ( type === CODES || max !== 1 ) ) { - return -1; /* incomplete set */ - } - - /* generate offsets into symbol table for each length for sorting */ - offs[ 1 ] = 0; - for ( len = 1; len < MAXBITS; len++ ) { - offs[ len + 1 ] = offs[ len ] + count[ len ]; - } - - /* sort symbols by length, by symbol order within each length */ - for ( sym = 0; sym < codes; sym++ ) { - if ( lens[ lens_index + sym ] !== 0 ) { - work[ offs[ lens[ lens_index + sym ] ]++ ] = - sym; - } - } - - /* + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop @@ -3326,751 +2787,650 @@ in the rest of the decoding tables with invalid code markers. */ - /* set up for code type */ - // poor man optimization - use if-else instead of switch, - // to avoid deopts in old v8 - if ( type === CODES ) { - base = extra = work; /* dummy value--not used */ - end = 19; - } else if ( type === LENS ) { - base = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; - } else { - /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize opts for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = table_index; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = -1; /* trigger new sub-table when len > root */ - used = 1 << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if ( - ( type === LENS && used > ENOUGH_LENS ) || - ( type === DISTS && used > ENOUGH_DISTS ) - ) { - return 1; - } - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - here_bits = len - drop; - if ( work[ sym ] < end ) { - here_op = 0; - here_val = work[ sym ]; - } else if ( work[ sym ] > end ) { - here_op = extra[ extra_index + work[ sym ] ]; - here_val = base[ base_index + work[ sym ] ]; - } else { - here_op = 32 + 64; /* end of block */ - here_val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1 << ( len - drop ); - fill = 1 << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - table[ next + ( huff >> drop ) + fill ] = - ( here_bits << 24 ) | - ( here_op << 16 ) | - here_val | - 0; - } while ( fill !== 0 ); - - /* backwards increment the len-bit code huff */ - incr = 1 << ( len - 1 ); - while ( huff & incr ) { - incr >>= 1; - } - if ( incr !== 0 ) { - huff &= incr - 1; - huff += incr; - } else { - huff = 0; - } - - /* go to next symbol, update count, len */ - sym++; - if ( --count[ len ] === 0 ) { - if ( len === max ) { - break; - } - len = lens[ lens_index + work[ sym ] ]; - } - - /* create new sub-table if needed */ - if ( len > root && ( huff & mask ) !== low ) { - /* if first time, transition to sub-tables */ - if ( drop === 0 ) { - drop = root; - } - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = 1 << curr; - while ( curr + drop < max ) { - left -= count[ curr + drop ]; - if ( left <= 0 ) { - break; - } - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1 << curr; - if ( - ( type === LENS && used > ENOUGH_LENS ) || - ( type === DISTS && used > ENOUGH_DISTS ) - ) { - return 1; - } - - /* point entry in root table to sub-table */ - low = huff & mask; - /*table.op[low] = curr; + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; table.bits[low] = root; table.val[low] = next - opts.table_index;*/ - table[ low ] = - ( root << 24 ) | - ( curr << 16 ) | - ( next - table_index ) | - 0; - } - } - - /* fill in remaining table entry if code is incomplete (guaranteed to have + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have at most one remaining entry, since if the code is incomplete, the maximum code length that was allowed to get this far is one bit) */ - if ( huff !== 0 ) { - //table.op[next + huff] = 64; /* invalid code marker */ - //table.bits[next + huff] = len - drop; - //table.val[next + huff] = 0; - table[ next + huff ] = - ( ( len - drop ) << 24 ) | ( 64 << 16 ) | 0; - } - - /* set return parameters */ - //opts.table_index += used; - opts.bits = root; - return 0; - }; - }, - { '../utils/common': 1 }, - ], - 10: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - module.exports = { - 2: 'need dictionary' /* Z_NEED_DICT 2 */, - 1: 'stream end' /* Z_STREAM_END 1 */, - 0: '' /* Z_OK 0 */, - '-1': 'file error' /* Z_ERRNO (-1) */, - '-2': 'stream error' /* Z_STREAM_ERROR (-2) */, - '-3': 'data error' /* Z_DATA_ERROR (-3) */, - '-4': 'insufficient memory' /* Z_MEM_ERROR (-4) */, - '-5': 'buffer error' /* Z_BUF_ERROR (-5) */, - '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */, - }; - }, - {}, - ], - 11: [ - function ( require, module, exports ) { - 'use strict'; - - // (C) 1995-2013 Jean-loup Gailly and Mark Adler - // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - // - // This software is provided 'as-is', without any express or implied - // warranty. In no event will the authors be held liable for any damages - // arising from the use of this software. - // - // Permission is granted to anyone to use this software for any purpose, - // including commercial applications, and to alter it and redistribute it - // freely, subject to the following restrictions: - // - // 1. The origin of this software must not be misrepresented; you must not - // claim that you wrote the original software. If you use this software - // in a product, an acknowledgment in the product documentation would be - // appreciated but is not required. - // 2. Altered source versions must be plainly marked as such, and must not be - // misrepresented as being the original software. - // 3. This notice may not be removed or altered from any source distribution. - - function ZStream() { - /* next input byte */ - this.input = null; // JS specific, because we have no pointers - this.next_in = 0; - /* number of bytes available at input */ - this.avail_in = 0; - /* total number of input bytes read so far */ - this.total_in = 0; - /* next output byte should be put there */ - this.output = null; // JS specific, because we have no pointers - this.next_out = 0; - /* remaining free space at output */ - this.avail_out = 0; - /* total number of bytes output so far */ - this.total_out = 0; - /* last error message, NULL if no error */ - this.msg = '' /*Z_NULL*/; - /* not visible by applications */ - this.state = null; - /* best guess about the data type: binary or text */ - this.data_type = 2 /*Z_UNKNOWN*/; - /* adler32 value of the uncompressed data */ - this.adler = 0; - } - - module.exports = ZStream; - }, - {}, - ], - '/lib/inflate.js': [ - function ( require, module, exports ) { - 'use strict'; - - var zlib_inflate = require( './zlib/inflate' ); - var utils = require( './utils/common' ); - var strings = require( './utils/strings' ); - var c = require( './zlib/constants' ); - var msg = require( './zlib/messages' ); - var ZStream = require( './zlib/zstream' ); - var GZheader = require( './zlib/gzheader' ); - - var toString = Object.prototype.toString; - - /** - * class Inflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[inflate]] - * and [[inflateRaw]]. - **/ - - /* internal - * inflate.chunks -> Array - * - * Chunks of output data, if [[Inflate#onData]] not overridden. - **/ - - /** - * Inflate.result -> Uint8Array|Array|String - * - * Uncompressed result, generated by default [[Inflate#onData]] - * and [[Inflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Inflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - - /** - * Inflate.err -> Number - * - * Error code after inflate finished. 0 (Z_OK) on success. - * Should be checked if broken data possible. - **/ - - /** - * Inflate.msg -> String - * - * Error message, if [[Inflate.err]] != 0 - **/ - - /** - * new Inflate(options) - * - options (Object): zlib inflate options. - * - * Creates new inflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `windowBits` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw inflate - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * By default, when no options set, autodetect deflate/gzip data format via - * wrapper header. - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var inflate = new pako.Inflate({ level: 3}); - * - * inflate.push(chunk1, false); - * inflate.push(chunk2, true); // true -> last chunk - * - * if (inflate.err) { throw new Error(inflate.err); } - * - * console.log(inflate.result); - * ``` - **/ - function Inflate( options ) { - if ( ! ( this instanceof Inflate ) ) - return new Inflate( options ); - - this.options = utils.assign( - { - chunkSize: 16384, - windowBits: 0, - to: '', - }, - options || {} - ); - - var opt = this.options; - - // Force window size for `raw` data, if not set directly, - // because we have no header for autodetect. - if ( - opt.raw && - opt.windowBits >= 0 && - opt.windowBits < 16 - ) { - opt.windowBits = -opt.windowBits; - if ( opt.windowBits === 0 ) { - opt.windowBits = -15; - } - } - - // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate - if ( - opt.windowBits >= 0 && - opt.windowBits < 16 && - ! ( options && options.windowBits ) - ) { - opt.windowBits += 32; - } - - // Gzip header has no info about windows size, we can do autodetect only - // for deflate. So, if window size not set, force it to max when gzip possible - if ( opt.windowBits > 15 && opt.windowBits < 48 ) { - // bit 3 (16) -> gzipped data - // bit 4 (32) -> autodetect gzip/deflate - if ( ( opt.windowBits & 15 ) === 0 ) { - opt.windowBits |= 15; - } - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_inflate.inflateInit2( - this.strm, - opt.windowBits - ); - - if ( status !== c.Z_OK ) { - throw new Error( msg[ status ] ); - } - - this.header = new GZheader(); - - zlib_inflate.inflateGetHeader( this.strm, this.header ); - - // Setup dictionary - if ( opt.dictionary ) { - // Convert data if needed - if ( typeof opt.dictionary === 'string' ) { - opt.dictionary = strings.string2buf( - opt.dictionary - ); - } else if ( - toString.call( opt.dictionary ) === - '[object ArrayBuffer]' - ) { - opt.dictionary = new Uint8Array( - opt.dictionary - ); - } - if ( opt.raw ) { - //In raw mode we need to set the dictionary early - status = zlib_inflate.inflateSetDictionary( - this.strm, - opt.dictionary - ); - if ( status !== c.Z_OK ) { - throw new Error( msg[ status ] ); - } - } - } - } - - /** - * Inflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with - * new output chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the decompression context. - * - * On fail call [[Inflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ - Inflate.prototype.push = function ( data, mode ) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status, _mode; - var next_out_utf8, tail, utf8str; - - // Flag to properly process Z_BUF_ERROR on testing inflate call - // when we check that all output data was flushed. - var allowBufError = false; - - if ( this.ended ) { - return false; - } - _mode = - mode === ~~mode - ? mode - : mode === true - ? c.Z_FINISH - : c.Z_NO_FLUSH; - - // Convert data if needed - if ( typeof data === 'string' ) { - // Only binary strings can be decompressed on practice - strm.input = strings.binstring2buf( data ); - } else if ( - toString.call( data ) === '[object ArrayBuffer]' - ) { - strm.input = new Uint8Array( data ); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if ( strm.avail_out === 0 ) { - strm.output = new utils.Buf8( chunkSize ); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - - status = zlib_inflate.inflate( - strm, - c.Z_NO_FLUSH - ); /* no bad return value */ - - if ( status === c.Z_NEED_DICT && dictionary ) { - status = zlib_inflate.inflateSetDictionary( - this.strm, - dictionary - ); - } - - if ( - status === c.Z_BUF_ERROR && - allowBufError === true - ) { - status = c.Z_OK; - allowBufError = false; - } - - if ( - status !== c.Z_STREAM_END && - status !== c.Z_OK - ) { - this.onEnd( status ); - this.ended = true; - return false; - } - - if ( strm.next_out ) { - if ( - strm.avail_out === 0 || - status === c.Z_STREAM_END || - ( strm.avail_in === 0 && - ( _mode === c.Z_FINISH || - _mode === c.Z_SYNC_FLUSH ) ) - ) { - if ( this.options.to === 'string' ) { - next_out_utf8 = strings.utf8border( - strm.output, - strm.next_out - ); - - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string( - strm.output, - next_out_utf8 - ); - - // move tail - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if ( tail ) { - utils.arraySet( - strm.output, - strm.output, - next_out_utf8, - tail, - 0 - ); - } - - this.onData( utf8str ); - } else { - this.onData( - utils.shrinkBuf( - strm.output, - strm.next_out - ) - ); - } - } - } - - // When no more input data, we should check that internal inflate buffers - // are flushed. The only way to do it when avail_out = 0 - run one more - // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. - // Here we set flag to process this error properly. - // - // NOTE. Deflate does not return error in this case and does not needs such - // logic. - if ( strm.avail_in === 0 && strm.avail_out === 0 ) { - allowBufError = true; - } - } while ( - ( strm.avail_in > 0 || strm.avail_out === 0 ) && - status !== c.Z_STREAM_END - ); - - if ( status === c.Z_STREAM_END ) { - _mode = c.Z_FINISH; - } - - // Finalize on the last chunk. - if ( _mode === c.Z_FINISH ) { - status = zlib_inflate.inflateEnd( this.strm ); - this.onEnd( status ); - this.ended = true; - return status === c.Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if ( _mode === c.Z_SYNC_FLUSH ) { - this.onEnd( c.Z_OK ); - strm.avail_out = 0; - return true; - } - - return true; - }; - - /** - * Inflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ - Inflate.prototype.onData = function ( chunk ) { - this.chunks.push( chunk ); - }; - - /** - * Inflate#onEnd(status) -> Void - * - status (Number): inflate status. 0 (Z_OK) on success, - * other if not. - * - * Called either after you tell inflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ - Inflate.prototype.onEnd = function ( status ) { - // On success - join - if ( status === c.Z_OK ) { - if ( this.options.to === 'string' ) { - // Glue & convert here, until we teach pako to send - // utf8 aligned strings to onData - this.result = this.chunks.join( '' ); - } else { - this.result = utils.flattenChunks( - this.chunks - ); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; - }; - - /** - * inflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Decompress `data` with inflate/ungzip and `options`. Autodetect - * format via wrapper header by default. That's why we don't provide - * separate `ungzip` method. - * - * Supported options are: - * - * - windowBits - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) - * , output; - * - * try { - * output = pako.inflate(input); - * } catch (err) - * console.log(err); - * } - * ``` - **/ - function inflate( input, options ) { - var inflator = new Inflate( options ); - - inflator.push( input, true ); - - // That will never happens, if you don't cheat with options :) - if ( inflator.err ) { - throw inflator.msg || msg[ inflator.err ]; - } - - return inflator.result; - } - - /** - * inflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * The same as [[inflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ - function inflateRaw( input, options ) { - options = options || {}; - options.raw = true; - return inflate( input, options ); - } - - /** - * ungzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Just shortcut to [[inflate]], because it autodetects format - * by header.content. Done for convenience. - **/ - - exports.Inflate = Inflate; - exports.inflate = inflate; - exports.inflateRaw = inflateRaw; - exports.ungzip = inflate; - }, - { - './utils/common': 1, - './utils/strings': 2, - './zlib/constants': 4, - './zlib/gzheader': 6, - './zlib/inflate': 8, - './zlib/messages': 10, - './zlib/zstream': 11, - }, - ], - }, - {}, - [] - )( '/lib/inflate.js' ); -} ); + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; + }; + + },{"../utils/common":1}],10:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ + }; + + },{}],11:[function(require,module,exports){ + 'use strict'; + + // (C) 1995-2013 Jean-loup Gailly and Mark Adler + // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + // + // This software is provided 'as-is', without any express or implied + // warranty. In no event will the authors be held liable for any damages + // arising from the use of this software. + // + // Permission is granted to anyone to use this software for any purpose, + // including commercial applications, and to alter it and redistribute it + // freely, subject to the following restrictions: + // + // 1. The origin of this software must not be misrepresented; you must not + // claim that you wrote the original software. If you use this software + // in a product, an acknowledgment in the product documentation would be + // appreciated but is not required. + // 2. Altered source versions must be plainly marked as such, and must not be + // misrepresented as being the original software. + // 3. This notice may not be removed or altered from any source distribution. + + function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; + } + + module.exports = ZStream; + + },{}],"/lib/inflate.js":[function(require,module,exports){ + 'use strict'; + + + var zlib_inflate = require('./zlib/inflate'); + var utils = require('./utils/common'); + var strings = require('./utils/strings'); + var c = require('./zlib/constants'); + var msg = require('./zlib/messages'); + var ZStream = require('./zlib/zstream'); + var GZheader = require('./zlib/gzheader'); + + var toString = Object.prototype.toString; + + /** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + + /* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overridden. + **/ + + /** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + + /** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + + /** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + + /** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ + function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); + + // Setup dictionary + if (opt.dictionary) { + // Convert data if needed + if (typeof opt.dictionary === 'string') { + opt.dictionary = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + opt.dictionary = new Uint8Array(opt.dictionary); + } + if (opt.raw) { //In raw mode we need to set the dictionary early + status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + } + } + } + + /** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ + Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + status = zlib_inflate.inflateSetDictionary(this.strm, dictionary); + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; + }; + + + /** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ + Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); + }; + + + /** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ + Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 aligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; + }; + + + /** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ + function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg || msg[inflator.err]; } + + return inflator.result; + } + + + /** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ + function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); + } + + + /** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + + exports.Inflate = Inflate; + exports.inflate = inflate; + exports.inflateRaw = inflateRaw; + exports.ungzip = inflate; + + },{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js") + }); /* eslint-enable */ @@ -4079,56 +3439,40 @@ /***/ 8572: /***/ ((module) => { +/** + * Credits: + * + * lib-font + * https://github.com/Pomax/lib-font + * https://github.com/Pomax/lib-font/blob/master/lib/unbrotli.js + * + * The MIT License (MIT) + * + * Copyright (c) 2020 pomax@nihongoresources.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* eslint eslint-comments/no-unlimited-disable: 0 */ /* eslint-disable */ -( function ( f ) { - if ( true ) { - module.exports = f(); - } else { var g; } -} )( function () { - var define, module, exports; - return ( function () { - function r( e, n, t ) { - function o( i, f ) { - if ( ! n[ i ] ) { - if ( ! e[ i ] ) { - var c = undefined; - if ( ! f && c ) return require( i, ! 0 ); - if ( u ) return u( i, ! 0 ); - var a = new Error( "Cannot find module '" + i + "'" ); - throw ( ( a.code = 'MODULE_NOT_FOUND' ), a ); - } - var p = ( n[ i ] = { exports: {} } ); - e[ i ][ 0 ].call( - p.exports, - function ( r ) { - var n = e[ i ][ 1 ][ r ]; - return o( n || r ); - }, - p, - p.exports, - r, - e, - n, - t - ); - } - return n[ i ].exports; - } - for ( - var u = undefined, i = 0; - i < t.length; - i++ - ) - o( t[ i ] ); - return o; - } - return r; - } )()( - { - 1: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. +(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i 0; - }; - - /* Fills up the input ringbuffer by calling the input callback. +var BROTLI_READ_SIZE = 4096; +var BROTLI_IBUF_SIZE = (2 * BROTLI_READ_SIZE + 32); +var BROTLI_IBUF_MASK = (2 * BROTLI_READ_SIZE - 1); + +var kBitMask = new Uint32Array([ + 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, + 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215 +]); + +/* Input byte buffer, consist of a ringbuffer and a "slack" region where */ +/* bytes from the start of the ringbuffer are copied. */ +function BrotliBitReader(input) { + this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE); + this.input_ = input; /* input callback */ + + this.reset(); +} + +BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE; +BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK; + +BrotliBitReader.prototype.reset = function() { + this.buf_ptr_ = 0; /* next input will write here */ + this.val_ = 0; /* pre-fetched bits */ + this.pos_ = 0; /* byte position in stream */ + this.bit_pos_ = 0; /* current bit-reading position in val_ */ + this.bit_end_pos_ = 0; /* bit-reading end position from LSB of val_ */ + this.eos_ = 0; /* input stream is finished */ + + this.readMoreInput(); + for (var i = 0; i < 4; i++) { + this.val_ |= this.buf_[this.pos_] << (8 * i); + ++this.pos_; + } + + return this.bit_end_pos_ > 0; +}; + +/* Fills up the input ringbuffer by calling the input callback. Does nothing if there are at least 32 bytes present after current position. @@ -4196,82 +3539,66 @@ copied to the ringbuffer, therefore it is safe to call this function after every 32 bytes of input is read. */ - BrotliBitReader.prototype.readMoreInput = function () { - if ( this.bit_end_pos_ > 256 ) { - return; - } else if ( this.eos_ ) { - if ( this.bit_pos_ > this.bit_end_pos_ ) - throw new Error( - 'Unexpected end of input ' + - this.bit_pos_ + - ' ' + - this.bit_end_pos_ - ); - } else { - var dst = this.buf_ptr_; - var bytes_read = this.input_.read( - this.buf_, - dst, - BROTLI_READ_SIZE - ); - if ( bytes_read < 0 ) { - throw new Error( 'Unexpected end of input' ); - } - - if ( bytes_read < BROTLI_READ_SIZE ) { - this.eos_ = 1; - /* Store 32 bytes of zero after the stream end. */ - for ( var p = 0; p < 32; p++ ) - this.buf_[ dst + bytes_read + p ] = 0; - } - - if ( dst === 0 ) { - /* Copy the head of the ringbuffer to the slack region. */ - for ( var p = 0; p < 32; p++ ) - this.buf_[ ( BROTLI_READ_SIZE << 1 ) + p ] = - this.buf_[ p ]; - - this.buf_ptr_ = BROTLI_READ_SIZE; - } else { - this.buf_ptr_ = 0; - } - - this.bit_end_pos_ += bytes_read << 3; - } - }; - - /* Guarantees that there are at least 24 bits in the buffer. */ - BrotliBitReader.prototype.fillBitWindow = function () { - while ( this.bit_pos_ >= 8 ) { - this.val_ >>>= 8; - this.val_ |= - this.buf_[ this.pos_ & BROTLI_IBUF_MASK ] << 24; - ++this.pos_; - this.bit_pos_ = ( this.bit_pos_ - 8 ) >>> 0; - this.bit_end_pos_ = ( this.bit_end_pos_ - 8 ) >>> 0; - } - }; - - /* Reads the specified number of bits from Read Buffer. */ - BrotliBitReader.prototype.readBits = function ( n_bits ) { - if ( 32 - this.bit_pos_ < n_bits ) { - this.fillBitWindow(); - } - - var val = - ( this.val_ >>> this.bit_pos_ ) & - kBitMask[ n_bits ]; - this.bit_pos_ += n_bits; - return val; - }; - - module.exports = BrotliBitReader; - }, - {}, - ], - 2: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. +BrotliBitReader.prototype.readMoreInput = function() { + if (this.bit_end_pos_ > 256) { + return; + } else if (this.eos_) { + if (this.bit_pos_ > this.bit_end_pos_) + throw new Error('Unexpected end of input ' + this.bit_pos_ + ' ' + this.bit_end_pos_); + } else { + var dst = this.buf_ptr_; + var bytes_read = this.input_.read(this.buf_, dst, BROTLI_READ_SIZE); + if (bytes_read < 0) { + throw new Error('Unexpected end of input'); + } + + if (bytes_read < BROTLI_READ_SIZE) { + this.eos_ = 1; + /* Store 32 bytes of zero after the stream end. */ + for (var p = 0; p < 32; p++) + this.buf_[dst + bytes_read + p] = 0; + } + + if (dst === 0) { + /* Copy the head of the ringbuffer to the slack region. */ + for (var p = 0; p < 32; p++) + this.buf_[(BROTLI_READ_SIZE << 1) + p] = this.buf_[p]; + + this.buf_ptr_ = BROTLI_READ_SIZE; + } else { + this.buf_ptr_ = 0; + } + + this.bit_end_pos_ += bytes_read << 3; + } +}; + +/* Guarantees that there are at least 24 bits in the buffer. */ +BrotliBitReader.prototype.fillBitWindow = function() { + while (this.bit_pos_ >= 8) { + this.val_ >>>= 8; + this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24; + ++this.pos_; + this.bit_pos_ = this.bit_pos_ - 8 >>> 0; + this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0; + } +}; + +/* Reads the specified number of bits from Read Buffer. */ +BrotliBitReader.prototype.readBits = function(n_bits) { + if (32 - this.bit_pos_ < n_bits) { + this.fillBitWindow(); + } + + var val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]); + this.bit_pos_ += n_bits; + return val; +}; + +module.exports = BrotliBitReader; + +},{}],2:[function(require,module,exports){ +/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4377,154 +3704,153 @@ where offset1 and offset2 are dependent on the context mode. */ - var CONTEXT_LSB6 = 0; - var CONTEXT_MSB6 = 1; - var CONTEXT_UTF8 = 2; - var CONTEXT_SIGNED = 3; - - /* Common context lookup table for all context modes. */ - exports.lookup = new Uint8Array( [ - /* CONTEXT_UTF8, last byte. */ - /* ASCII range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 16, 12, - 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, - 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, - 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, - 12, 28, 12, 12, 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, - 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, - 60, 60, 60, 24, 12, 28, 12, 0, - /* UTF8 continuation byte range. */ - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, /* UTF8 lead byte range. */ - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, - 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, - 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, - 3, 2, 3, 2, 3, 2, 3, - /* CONTEXT_UTF8 second last byte. */ - /* ASCII range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, - /* UTF8 continuation byte range. */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 7, - /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ - 0, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, - /* CONTEXT_LSB6, last byte. */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, - /* CONTEXT_MSB6, last byte. */ - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, - 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, - 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, - 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, - 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, - 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, - 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, - 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, - 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, - 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, - 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, - 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, - 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, - 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, - 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, - 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, - 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, - 62, 62, 62, 62, 63, 63, 63, 63, - /* CONTEXT_{M,L}SB6, second last byte, */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - ] ); - - exports.lookupOffsets = new Uint16Array( [ - /* CONTEXT_LSB6 */ - 1024, 1536, /* CONTEXT_MSB6 */ - 1280, 1536, /* CONTEXT_UTF8 */ - 0, 256, /* CONTEXT_SIGNED */ - 768, 512, - ] ); - }, - {}, - ], - 3: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. +var CONTEXT_LSB6 = 0; +var CONTEXT_MSB6 = 1; +var CONTEXT_UTF8 = 2; +var CONTEXT_SIGNED = 3; + +/* Common context lookup table for all context modes. */ +exports.lookup = new Uint8Array([ + /* CONTEXT_UTF8, last byte. */ + /* ASCII range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, + 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, + 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, + 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, + 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, + /* UTF8 continuation byte range. */ + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + /* UTF8 lead byte range. */ + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + /* CONTEXT_UTF8 second last byte. */ + /* ASCII range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, + 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, + /* UTF8 continuation byte range. */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ + 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, + /* CONTEXT_LSB6, last byte. */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + /* CONTEXT_MSB6, last byte. */ + 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, + 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, + 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, + 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, + 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, + 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, + 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, + 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, + 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, + 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, + 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, + 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, + 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, + /* CONTEXT_{M,L}SB6, second last byte, */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +]); + +exports.lookupOffsets = new Uint16Array([ + /* CONTEXT_LSB6 */ + 1024, 1536, + /* CONTEXT_MSB6 */ + 1280, 1536, + /* CONTEXT_UTF8 */ + 0, 256, + /* CONTEXT_SIGNED */ + 768, 512, +]); + +},{}],3:[function(require,module,exports){ +/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4539,1378 +3865,952 @@ limitations under the License. */ - var BrotliInput = require( './streams' ).BrotliInput; - var BrotliOutput = require( './streams' ).BrotliOutput; - var BrotliBitReader = require( './bit_reader' ); - var BrotliDictionary = require( './dictionary' ); - var HuffmanCode = require( './huffman' ).HuffmanCode; - var BrotliBuildHuffmanTable = - require( './huffman' ).BrotliBuildHuffmanTable; - var Context = require( './context' ); - var Prefix = require( './prefix' ); - var Transform = require( './transform' ); - - var kDefaultCodeLength = 8; - var kCodeLengthRepeatCode = 16; - var kNumLiteralCodes = 256; - var kNumInsertAndCopyCodes = 704; - var kNumBlockLengthCodes = 26; - var kLiteralContextBits = 6; - var kDistanceContextBits = 2; - - var HUFFMAN_TABLE_BITS = 8; - var HUFFMAN_TABLE_MASK = 0xff; - /* Maximum possible Huffman table size for an alphabet size of 704, max code - * length 15 and root table bits 8. */ - var HUFFMAN_MAX_TABLE_SIZE = 1080; - - var CODE_LENGTH_CODES = 18; - var kCodeLengthCodeOrder = new Uint8Array( [ - 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, - 14, 15, - ] ); - - var NUM_DISTANCE_SHORT_CODES = 16; - var kDistanceShortCodeIndexOffset = new Uint8Array( [ - 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, - ] ); - - var kDistanceShortCodeValueOffset = new Int8Array( [ - 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3, - ] ); - - var kMaxHuffmanTableSize = new Uint16Array( [ - 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, - 726, 758, 790, 822, 854, 886, 920, 952, 984, 1016, 1048, - 1080, - ] ); - - function DecodeWindowBits( br ) { - var n; - if ( br.readBits( 1 ) === 0 ) { - return 16; - } - - n = br.readBits( 3 ); - if ( n > 0 ) { - return 17 + n; - } - - n = br.readBits( 3 ); - if ( n > 0 ) { - return 8 + n; - } - - return 17; - } - - /* Decodes a number in the range [0..255], by reading 1 - 11 bits. */ - function DecodeVarLenUint8( br ) { - if ( br.readBits( 1 ) ) { - var nbits = br.readBits( 3 ); - if ( nbits === 0 ) { - return 1; - } else { - return br.readBits( nbits ) + ( 1 << nbits ); - } - } - return 0; - } - - function MetaBlockLength() { - this.meta_block_length = 0; - this.input_end = 0; - this.is_uncompressed = 0; - this.is_metadata = false; - } - - function DecodeMetaBlockLength( br ) { - var out = new MetaBlockLength(); - var size_nibbles; - var size_bytes; - var i; - - out.input_end = br.readBits( 1 ); - if ( out.input_end && br.readBits( 1 ) ) { - return out; - } - - size_nibbles = br.readBits( 2 ) + 4; - if ( size_nibbles === 7 ) { - out.is_metadata = true; - - if ( br.readBits( 1 ) !== 0 ) - throw new Error( 'Invalid reserved bit' ); - - size_bytes = br.readBits( 2 ); - if ( size_bytes === 0 ) return out; - - for ( i = 0; i < size_bytes; i++ ) { - var next_byte = br.readBits( 8 ); - if ( - i + 1 === size_bytes && - size_bytes > 1 && - next_byte === 0 - ) - throw new Error( 'Invalid size byte' ); - - out.meta_block_length |= next_byte << ( i * 8 ); - } - } else { - for ( i = 0; i < size_nibbles; ++i ) { - var next_nibble = br.readBits( 4 ); - if ( - i + 1 === size_nibbles && - size_nibbles > 4 && - next_nibble === 0 - ) - throw new Error( 'Invalid size nibble' ); - - out.meta_block_length |= - next_nibble << ( i * 4 ); - } - } - - ++out.meta_block_length; - - if ( ! out.input_end && ! out.is_metadata ) { - out.is_uncompressed = br.readBits( 1 ); - } - - return out; - } - - /* Decodes the next Huffman code from bit-stream. */ - function ReadSymbol( table, index, br ) { - var start_index = index; - - var nbits; - br.fillBitWindow(); - index += - ( br.val_ >>> br.bit_pos_ ) & HUFFMAN_TABLE_MASK; - nbits = table[ index ].bits - HUFFMAN_TABLE_BITS; - if ( nbits > 0 ) { - br.bit_pos_ += HUFFMAN_TABLE_BITS; - index += table[ index ].value; - index += - ( br.val_ >>> br.bit_pos_ ) & - ( ( 1 << nbits ) - 1 ); - } - br.bit_pos_ += table[ index ].bits; - return table[ index ].value; - } - - function ReadHuffmanCodeLengths( - code_length_code_lengths, - num_symbols, - code_lengths, - br - ) { - var symbol = 0; - var prev_code_len = kDefaultCodeLength; - var repeat = 0; - var repeat_code_len = 0; - var space = 32768; - - var table = []; - for ( var i = 0; i < 32; i++ ) - table.push( new HuffmanCode( 0, 0 ) ); - - BrotliBuildHuffmanTable( - table, - 0, - 5, - code_length_code_lengths, - CODE_LENGTH_CODES - ); - - while ( symbol < num_symbols && space > 0 ) { - var p = 0; - var code_len; - - br.readMoreInput(); - br.fillBitWindow(); - p += ( br.val_ >>> br.bit_pos_ ) & 31; - br.bit_pos_ += table[ p ].bits; - code_len = table[ p ].value & 0xff; - if ( code_len < kCodeLengthRepeatCode ) { - repeat = 0; - code_lengths[ symbol++ ] = code_len; - if ( code_len !== 0 ) { - prev_code_len = code_len; - space -= 32768 >> code_len; - } - } else { - var extra_bits = code_len - 14; - var old_repeat; - var repeat_delta; - var new_len = 0; - if ( code_len === kCodeLengthRepeatCode ) { - new_len = prev_code_len; - } - if ( repeat_code_len !== new_len ) { - repeat = 0; - repeat_code_len = new_len; - } - old_repeat = repeat; - if ( repeat > 0 ) { - repeat -= 2; - repeat <<= extra_bits; - } - repeat += br.readBits( extra_bits ) + 3; - repeat_delta = repeat - old_repeat; - if ( symbol + repeat_delta > num_symbols ) { - throw new Error( - '[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols' - ); - } - - for ( var x = 0; x < repeat_delta; x++ ) - code_lengths[ symbol + x ] = - repeat_code_len; - - symbol += repeat_delta; - - if ( repeat_code_len !== 0 ) { - space -= - repeat_delta << - ( 15 - repeat_code_len ); - } - } - } - if ( space !== 0 ) { - throw new Error( - '[ReadHuffmanCodeLengths] space = ' + space - ); - } - - for ( ; symbol < num_symbols; symbol++ ) - code_lengths[ symbol ] = 0; - } - - function ReadHuffmanCode( - alphabet_size, - tables, - table, - br - ) { - var table_size = 0; - var simple_code_or_skip; - var code_lengths = new Uint8Array( alphabet_size ); - - br.readMoreInput(); - - /* simple_code_or_skip is used as follows: +var BrotliInput = require('./streams').BrotliInput; +var BrotliOutput = require('./streams').BrotliOutput; +var BrotliBitReader = require('./bit_reader'); +var BrotliDictionary = require('./dictionary'); +var HuffmanCode = require('./huffman').HuffmanCode; +var BrotliBuildHuffmanTable = require('./huffman').BrotliBuildHuffmanTable; +var Context = require('./context'); +var Prefix = require('./prefix'); +var Transform = require('./transform'); + +var kDefaultCodeLength = 8; +var kCodeLengthRepeatCode = 16; +var kNumLiteralCodes = 256; +var kNumInsertAndCopyCodes = 704; +var kNumBlockLengthCodes = 26; +var kLiteralContextBits = 6; +var kDistanceContextBits = 2; + +var HUFFMAN_TABLE_BITS = 8; +var HUFFMAN_TABLE_MASK = 0xff; +/* Maximum possible Huffman table size for an alphabet size of 704, max code + * length 15 and root table bits 8. */ +var HUFFMAN_MAX_TABLE_SIZE = 1080; + +var CODE_LENGTH_CODES = 18; +var kCodeLengthCodeOrder = new Uint8Array([ + 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15, +]); + +var NUM_DISTANCE_SHORT_CODES = 16; +var kDistanceShortCodeIndexOffset = new Uint8Array([ + 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 +]); + +var kDistanceShortCodeValueOffset = new Int8Array([ + 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3 +]); + +var kMaxHuffmanTableSize = new Uint16Array([ + 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822, + 854, 886, 920, 952, 984, 1016, 1048, 1080 +]); + +function DecodeWindowBits(br) { + var n; + if (br.readBits(1) === 0) { + return 16; + } + + n = br.readBits(3); + if (n > 0) { + return 17 + n; + } + + n = br.readBits(3); + if (n > 0) { + return 8 + n; + } + + return 17; +} + +/* Decodes a number in the range [0..255], by reading 1 - 11 bits. */ +function DecodeVarLenUint8(br) { + if (br.readBits(1)) { + var nbits = br.readBits(3); + if (nbits === 0) { + return 1; + } else { + return br.readBits(nbits) + (1 << nbits); + } + } + return 0; +} + +function MetaBlockLength() { + this.meta_block_length = 0; + this.input_end = 0; + this.is_uncompressed = 0; + this.is_metadata = false; +} + +function DecodeMetaBlockLength(br) { + var out = new MetaBlockLength; + var size_nibbles; + var size_bytes; + var i; + + out.input_end = br.readBits(1); + if (out.input_end && br.readBits(1)) { + return out; + } + + size_nibbles = br.readBits(2) + 4; + if (size_nibbles === 7) { + out.is_metadata = true; + + if (br.readBits(1) !== 0) + throw new Error('Invalid reserved bit'); + + size_bytes = br.readBits(2); + if (size_bytes === 0) + return out; + + for (i = 0; i < size_bytes; i++) { + var next_byte = br.readBits(8); + if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0) + throw new Error('Invalid size byte'); + + out.meta_block_length |= next_byte << (i * 8); + } + } else { + for (i = 0; i < size_nibbles; ++i) { + var next_nibble = br.readBits(4); + if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0) + throw new Error('Invalid size nibble'); + + out.meta_block_length |= next_nibble << (i * 4); + } + } + + ++out.meta_block_length; + + if (!out.input_end && !out.is_metadata) { + out.is_uncompressed = br.readBits(1); + } + + return out; +} + +/* Decodes the next Huffman code from bit-stream. */ +function ReadSymbol(table, index, br) { + var start_index = index; + + var nbits; + br.fillBitWindow(); + index += (br.val_ >>> br.bit_pos_) & HUFFMAN_TABLE_MASK; + nbits = table[index].bits - HUFFMAN_TABLE_BITS; + if (nbits > 0) { + br.bit_pos_ += HUFFMAN_TABLE_BITS; + index += table[index].value; + index += (br.val_ >>> br.bit_pos_) & ((1 << nbits) - 1); + } + br.bit_pos_ += table[index].bits; + return table[index].value; +} + +function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) { + var symbol = 0; + var prev_code_len = kDefaultCodeLength; + var repeat = 0; + var repeat_code_len = 0; + var space = 32768; + + var table = []; + for (var i = 0; i < 32; i++) + table.push(new HuffmanCode(0, 0)); + + BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES); + + while (symbol < num_symbols && space > 0) { + var p = 0; + var code_len; + + br.readMoreInput(); + br.fillBitWindow(); + p += (br.val_ >>> br.bit_pos_) & 31; + br.bit_pos_ += table[p].bits; + code_len = table[p].value & 0xff; + if (code_len < kCodeLengthRepeatCode) { + repeat = 0; + code_lengths[symbol++] = code_len; + if (code_len !== 0) { + prev_code_len = code_len; + space -= 32768 >> code_len; + } + } else { + var extra_bits = code_len - 14; + var old_repeat; + var repeat_delta; + var new_len = 0; + if (code_len === kCodeLengthRepeatCode) { + new_len = prev_code_len; + } + if (repeat_code_len !== new_len) { + repeat = 0; + repeat_code_len = new_len; + } + old_repeat = repeat; + if (repeat > 0) { + repeat -= 2; + repeat <<= extra_bits; + } + repeat += br.readBits(extra_bits) + 3; + repeat_delta = repeat - old_repeat; + if (symbol + repeat_delta > num_symbols) { + throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols'); + } + + for (var x = 0; x < repeat_delta; x++) + code_lengths[symbol + x] = repeat_code_len; + + symbol += repeat_delta; + + if (repeat_code_len !== 0) { + space -= repeat_delta << (15 - repeat_code_len); + } + } + } + if (space !== 0) { + throw new Error("[ReadHuffmanCodeLengths] space = " + space); + } + + for (; symbol < num_symbols; symbol++) + code_lengths[symbol] = 0; +} + +function ReadHuffmanCode(alphabet_size, tables, table, br) { + var table_size = 0; + var simple_code_or_skip; + var code_lengths = new Uint8Array(alphabet_size); + + br.readMoreInput(); + + /* simple_code_or_skip is used as follows: 1 for simple code; 0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */ - simple_code_or_skip = br.readBits( 2 ); - if ( simple_code_or_skip === 1 ) { - /* Read symbols, codes & code lengths directly. */ - var i; - var max_bits_counter = alphabet_size - 1; - var max_bits = 0; - var symbols = new Int32Array( 4 ); - var num_symbols = br.readBits( 2 ) + 1; - while ( max_bits_counter ) { - max_bits_counter >>= 1; - ++max_bits; - } - - for ( i = 0; i < num_symbols; ++i ) { - symbols[ i ] = - br.readBits( max_bits ) % alphabet_size; - code_lengths[ symbols[ i ] ] = 2; - } - code_lengths[ symbols[ 0 ] ] = 1; - switch ( num_symbols ) { - case 1: - break; - case 3: - if ( - symbols[ 0 ] === symbols[ 1 ] || - symbols[ 0 ] === symbols[ 2 ] || - symbols[ 1 ] === symbols[ 2 ] - ) { - throw new Error( - '[ReadHuffmanCode] invalid symbols' - ); - } - break; - case 2: - if ( symbols[ 0 ] === symbols[ 1 ] ) { - throw new Error( - '[ReadHuffmanCode] invalid symbols' - ); - } - - code_lengths[ symbols[ 1 ] ] = 1; - break; - case 4: - if ( - symbols[ 0 ] === symbols[ 1 ] || - symbols[ 0 ] === symbols[ 2 ] || - symbols[ 0 ] === symbols[ 3 ] || - symbols[ 1 ] === symbols[ 2 ] || - symbols[ 1 ] === symbols[ 3 ] || - symbols[ 2 ] === symbols[ 3 ] - ) { - throw new Error( - '[ReadHuffmanCode] invalid symbols' - ); - } - - if ( br.readBits( 1 ) ) { - code_lengths[ symbols[ 2 ] ] = 3; - code_lengths[ symbols[ 3 ] ] = 3; - } else { - code_lengths[ symbols[ 0 ] ] = 2; - } - break; - } - } else { - /* Decode Huffman-coded code lengths. */ - var i; - var code_length_code_lengths = new Uint8Array( - CODE_LENGTH_CODES - ); - var space = 32; - var num_codes = 0; - /* Static Huffman code for the code length code lengths */ - var huff = [ - new HuffmanCode( 2, 0 ), - new HuffmanCode( 2, 4 ), - new HuffmanCode( 2, 3 ), - new HuffmanCode( 3, 2 ), - new HuffmanCode( 2, 0 ), - new HuffmanCode( 2, 4 ), - new HuffmanCode( 2, 3 ), - new HuffmanCode( 4, 1 ), - new HuffmanCode( 2, 0 ), - new HuffmanCode( 2, 4 ), - new HuffmanCode( 2, 3 ), - new HuffmanCode( 3, 2 ), - new HuffmanCode( 2, 0 ), - new HuffmanCode( 2, 4 ), - new HuffmanCode( 2, 3 ), - new HuffmanCode( 4, 5 ), - ]; - for ( - i = simple_code_or_skip; - i < CODE_LENGTH_CODES && space > 0; - ++i - ) { - var code_len_idx = kCodeLengthCodeOrder[ i ]; - var p = 0; - var v; - br.fillBitWindow(); - p += ( br.val_ >>> br.bit_pos_ ) & 15; - br.bit_pos_ += huff[ p ].bits; - v = huff[ p ].value; - code_length_code_lengths[ code_len_idx ] = v; - if ( v !== 0 ) { - space -= 32 >> v; - ++num_codes; - } - } - - if ( ! ( num_codes === 1 || space === 0 ) ) - throw new Error( - '[ReadHuffmanCode] invalid num_codes or space' - ); - - ReadHuffmanCodeLengths( - code_length_code_lengths, - alphabet_size, - code_lengths, - br - ); - } - - table_size = BrotliBuildHuffmanTable( - tables, - table, - HUFFMAN_TABLE_BITS, - code_lengths, - alphabet_size - ); - - if ( table_size === 0 ) { - throw new Error( - '[ReadHuffmanCode] BuildHuffmanTable failed: ' - ); - } - - return table_size; - } - - function ReadBlockLength( table, index, br ) { - var code; - var nbits; - code = ReadSymbol( table, index, br ); - nbits = Prefix.kBlockLengthPrefixCode[ code ].nbits; - return ( - Prefix.kBlockLengthPrefixCode[ code ].offset + - br.readBits( nbits ) - ); - } - - function TranslateShortCodes( code, ringbuffer, index ) { - var val; - if ( code < NUM_DISTANCE_SHORT_CODES ) { - index += kDistanceShortCodeIndexOffset[ code ]; - index &= 3; - val = - ringbuffer[ index ] + - kDistanceShortCodeValueOffset[ code ]; - } else { - val = code - NUM_DISTANCE_SHORT_CODES + 1; - } - return val; - } - - function MoveToFront( v, index ) { - var value = v[ index ]; - var i = index; - for ( ; i; --i ) v[ i ] = v[ i - 1 ]; - v[ 0 ] = value; - } - - function InverseMoveToFrontTransform( v, v_len ) { - var mtf = new Uint8Array( 256 ); - var i; - for ( i = 0; i < 256; ++i ) { - mtf[ i ] = i; - } - for ( i = 0; i < v_len; ++i ) { - var index = v[ i ]; - v[ i ] = mtf[ index ]; - if ( index ) MoveToFront( mtf, index ); - } - } - - /* Contains a collection of huffman trees with the same alphabet size. */ - function HuffmanTreeGroup( alphabet_size, num_htrees ) { - this.alphabet_size = alphabet_size; - this.num_htrees = num_htrees; - this.codes = new Array( - num_htrees + - num_htrees * - kMaxHuffmanTableSize[ - ( alphabet_size + 31 ) >>> 5 - ] - ); - this.htrees = new Uint32Array( num_htrees ); - } - - HuffmanTreeGroup.prototype.decode = function ( br ) { - var i; - var table_size; - var next = 0; - for ( i = 0; i < this.num_htrees; ++i ) { - this.htrees[ i ] = next; - table_size = ReadHuffmanCode( - this.alphabet_size, - this.codes, - next, - br - ); - next += table_size; - } - }; - - function DecodeContextMap( context_map_size, br ) { - var out = { num_htrees: null, context_map: null }; - var use_rle_for_zeros; - var max_run_length_prefix = 0; - var table; - var i; - - br.readMoreInput(); - var num_htrees = ( out.num_htrees = - DecodeVarLenUint8( br ) + 1 ); - - var context_map = ( out.context_map = new Uint8Array( - context_map_size - ) ); - if ( num_htrees <= 1 ) { - return out; - } - - use_rle_for_zeros = br.readBits( 1 ); - if ( use_rle_for_zeros ) { - max_run_length_prefix = br.readBits( 4 ) + 1; - } - - table = []; - for ( i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++ ) { - table[ i ] = new HuffmanCode( 0, 0 ); - } - - ReadHuffmanCode( - num_htrees + max_run_length_prefix, - table, - 0, - br - ); - - for ( i = 0; i < context_map_size; ) { - var code; - - br.readMoreInput(); - code = ReadSymbol( table, 0, br ); - if ( code === 0 ) { - context_map[ i ] = 0; - ++i; - } else if ( code <= max_run_length_prefix ) { - var reps = - 1 + ( 1 << code ) + br.readBits( code ); - while ( --reps ) { - if ( i >= context_map_size ) { - throw new Error( - '[DecodeContextMap] i >= context_map_size' - ); - } - context_map[ i ] = 0; - ++i; - } - } else { - context_map[ i ] = code - max_run_length_prefix; - ++i; - } - } - if ( br.readBits( 1 ) ) { - InverseMoveToFrontTransform( - context_map, - context_map_size - ); - } - - return out; - } - - function DecodeBlockType( - max_block_type, - trees, - tree_type, - block_types, - ringbuffers, - indexes, - br - ) { - var ringbuffer = tree_type * 2; - var index = tree_type; - var type_code = ReadSymbol( - trees, - tree_type * HUFFMAN_MAX_TABLE_SIZE, - br - ); - var block_type; - if ( type_code === 0 ) { - block_type = - ringbuffers[ - ringbuffer + ( indexes[ index ] & 1 ) - ]; - } else if ( type_code === 1 ) { - block_type = - ringbuffers[ - ringbuffer + - ( ( indexes[ index ] - 1 ) & 1 ) - ] + 1; - } else { - block_type = type_code - 2; - } - if ( block_type >= max_block_type ) { - block_type -= max_block_type; - } - block_types[ tree_type ] = block_type; - ringbuffers[ ringbuffer + ( indexes[ index ] & 1 ) ] = - block_type; - ++indexes[ index ]; - } - - function CopyUncompressedBlockToOutput( - output, - len, - pos, - ringbuffer, - ringbuffer_mask, - br - ) { - var rb_size = ringbuffer_mask + 1; - var rb_pos = pos & ringbuffer_mask; - var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK; - var nbytes; - - /* For short lengths copy byte-by-byte */ - if ( - len < 8 || - br.bit_pos_ + ( len << 3 ) < br.bit_end_pos_ - ) { - while ( len-- > 0 ) { - br.readMoreInput(); - ringbuffer[ rb_pos++ ] = br.readBits( 8 ); - if ( rb_pos === rb_size ) { - output.write( ringbuffer, rb_size ); - rb_pos = 0; - } - } - return; - } - - if ( br.bit_end_pos_ < 32 ) { - throw new Error( - '[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32' - ); - } - - /* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */ - while ( br.bit_pos_ < 32 ) { - ringbuffer[ rb_pos ] = br.val_ >>> br.bit_pos_; - br.bit_pos_ += 8; - ++rb_pos; - --len; - } - - /* Copy remaining bytes from br.buf_ to ringbuffer. */ - nbytes = ( br.bit_end_pos_ - br.bit_pos_ ) >> 3; - if ( br_pos + nbytes > BrotliBitReader.IBUF_MASK ) { - var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos; - for ( var x = 0; x < tail; x++ ) - ringbuffer[ rb_pos + x ] = - br.buf_[ br_pos + x ]; - - nbytes -= tail; - rb_pos += tail; - len -= tail; - br_pos = 0; - } - - for ( var x = 0; x < nbytes; x++ ) - ringbuffer[ rb_pos + x ] = br.buf_[ br_pos + x ]; - - rb_pos += nbytes; - len -= nbytes; - - /* If we wrote past the logical end of the ringbuffer, copy the tail of the + simple_code_or_skip = br.readBits(2); + if (simple_code_or_skip === 1) { + /* Read symbols, codes & code lengths directly. */ + var i; + var max_bits_counter = alphabet_size - 1; + var max_bits = 0; + var symbols = new Int32Array(4); + var num_symbols = br.readBits(2) + 1; + while (max_bits_counter) { + max_bits_counter >>= 1; + ++max_bits; + } + + for (i = 0; i < num_symbols; ++i) { + symbols[i] = br.readBits(max_bits) % alphabet_size; + code_lengths[symbols[i]] = 2; + } + code_lengths[symbols[0]] = 1; + switch (num_symbols) { + case 1: + break; + case 3: + if ((symbols[0] === symbols[1]) || + (symbols[0] === symbols[2]) || + (symbols[1] === symbols[2])) { + throw new Error('[ReadHuffmanCode] invalid symbols'); + } + break; + case 2: + if (symbols[0] === symbols[1]) { + throw new Error('[ReadHuffmanCode] invalid symbols'); + } + + code_lengths[symbols[1]] = 1; + break; + case 4: + if ((symbols[0] === symbols[1]) || + (symbols[0] === symbols[2]) || + (symbols[0] === symbols[3]) || + (symbols[1] === symbols[2]) || + (symbols[1] === symbols[3]) || + (symbols[2] === symbols[3])) { + throw new Error('[ReadHuffmanCode] invalid symbols'); + } + + if (br.readBits(1)) { + code_lengths[symbols[2]] = 3; + code_lengths[symbols[3]] = 3; + } else { + code_lengths[symbols[0]] = 2; + } + break; + } + } else { /* Decode Huffman-coded code lengths. */ + var i; + var code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES); + var space = 32; + var num_codes = 0; + /* Static Huffman code for the code length code lengths */ + var huff = [ + new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), + new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1), + new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), + new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5) + ]; + for (i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; ++i) { + var code_len_idx = kCodeLengthCodeOrder[i]; + var p = 0; + var v; + br.fillBitWindow(); + p += (br.val_ >>> br.bit_pos_) & 15; + br.bit_pos_ += huff[p].bits; + v = huff[p].value; + code_length_code_lengths[code_len_idx] = v; + if (v !== 0) { + space -= (32 >> v); + ++num_codes; + } + } + + if (!(num_codes === 1 || space === 0)) + throw new Error('[ReadHuffmanCode] invalid num_codes or space'); + + ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br); + } + + table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size); + + if (table_size === 0) { + throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: "); + } + + return table_size; +} + +function ReadBlockLength(table, index, br) { + var code; + var nbits; + code = ReadSymbol(table, index, br); + nbits = Prefix.kBlockLengthPrefixCode[code].nbits; + return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits); +} + +function TranslateShortCodes(code, ringbuffer, index) { + var val; + if (code < NUM_DISTANCE_SHORT_CODES) { + index += kDistanceShortCodeIndexOffset[code]; + index &= 3; + val = ringbuffer[index] + kDistanceShortCodeValueOffset[code]; + } else { + val = code - NUM_DISTANCE_SHORT_CODES + 1; + } + return val; +} + +function MoveToFront(v, index) { + var value = v[index]; + var i = index; + for (; i; --i) v[i] = v[i - 1]; + v[0] = value; +} + +function InverseMoveToFrontTransform(v, v_len) { + var mtf = new Uint8Array(256); + var i; + for (i = 0; i < 256; ++i) { + mtf[i] = i; + } + for (i = 0; i < v_len; ++i) { + var index = v[i]; + v[i] = mtf[index]; + if (index) MoveToFront(mtf, index); + } +} + +/* Contains a collection of huffman trees with the same alphabet size. */ +function HuffmanTreeGroup(alphabet_size, num_htrees) { + this.alphabet_size = alphabet_size; + this.num_htrees = num_htrees; + this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); + this.htrees = new Uint32Array(num_htrees); +} + +HuffmanTreeGroup.prototype.decode = function(br) { + var i; + var table_size; + var next = 0; + for (i = 0; i < this.num_htrees; ++i) { + this.htrees[i] = next; + table_size = ReadHuffmanCode(this.alphabet_size, this.codes, next, br); + next += table_size; + } +}; + +function DecodeContextMap(context_map_size, br) { + var out = { num_htrees: null, context_map: null }; + var use_rle_for_zeros; + var max_run_length_prefix = 0; + var table; + var i; + + br.readMoreInput(); + var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1; + + var context_map = out.context_map = new Uint8Array(context_map_size); + if (num_htrees <= 1) { + return out; + } + + use_rle_for_zeros = br.readBits(1); + if (use_rle_for_zeros) { + max_run_length_prefix = br.readBits(4) + 1; + } + + table = []; + for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) { + table[i] = new HuffmanCode(0, 0); + } + + ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br); + + for (i = 0; i < context_map_size;) { + var code; + + br.readMoreInput(); + code = ReadSymbol(table, 0, br); + if (code === 0) { + context_map[i] = 0; + ++i; + } else if (code <= max_run_length_prefix) { + var reps = 1 + (1 << code) + br.readBits(code); + while (--reps) { + if (i >= context_map_size) { + throw new Error("[DecodeContextMap] i >= context_map_size"); + } + context_map[i] = 0; + ++i; + } + } else { + context_map[i] = code - max_run_length_prefix; + ++i; + } + } + if (br.readBits(1)) { + InverseMoveToFrontTransform(context_map, context_map_size); + } + + return out; +} + +function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) { + var ringbuffer = tree_type * 2; + var index = tree_type; + var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br); + var block_type; + if (type_code === 0) { + block_type = ringbuffers[ringbuffer + (indexes[index] & 1)]; + } else if (type_code === 1) { + block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1; + } else { + block_type = type_code - 2; + } + if (block_type >= max_block_type) { + block_type -= max_block_type; + } + block_types[tree_type] = block_type; + ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type; + ++indexes[index]; +} + +function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) { + var rb_size = ringbuffer_mask + 1; + var rb_pos = pos & ringbuffer_mask; + var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK; + var nbytes; + + /* For short lengths copy byte-by-byte */ + if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) { + while (len-- > 0) { + br.readMoreInput(); + ringbuffer[rb_pos++] = br.readBits(8); + if (rb_pos === rb_size) { + output.write(ringbuffer, rb_size); + rb_pos = 0; + } + } + return; + } + + if (br.bit_end_pos_ < 32) { + throw new Error('[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32'); + } + + /* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */ + while (br.bit_pos_ < 32) { + ringbuffer[rb_pos] = (br.val_ >>> br.bit_pos_); + br.bit_pos_ += 8; + ++rb_pos; + --len; + } + + /* Copy remaining bytes from br.buf_ to ringbuffer. */ + nbytes = (br.bit_end_pos_ - br.bit_pos_) >> 3; + if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) { + var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos; + for (var x = 0; x < tail; x++) + ringbuffer[rb_pos + x] = br.buf_[br_pos + x]; + + nbytes -= tail; + rb_pos += tail; + len -= tail; + br_pos = 0; + } + + for (var x = 0; x < nbytes; x++) + ringbuffer[rb_pos + x] = br.buf_[br_pos + x]; + + rb_pos += nbytes; + len -= nbytes; + + /* If we wrote past the logical end of the ringbuffer, copy the tail of the ringbuffer to its beginning and flush the ringbuffer to the output. */ - if ( rb_pos >= rb_size ) { - output.write( ringbuffer, rb_size ); - rb_pos -= rb_size; - for ( var x = 0; x < rb_pos; x++ ) - ringbuffer[ x ] = ringbuffer[ rb_size + x ]; - } - - /* If we have more to copy than the remaining size of the ringbuffer, then we + if (rb_pos >= rb_size) { + output.write(ringbuffer, rb_size); + rb_pos -= rb_size; + for (var x = 0; x < rb_pos; x++) + ringbuffer[x] = ringbuffer[rb_size + x]; + } + + /* If we have more to copy than the remaining size of the ringbuffer, then we first fill the ringbuffer from the input and then flush the ringbuffer to the output */ - while ( rb_pos + len >= rb_size ) { - nbytes = rb_size - rb_pos; - if ( - br.input_.read( ringbuffer, rb_pos, nbytes ) < - nbytes - ) { - throw new Error( - '[CopyUncompressedBlockToOutput] not enough bytes' - ); - } - output.write( ringbuffer, rb_size ); - len -= nbytes; - rb_pos = 0; - } - - /* Copy straight from the input onto the ringbuffer. The ringbuffer will be + while (rb_pos + len >= rb_size) { + nbytes = rb_size - rb_pos; + if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) { + throw new Error('[CopyUncompressedBlockToOutput] not enough bytes'); + } + output.write(ringbuffer, rb_size); + len -= nbytes; + rb_pos = 0; + } + + /* Copy straight from the input onto the ringbuffer. The ringbuffer will be flushed to the output at a later time. */ - if ( br.input_.read( ringbuffer, rb_pos, len ) < len ) { - throw new Error( - '[CopyUncompressedBlockToOutput] not enough bytes' - ); - } - - /* Restore the state of the bit reader. */ - br.reset(); - } - - /* Advances the bit reader position to the next byte boundary and verifies + if (br.input_.read(ringbuffer, rb_pos, len) < len) { + throw new Error('[CopyUncompressedBlockToOutput] not enough bytes'); + } + + /* Restore the state of the bit reader. */ + br.reset(); +} + +/* Advances the bit reader position to the next byte boundary and verifies that any skipped bits are set to zero. */ - function JumpToByteBoundary( br ) { - var new_bit_pos = ( br.bit_pos_ + 7 ) & ~7; - var pad_bits = br.readBits( new_bit_pos - br.bit_pos_ ); - return pad_bits == 0; - } - - function BrotliDecompressedSize( buffer ) { - var input = new BrotliInput( buffer ); - var br = new BrotliBitReader( input ); - DecodeWindowBits( br ); - var out = DecodeMetaBlockLength( br ); - return out.meta_block_length; - } - - exports.BrotliDecompressedSize = BrotliDecompressedSize; - - function BrotliDecompressBuffer( buffer, output_size ) { - var input = new BrotliInput( buffer ); - - if ( output_size == null ) { - output_size = BrotliDecompressedSize( buffer ); - } - - var output_buffer = new Uint8Array( output_size ); - var output = new BrotliOutput( output_buffer ); - - BrotliDecompress( input, output ); - - if ( output.pos < output.buffer.length ) { - output.buffer = output.buffer.subarray( - 0, - output.pos - ); - } - - return output.buffer; - } - - exports.BrotliDecompressBuffer = BrotliDecompressBuffer; - - function BrotliDecompress( input, output ) { - var i; - var pos = 0; - var input_end = 0; - var window_bits = 0; - var max_backward_distance; - var max_distance = 0; - var ringbuffer_size; - var ringbuffer_mask; - var ringbuffer; - var ringbuffer_end; - /* This ring buffer holds a few past copy distances that will be used by */ - /* some special distance codes. */ - var dist_rb = [ 16, 15, 11, 4 ]; - var dist_rb_idx = 0; - /* The previous 2 bytes used for context. */ - var prev_byte1 = 0; - var prev_byte2 = 0; - var hgroup = [ - new HuffmanTreeGroup( 0, 0 ), - new HuffmanTreeGroup( 0, 0 ), - new HuffmanTreeGroup( 0, 0 ), - ]; - var block_type_trees; - var block_len_trees; - var br; - - /* We need the slack region for the following reasons: +function JumpToByteBoundary(br) { + var new_bit_pos = (br.bit_pos_ + 7) & ~7; + var pad_bits = br.readBits(new_bit_pos - br.bit_pos_); + return pad_bits == 0; +} + +function BrotliDecompressedSize(buffer) { + var input = new BrotliInput(buffer); + var br = new BrotliBitReader(input); + DecodeWindowBits(br); + var out = DecodeMetaBlockLength(br); + return out.meta_block_length; +} + +exports.BrotliDecompressedSize = BrotliDecompressedSize; + +function BrotliDecompressBuffer(buffer, output_size) { + var input = new BrotliInput(buffer); + + if (output_size == null) { + output_size = BrotliDecompressedSize(buffer); + } + + var output_buffer = new Uint8Array(output_size); + var output = new BrotliOutput(output_buffer); + + BrotliDecompress(input, output); + + if (output.pos < output.buffer.length) { + output.buffer = output.buffer.subarray(0, output.pos); + } + + return output.buffer; +} + +exports.BrotliDecompressBuffer = BrotliDecompressBuffer; + +function BrotliDecompress(input, output) { + var i; + var pos = 0; + var input_end = 0; + var window_bits = 0; + var max_backward_distance; + var max_distance = 0; + var ringbuffer_size; + var ringbuffer_mask; + var ringbuffer; + var ringbuffer_end; + /* This ring buffer holds a few past copy distances that will be used by */ + /* some special distance codes. */ + var dist_rb = [ 16, 15, 11, 4 ]; + var dist_rb_idx = 0; + /* The previous 2 bytes used for context. */ + var prev_byte1 = 0; + var prev_byte2 = 0; + var hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)]; + var block_type_trees; + var block_len_trees; + var br; + + /* We need the slack region for the following reasons: - always doing two 8-byte copies for fast backward copying - transforms - flushing the input ringbuffer when decoding uncompressed blocks */ - var kRingBufferWriteAheadSlack = - 128 + BrotliBitReader.READ_SIZE; - - br = new BrotliBitReader( input ); - - /* Decode window size. */ - window_bits = DecodeWindowBits( br ); - max_backward_distance = ( 1 << window_bits ) - 16; - - ringbuffer_size = 1 << window_bits; - ringbuffer_mask = ringbuffer_size - 1; - ringbuffer = new Uint8Array( - ringbuffer_size + - kRingBufferWriteAheadSlack + - BrotliDictionary.maxDictionaryWordLength - ); - ringbuffer_end = ringbuffer_size; - - block_type_trees = []; - block_len_trees = []; - for ( var x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++ ) { - block_type_trees[ x ] = new HuffmanCode( 0, 0 ); - block_len_trees[ x ] = new HuffmanCode( 0, 0 ); - } - - while ( ! input_end ) { - var meta_block_remaining_len = 0; - var is_uncompressed; - var block_length = [ 1 << 28, 1 << 28, 1 << 28 ]; - var block_type = [ 0 ]; - var num_block_types = [ 1, 1, 1 ]; - var block_type_rb = [ 0, 1, 0, 1, 0, 1 ]; - var block_type_rb_index = [ 0 ]; - var distance_postfix_bits; - var num_direct_distance_codes; - var distance_postfix_mask; - var num_distance_codes; - var context_map = null; - var context_modes = null; - var num_literal_htrees; - var dist_context_map = null; - var num_dist_htrees; - var context_offset = 0; - var context_map_slice = null; - var literal_htree_index = 0; - var dist_context_offset = 0; - var dist_context_map_slice = null; - var dist_htree_index = 0; - var context_lookup_offset1 = 0; - var context_lookup_offset2 = 0; - var context_mode; - var htree_command; - - for ( i = 0; i < 3; ++i ) { - hgroup[ i ].codes = null; - hgroup[ i ].htrees = null; - } - - br.readMoreInput(); - - var _out = DecodeMetaBlockLength( br ); - meta_block_remaining_len = _out.meta_block_length; - if ( - pos + meta_block_remaining_len > - output.buffer.length - ) { - /* We need to grow the output buffer to fit the additional data. */ - var tmp = new Uint8Array( - pos + meta_block_remaining_len - ); - tmp.set( output.buffer ); - output.buffer = tmp; - } - input_end = _out.input_end; - is_uncompressed = _out.is_uncompressed; - - if ( _out.is_metadata ) { - JumpToByteBoundary( br ); - - for ( - ; - meta_block_remaining_len > 0; - --meta_block_remaining_len - ) { - br.readMoreInput(); - /* Read one byte and ignore it. */ - br.readBits( 8 ); - } - - continue; - } - - if ( meta_block_remaining_len === 0 ) { - continue; - } - - if ( is_uncompressed ) { - br.bit_pos_ = ( br.bit_pos_ + 7 ) & ~7; - CopyUncompressedBlockToOutput( - output, - meta_block_remaining_len, - pos, - ringbuffer, - ringbuffer_mask, - br - ); - pos += meta_block_remaining_len; - continue; - } - - for ( i = 0; i < 3; ++i ) { - num_block_types[ i ] = - DecodeVarLenUint8( br ) + 1; - if ( num_block_types[ i ] >= 2 ) { - ReadHuffmanCode( - num_block_types[ i ] + 2, - block_type_trees, - i * HUFFMAN_MAX_TABLE_SIZE, - br - ); - ReadHuffmanCode( - kNumBlockLengthCodes, - block_len_trees, - i * HUFFMAN_MAX_TABLE_SIZE, - br - ); - block_length[ i ] = ReadBlockLength( - block_len_trees, - i * HUFFMAN_MAX_TABLE_SIZE, - br - ); - block_type_rb_index[ i ] = 1; - } - } - - br.readMoreInput(); - - distance_postfix_bits = br.readBits( 2 ); - num_direct_distance_codes = - NUM_DISTANCE_SHORT_CODES + - ( br.readBits( 4 ) << distance_postfix_bits ); - distance_postfix_mask = - ( 1 << distance_postfix_bits ) - 1; - num_distance_codes = - num_direct_distance_codes + - ( 48 << distance_postfix_bits ); - context_modes = new Uint8Array( - num_block_types[ 0 ] - ); - - for ( i = 0; i < num_block_types[ 0 ]; ++i ) { - br.readMoreInput(); - context_modes[ i ] = br.readBits( 2 ) << 1; - } - - var _o1 = DecodeContextMap( - num_block_types[ 0 ] << kLiteralContextBits, - br - ); - num_literal_htrees = _o1.num_htrees; - context_map = _o1.context_map; - - var _o2 = DecodeContextMap( - num_block_types[ 2 ] << kDistanceContextBits, - br - ); - num_dist_htrees = _o2.num_htrees; - dist_context_map = _o2.context_map; - - hgroup[ 0 ] = new HuffmanTreeGroup( - kNumLiteralCodes, - num_literal_htrees - ); - hgroup[ 1 ] = new HuffmanTreeGroup( - kNumInsertAndCopyCodes, - num_block_types[ 1 ] - ); - hgroup[ 2 ] = new HuffmanTreeGroup( - num_distance_codes, - num_dist_htrees - ); - - for ( i = 0; i < 3; ++i ) { - hgroup[ i ].decode( br ); - } - - context_map_slice = 0; - dist_context_map_slice = 0; - context_mode = context_modes[ block_type[ 0 ] ]; - context_lookup_offset1 = - Context.lookupOffsets[ context_mode ]; - context_lookup_offset2 = - Context.lookupOffsets[ context_mode + 1 ]; - htree_command = hgroup[ 1 ].htrees[ 0 ]; - - while ( meta_block_remaining_len > 0 ) { - var cmd_code; - var range_idx; - var insert_code; - var copy_code; - var insert_length; - var copy_length; - var distance_code; - var distance; - var context; - var j; - var copy_dst; - - br.readMoreInput(); - - if ( block_length[ 1 ] === 0 ) { - DecodeBlockType( - num_block_types[ 1 ], - block_type_trees, - 1, - block_type, - block_type_rb, - block_type_rb_index, - br - ); - block_length[ 1 ] = ReadBlockLength( - block_len_trees, - HUFFMAN_MAX_TABLE_SIZE, - br - ); - htree_command = - hgroup[ 1 ].htrees[ block_type[ 1 ] ]; - } - --block_length[ 1 ]; - cmd_code = ReadSymbol( - hgroup[ 1 ].codes, - htree_command, - br - ); - range_idx = cmd_code >> 6; - if ( range_idx >= 2 ) { - range_idx -= 2; - distance_code = -1; - } else { - distance_code = 0; - } - insert_code = - Prefix.kInsertRangeLut[ range_idx ] + - ( ( cmd_code >> 3 ) & 7 ); - copy_code = - Prefix.kCopyRangeLut[ range_idx ] + - ( cmd_code & 7 ); - insert_length = - Prefix.kInsertLengthPrefixCode[ - insert_code - ].offset + - br.readBits( - Prefix.kInsertLengthPrefixCode[ - insert_code - ].nbits - ); - copy_length = - Prefix.kCopyLengthPrefixCode[ copy_code ] - .offset + - br.readBits( - Prefix.kCopyLengthPrefixCode[ - copy_code - ].nbits - ); - prev_byte1 = - ringbuffer[ ( pos - 1 ) & ringbuffer_mask ]; - prev_byte2 = - ringbuffer[ ( pos - 2 ) & ringbuffer_mask ]; - for ( j = 0; j < insert_length; ++j ) { - br.readMoreInput(); - - if ( block_length[ 0 ] === 0 ) { - DecodeBlockType( - num_block_types[ 0 ], - block_type_trees, - 0, - block_type, - block_type_rb, - block_type_rb_index, - br - ); - block_length[ 0 ] = ReadBlockLength( - block_len_trees, - 0, - br - ); - context_offset = - block_type[ 0 ] << - kLiteralContextBits; - context_map_slice = context_offset; - context_mode = - context_modes[ block_type[ 0 ] ]; - context_lookup_offset1 = - Context.lookupOffsets[ - context_mode - ]; - context_lookup_offset2 = - Context.lookupOffsets[ - context_mode + 1 - ]; - } - context = - Context.lookup[ - context_lookup_offset1 + prev_byte1 - ] | - Context.lookup[ - context_lookup_offset2 + prev_byte2 - ]; - literal_htree_index = - context_map[ - context_map_slice + context - ]; - --block_length[ 0 ]; - prev_byte2 = prev_byte1; - prev_byte1 = ReadSymbol( - hgroup[ 0 ].codes, - hgroup[ 0 ].htrees[ - literal_htree_index - ], - br - ); - ringbuffer[ pos & ringbuffer_mask ] = - prev_byte1; - if ( - ( pos & ringbuffer_mask ) === - ringbuffer_mask - ) { - output.write( - ringbuffer, - ringbuffer_size - ); - } - ++pos; - } - meta_block_remaining_len -= insert_length; - if ( meta_block_remaining_len <= 0 ) break; - - if ( distance_code < 0 ) { - var context; - - br.readMoreInput(); - if ( block_length[ 2 ] === 0 ) { - DecodeBlockType( - num_block_types[ 2 ], - block_type_trees, - 2, - block_type, - block_type_rb, - block_type_rb_index, - br - ); - block_length[ 2 ] = ReadBlockLength( - block_len_trees, - 2 * HUFFMAN_MAX_TABLE_SIZE, - br - ); - dist_context_offset = - block_type[ 2 ] << - kDistanceContextBits; - dist_context_map_slice = - dist_context_offset; - } - --block_length[ 2 ]; - context = - ( copy_length > 4 - ? 3 - : copy_length - 2 ) & 0xff; - dist_htree_index = - dist_context_map[ - dist_context_map_slice + context - ]; - distance_code = ReadSymbol( - hgroup[ 2 ].codes, - hgroup[ 2 ].htrees[ dist_htree_index ], - br - ); - if ( - distance_code >= - num_direct_distance_codes - ) { - var nbits; - var postfix; - var offset; - distance_code -= - num_direct_distance_codes; - postfix = - distance_code & - distance_postfix_mask; - distance_code >>= distance_postfix_bits; - nbits = ( distance_code >> 1 ) + 1; - offset = - ( ( 2 + ( distance_code & 1 ) ) << - nbits ) - - 4; - distance_code = - num_direct_distance_codes + - ( ( offset + - br.readBits( nbits ) ) << - distance_postfix_bits ) + - postfix; - } - } - - /* Convert the distance code to the actual distance by possibly looking */ - /* up past distnaces from the ringbuffer. */ - distance = TranslateShortCodes( - distance_code, - dist_rb, - dist_rb_idx - ); - if ( distance < 0 ) { - throw new Error( - '[BrotliDecompress] invalid distance' - ); - } - - if ( - pos < max_backward_distance && - max_distance !== max_backward_distance - ) { - max_distance = pos; - } else { - max_distance = max_backward_distance; - } - - copy_dst = pos & ringbuffer_mask; - - if ( distance > max_distance ) { - if ( - copy_length >= - BrotliDictionary.minDictionaryWordLength && - copy_length <= - BrotliDictionary.maxDictionaryWordLength - ) { - var offset = - BrotliDictionary.offsetsByLength[ - copy_length - ]; - var word_id = - distance - max_distance - 1; - var shift = - BrotliDictionary.sizeBitsByLength[ - copy_length - ]; - var mask = ( 1 << shift ) - 1; - var word_idx = word_id & mask; - var transform_idx = word_id >> shift; - offset += word_idx * copy_length; - if ( - transform_idx < - Transform.kNumTransforms - ) { - var len = - Transform.transformDictionaryWord( - ringbuffer, - copy_dst, - offset, - copy_length, - transform_idx - ); - copy_dst += len; - pos += len; - meta_block_remaining_len -= len; - if ( copy_dst >= ringbuffer_end ) { - output.write( - ringbuffer, - ringbuffer_size - ); - - for ( - var _x = 0; - _x < - copy_dst - ringbuffer_end; - _x++ - ) - ringbuffer[ _x ] = - ringbuffer[ - ringbuffer_end + _x - ]; - } - } else { - throw new Error( - 'Invalid backward reference. pos: ' + - pos + - ' distance: ' + - distance + - ' len: ' + - copy_length + - ' bytes left: ' + - meta_block_remaining_len - ); - } - } else { - throw new Error( - 'Invalid backward reference. pos: ' + - pos + - ' distance: ' + - distance + - ' len: ' + - copy_length + - ' bytes left: ' + - meta_block_remaining_len - ); - } - } else { - if ( distance_code > 0 ) { - dist_rb[ dist_rb_idx & 3 ] = distance; - ++dist_rb_idx; - } - - if ( - copy_length > meta_block_remaining_len - ) { - throw new Error( - 'Invalid backward reference. pos: ' + - pos + - ' distance: ' + - distance + - ' len: ' + - copy_length + - ' bytes left: ' + - meta_block_remaining_len - ); - } - - for ( j = 0; j < copy_length; ++j ) { - ringbuffer[ pos & ringbuffer_mask ] = - ringbuffer[ - ( pos - distance ) & - ringbuffer_mask - ]; - if ( - ( pos & ringbuffer_mask ) === - ringbuffer_mask - ) { - output.write( - ringbuffer, - ringbuffer_size - ); - } - ++pos; - --meta_block_remaining_len; - } - } - - /* When we get here, we must have inserted at least one literal and */ - /* made a copy of at least length two, therefore accessing the last 2 */ - /* bytes is valid. */ - prev_byte1 = - ringbuffer[ ( pos - 1 ) & ringbuffer_mask ]; - prev_byte2 = - ringbuffer[ ( pos - 2 ) & ringbuffer_mask ]; - } - - /* Protect pos from overflow, wrap it around at every GB of input data */ - pos &= 0x3fffffff; - } - - output.write( ringbuffer, pos & ringbuffer_mask ); - } - - exports.BrotliDecompress = BrotliDecompress; - - BrotliDictionary.init(); - }, - { - './bit_reader': 1, - './context': 2, - './dictionary': 6, - './huffman': 7, - './prefix': 9, - './streams': 10, - './transform': 11, - }, - ], - 4: [ - function ( require, module, exports ) { - var base64 = require( 'base64-js' ); - //var fs = require('fs'); - - /** - * The normal dictionary-data.js is quite large, which makes it - * unsuitable for browser usage. In order to make it smaller, - * we read dictionary.bin, which is a compressed version of - * the dictionary, and on initial load, Brotli decompresses - * it's own dictionary. 😜 - */ - exports.init = function () { - var BrotliDecompressBuffer = - require( './decode' ).BrotliDecompressBuffer; - var compressed = base64.toByteArray( - require( './dictionary.bin.js' ) - ); - return BrotliDecompressBuffer( compressed ); - }; - }, - { './decode': 3, './dictionary.bin.js': 5, 'base64-js': 8 }, - ], - 5: [ - function ( require, module, exports ) { - module.exports = - 'W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZ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DXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg='; - }, - {}, - ], - 6: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. + var kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE; + + br = new BrotliBitReader(input); + + /* Decode window size. */ + window_bits = DecodeWindowBits(br); + max_backward_distance = (1 << window_bits) - 16; + + ringbuffer_size = 1 << window_bits; + ringbuffer_mask = ringbuffer_size - 1; + ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength); + ringbuffer_end = ringbuffer_size; + + block_type_trees = []; + block_len_trees = []; + for (var x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) { + block_type_trees[x] = new HuffmanCode(0, 0); + block_len_trees[x] = new HuffmanCode(0, 0); + } + + while (!input_end) { + var meta_block_remaining_len = 0; + var is_uncompressed; + var block_length = [ 1 << 28, 1 << 28, 1 << 28 ]; + var block_type = [ 0 ]; + var num_block_types = [ 1, 1, 1 ]; + var block_type_rb = [ 0, 1, 0, 1, 0, 1 ]; + var block_type_rb_index = [ 0 ]; + var distance_postfix_bits; + var num_direct_distance_codes; + var distance_postfix_mask; + var num_distance_codes; + var context_map = null; + var context_modes = null; + var num_literal_htrees; + var dist_context_map = null; + var num_dist_htrees; + var context_offset = 0; + var context_map_slice = null; + var literal_htree_index = 0; + var dist_context_offset = 0; + var dist_context_map_slice = null; + var dist_htree_index = 0; + var context_lookup_offset1 = 0; + var context_lookup_offset2 = 0; + var context_mode; + var htree_command; + + for (i = 0; i < 3; ++i) { + hgroup[i].codes = null; + hgroup[i].htrees = null; + } + + br.readMoreInput(); + + var _out = DecodeMetaBlockLength(br); + meta_block_remaining_len = _out.meta_block_length; + if (pos + meta_block_remaining_len > output.buffer.length) { + /* We need to grow the output buffer to fit the additional data. */ + var tmp = new Uint8Array( pos + meta_block_remaining_len ); + tmp.set( output.buffer ); + output.buffer = tmp; + } + input_end = _out.input_end; + is_uncompressed = _out.is_uncompressed; + + if (_out.is_metadata) { + JumpToByteBoundary(br); + + for (; meta_block_remaining_len > 0; --meta_block_remaining_len) { + br.readMoreInput(); + /* Read one byte and ignore it. */ + br.readBits(8); + } + + continue; + } + + if (meta_block_remaining_len === 0) { + continue; + } + + if (is_uncompressed) { + br.bit_pos_ = (br.bit_pos_ + 7) & ~7; + CopyUncompressedBlockToOutput(output, meta_block_remaining_len, pos, + ringbuffer, ringbuffer_mask, br); + pos += meta_block_remaining_len; + continue; + } + + for (i = 0; i < 3; ++i) { + num_block_types[i] = DecodeVarLenUint8(br) + 1; + if (num_block_types[i] >= 2) { + ReadHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br); + ReadHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br); + block_length[i] = ReadBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br); + block_type_rb_index[i] = 1; + } + } + + br.readMoreInput(); + + distance_postfix_bits = br.readBits(2); + num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits); + distance_postfix_mask = (1 << distance_postfix_bits) - 1; + num_distance_codes = (num_direct_distance_codes + (48 << distance_postfix_bits)); + context_modes = new Uint8Array(num_block_types[0]); + + for (i = 0; i < num_block_types[0]; ++i) { + br.readMoreInput(); + context_modes[i] = (br.readBits(2) << 1); + } + + var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br); + num_literal_htrees = _o1.num_htrees; + context_map = _o1.context_map; + + var _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br); + num_dist_htrees = _o2.num_htrees; + dist_context_map = _o2.context_map; + + hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees); + hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]); + hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees); + + for (i = 0; i < 3; ++i) { + hgroup[i].decode(br); + } + + context_map_slice = 0; + dist_context_map_slice = 0; + context_mode = context_modes[block_type[0]]; + context_lookup_offset1 = Context.lookupOffsets[context_mode]; + context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; + htree_command = hgroup[1].htrees[0]; + + while (meta_block_remaining_len > 0) { + var cmd_code; + var range_idx; + var insert_code; + var copy_code; + var insert_length; + var copy_length; + var distance_code; + var distance; + var context; + var j; + var copy_dst; + + br.readMoreInput(); + + if (block_length[1] === 0) { + DecodeBlockType(num_block_types[1], + block_type_trees, 1, block_type, block_type_rb, + block_type_rb_index, br); + block_length[1] = ReadBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br); + htree_command = hgroup[1].htrees[block_type[1]]; + } + --block_length[1]; + cmd_code = ReadSymbol(hgroup[1].codes, htree_command, br); + range_idx = cmd_code >> 6; + if (range_idx >= 2) { + range_idx -= 2; + distance_code = -1; + } else { + distance_code = 0; + } + insert_code = Prefix.kInsertRangeLut[range_idx] + ((cmd_code >> 3) & 7); + copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7); + insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset + + br.readBits(Prefix.kInsertLengthPrefixCode[insert_code].nbits); + copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset + + br.readBits(Prefix.kCopyLengthPrefixCode[copy_code].nbits); + prev_byte1 = ringbuffer[pos-1 & ringbuffer_mask]; + prev_byte2 = ringbuffer[pos-2 & ringbuffer_mask]; + for (j = 0; j < insert_length; ++j) { + br.readMoreInput(); + + if (block_length[0] === 0) { + DecodeBlockType(num_block_types[0], + block_type_trees, 0, block_type, block_type_rb, + block_type_rb_index, br); + block_length[0] = ReadBlockLength(block_len_trees, 0, br); + context_offset = block_type[0] << kLiteralContextBits; + context_map_slice = context_offset; + context_mode = context_modes[block_type[0]]; + context_lookup_offset1 = Context.lookupOffsets[context_mode]; + context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; + } + context = (Context.lookup[context_lookup_offset1 + prev_byte1] | + Context.lookup[context_lookup_offset2 + prev_byte2]); + literal_htree_index = context_map[context_map_slice + context]; + --block_length[0]; + prev_byte2 = prev_byte1; + prev_byte1 = ReadSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br); + ringbuffer[pos & ringbuffer_mask] = prev_byte1; + if ((pos & ringbuffer_mask) === ringbuffer_mask) { + output.write(ringbuffer, ringbuffer_size); + } + ++pos; + } + meta_block_remaining_len -= insert_length; + if (meta_block_remaining_len <= 0) break; + + if (distance_code < 0) { + var context; + + br.readMoreInput(); + if (block_length[2] === 0) { + DecodeBlockType(num_block_types[2], + block_type_trees, 2, block_type, block_type_rb, + block_type_rb_index, br); + block_length[2] = ReadBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br); + dist_context_offset = block_type[2] << kDistanceContextBits; + dist_context_map_slice = dist_context_offset; + } + --block_length[2]; + context = (copy_length > 4 ? 3 : copy_length - 2) & 0xff; + dist_htree_index = dist_context_map[dist_context_map_slice + context]; + distance_code = ReadSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br); + if (distance_code >= num_direct_distance_codes) { + var nbits; + var postfix; + var offset; + distance_code -= num_direct_distance_codes; + postfix = distance_code & distance_postfix_mask; + distance_code >>= distance_postfix_bits; + nbits = (distance_code >> 1) + 1; + offset = ((2 + (distance_code & 1)) << nbits) - 4; + distance_code = num_direct_distance_codes + + ((offset + br.readBits(nbits)) << + distance_postfix_bits) + postfix; + } + } + + /* Convert the distance code to the actual distance by possibly looking */ + /* up past distnaces from the ringbuffer. */ + distance = TranslateShortCodes(distance_code, dist_rb, dist_rb_idx); + if (distance < 0) { + throw new Error('[BrotliDecompress] invalid distance'); + } + + if (pos < max_backward_distance && + max_distance !== max_backward_distance) { + max_distance = pos; + } else { + max_distance = max_backward_distance; + } + + copy_dst = pos & ringbuffer_mask; + + if (distance > max_distance) { + if (copy_length >= BrotliDictionary.minDictionaryWordLength && + copy_length <= BrotliDictionary.maxDictionaryWordLength) { + var offset = BrotliDictionary.offsetsByLength[copy_length]; + var word_id = distance - max_distance - 1; + var shift = BrotliDictionary.sizeBitsByLength[copy_length]; + var mask = (1 << shift) - 1; + var word_idx = word_id & mask; + var transform_idx = word_id >> shift; + offset += word_idx * copy_length; + if (transform_idx < Transform.kNumTransforms) { + var len = Transform.transformDictionaryWord(ringbuffer, copy_dst, offset, copy_length, transform_idx); + copy_dst += len; + pos += len; + meta_block_remaining_len -= len; + if (copy_dst >= ringbuffer_end) { + output.write(ringbuffer, ringbuffer_size); + + for (var _x = 0; _x < (copy_dst - ringbuffer_end); _x++) + ringbuffer[_x] = ringbuffer[ringbuffer_end + _x]; + } + } else { + throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance + + " len: " + copy_length + " bytes left: " + meta_block_remaining_len); + } + } else { + throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance + + " len: " + copy_length + " bytes left: " + meta_block_remaining_len); + } + } else { + if (distance_code > 0) { + dist_rb[dist_rb_idx & 3] = distance; + ++dist_rb_idx; + } + + if (copy_length > meta_block_remaining_len) { + throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance + + " len: " + copy_length + " bytes left: " + meta_block_remaining_len); + } + + for (j = 0; j < copy_length; ++j) { + ringbuffer[pos & ringbuffer_mask] = ringbuffer[(pos - distance) & ringbuffer_mask]; + if ((pos & ringbuffer_mask) === ringbuffer_mask) { + output.write(ringbuffer, ringbuffer_size); + } + ++pos; + --meta_block_remaining_len; + } + } + + /* When we get here, we must have inserted at least one literal and */ + /* made a copy of at least length two, therefore accessing the last 2 */ + /* bytes is valid. */ + prev_byte1 = ringbuffer[(pos - 1) & ringbuffer_mask]; + prev_byte2 = ringbuffer[(pos - 2) & ringbuffer_mask]; + } + + /* Protect pos from overflow, wrap it around at every GB of input data */ + pos &= 0x3fffffff; + } + + output.write(ringbuffer, pos & ringbuffer_mask); +} + +exports.BrotliDecompress = BrotliDecompress; + +BrotliDictionary.init(); + +},{"./bit_reader":1,"./context":2,"./dictionary":6,"./huffman":7,"./prefix":9,"./streams":10,"./transform":11}],4:[function(require,module,exports){ +var base64 = require('base64-js'); +//var fs = require('fs'); + +/** + * The normal dictionary-data.js is quite large, which makes it + * unsuitable for browser usage. In order to make it smaller, + * we read dictionary.bin, which is a compressed version of + * the dictionary, and on initial load, Brotli decompresses + * it's own dictionary. 😜 + */ +exports.init = function() { + var BrotliDecompressBuffer = require('./decode').BrotliDecompressBuffer; + var compressed = base64.toByteArray(require('./dictionary.bin.js')); + return BrotliDecompressBuffer(compressed); +}; + +},{"./decode":3,"./dictionary.bin.js":5,"base64-js":8}],5:[function(require,module,exports){ +module.exports="W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnRYJVYXHRJaNAOByia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/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg="; + +},{}],6:[function(require,module,exports){ +/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -5927,396 +4827,306 @@ Collection of static dictionary words. */ - var data = require( './dictionary-browser' ); - exports.init = function () { - exports.dictionary = data.init(); - }; - - exports.offsetsByLength = new Uint32Array( [ - 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, 53248, - 63488, 74752, 87040, 93696, 100864, 104704, 106752, - 108928, 113536, 115968, 118528, 119872, 121280, 122016, - ] ); - - exports.sizeBitsByLength = new Uint8Array( [ - 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, - 7, 7, 8, 7, 7, 6, 6, 5, 5, - ] ); - - exports.minDictionaryWordLength = 4; - exports.maxDictionaryWordLength = 24; - }, - { './dictionary-browser': 4 }, - ], - 7: [ - function ( require, module, exports ) { - function HuffmanCode( bits, value ) { - this.bits = - bits; /* number of bits used for this symbol */ - this.value = value; /* symbol value or table offset */ - } - - exports.HuffmanCode = HuffmanCode; - - var MAX_LENGTH = 15; - - /* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the +var data = require('./dictionary-browser'); +exports.init = function() { + exports.dictionary = data.init(); +}; + +exports.offsetsByLength = new Uint32Array([ + 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, + 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536, + 115968, 118528, 119872, 121280, 122016, +]); + +exports.sizeBitsByLength = new Uint8Array([ + 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, + 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, + 7, 6, 6, 5, 5, +]); + +exports.minDictionaryWordLength = 4; +exports.maxDictionaryWordLength = 24; + +},{"./dictionary-browser":4}],7:[function(require,module,exports){ +function HuffmanCode(bits, value) { + this.bits = bits; /* number of bits used for this symbol */ + this.value = value; /* symbol value or table offset */ +} + +exports.HuffmanCode = HuffmanCode; + +var MAX_LENGTH = 15; + +/* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the bit-wise reversal of the len least significant bits of key. */ - function GetNextKey( key, len ) { - var step = 1 << ( len - 1 ); - while ( key & step ) { - step >>= 1; - } - return ( key & ( step - 1 ) ) + step; - } - - /* Stores code in table[0], table[step], table[2*step], ..., table[end] */ - /* Assumes that end is an integer multiple of step */ - function ReplicateValue( table, i, step, end, code ) { - do { - end -= step; - table[ i + end ] = new HuffmanCode( - code.bits, - code.value - ); - } while ( end > 0 ); - } - - /* Returns the table width of the next 2nd level table. count is the histogram +function GetNextKey(key, len) { + var step = 1 << (len - 1); + while (key & step) { + step >>= 1; + } + return (key & (step - 1)) + step; +} + +/* Stores code in table[0], table[step], table[2*step], ..., table[end] */ +/* Assumes that end is an integer multiple of step */ +function ReplicateValue(table, i, step, end, code) { + do { + end -= step; + table[i + end] = new HuffmanCode(code.bits, code.value); + } while (end > 0); +} + +/* Returns the table width of the next 2nd level table. count is the histogram of bit lengths for the remaining symbols, len is the code length of the next processed symbol */ - function NextTableBitSize( count, len, root_bits ) { - var left = 1 << ( len - root_bits ); - while ( len < MAX_LENGTH ) { - left -= count[ len ]; - if ( left <= 0 ) break; - ++len; - left <<= 1; - } - return len - root_bits; - } - - exports.BrotliBuildHuffmanTable = function ( - root_table, - table, - root_bits, - code_lengths, - code_lengths_size - ) { - var start_table = table; - var code; /* current table entry */ - var len; /* current code length */ - var symbol; /* symbol index in original or sorted table */ - var key; /* reversed prefix code */ - var step; /* step size to replicate values in current table */ - var low; /* low bits for current root entry */ - var mask; /* mask for low bits */ - var table_bits; /* key length of current table */ - var table_size; /* size of current table */ - var total_size; /* sum of root table size and 2nd level table sizes */ - var sorted; /* symbols sorted by code length */ - var count = new Int32Array( - MAX_LENGTH + 1 - ); /* number of codes of each length */ - var offset = new Int32Array( - MAX_LENGTH + 1 - ); /* offsets in sorted table for each length */ - - sorted = new Int32Array( code_lengths_size ); - - /* build histogram of code lengths */ - for ( - symbol = 0; - symbol < code_lengths_size; - symbol++ - ) { - count[ code_lengths[ symbol ] ]++; - } - - /* generate offsets into sorted symbol table by code length */ - offset[ 1 ] = 0; - for ( len = 1; len < MAX_LENGTH; len++ ) { - offset[ len + 1 ] = offset[ len ] + count[ len ]; - } - - /* sort symbols by length, by symbol order within each length */ - for ( - symbol = 0; - symbol < code_lengths_size; - symbol++ - ) { - if ( code_lengths[ symbol ] !== 0 ) { - sorted[ offset[ code_lengths[ symbol ] ]++ ] = - symbol; - } - } - - table_bits = root_bits; - table_size = 1 << table_bits; - total_size = table_size; - - /* special case code with only one value */ - if ( offset[ MAX_LENGTH ] === 1 ) { - for ( key = 0; key < total_size; ++key ) { - root_table[ table + key ] = new HuffmanCode( - 0, - sorted[ 0 ] & 0xffff - ); - } - - return total_size; - } - - /* fill in root table */ - key = 0; - symbol = 0; - for ( - len = 1, step = 2; - len <= root_bits; - ++len, step <<= 1 - ) { - for ( ; count[ len ] > 0; --count[ len ] ) { - code = new HuffmanCode( - len & 0xff, - sorted[ symbol++ ] & 0xffff - ); - ReplicateValue( - root_table, - table + key, - step, - table_size, - code - ); - key = GetNextKey( key, len ); - } - } - - /* fill in 2nd level tables and add pointers to root table */ - mask = total_size - 1; - low = -1; - for ( - len = root_bits + 1, step = 2; - len <= MAX_LENGTH; - ++len, step <<= 1 - ) { - for ( ; count[ len ] > 0; --count[ len ] ) { - if ( ( key & mask ) !== low ) { - table += table_size; - table_bits = NextTableBitSize( - count, - len, - root_bits - ); - table_size = 1 << table_bits; - total_size += table_size; - low = key & mask; - root_table[ start_table + low ] = - new HuffmanCode( - ( table_bits + root_bits ) & 0xff, - ( table - start_table - low ) & - 0xffff - ); - } - code = new HuffmanCode( - ( len - root_bits ) & 0xff, - sorted[ symbol++ ] & 0xffff - ); - ReplicateValue( - root_table, - table + ( key >> root_bits ), - step, - table_size, - code - ); - key = GetNextKey( key, len ); - } - } - - return total_size; - }; - }, - {}, - ], - 8: [ - function ( require, module, exports ) { - 'use strict'; - - exports.byteLength = byteLength; - exports.toByteArray = toByteArray; - exports.fromByteArray = fromByteArray; - - var lookup = []; - var revLookup = []; - var Arr = - typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - - var code = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for ( var i = 0, len = code.length; i < len; ++i ) { - lookup[ i ] = code[ i ]; - revLookup[ code.charCodeAt( i ) ] = i; - } - - // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - revLookup[ '-'.charCodeAt( 0 ) ] = 62; - revLookup[ '_'.charCodeAt( 0 ) ] = 63; - - function getLens( b64 ) { - var len = b64.length; - - if ( len % 4 > 0 ) { - throw new Error( - 'Invalid string. Length must be a multiple of 4' - ); - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf( '=' ); - if ( validLen === -1 ) validLen = len; - - var placeHoldersLen = - validLen === len ? 0 : 4 - ( validLen % 4 ); - - return [ validLen, placeHoldersLen ]; - } - - // base64 is 4/3 + up to two characters of the original data - function byteLength( b64 ) { - var lens = getLens( b64 ); - var validLen = lens[ 0 ]; - var placeHoldersLen = lens[ 1 ]; - return ( - ( ( validLen + placeHoldersLen ) * 3 ) / 4 - - placeHoldersLen - ); - } - - function _byteLength( b64, validLen, placeHoldersLen ) { - return ( - ( ( validLen + placeHoldersLen ) * 3 ) / 4 - - placeHoldersLen - ); - } - - function toByteArray( b64 ) { - var tmp; - var lens = getLens( b64 ); - var validLen = lens[ 0 ]; - var placeHoldersLen = lens[ 1 ]; - - var arr = new Arr( - _byteLength( b64, validLen, placeHoldersLen ) - ); - - var curByte = 0; - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 ? validLen - 4 : validLen; - - for ( var i = 0; i < len; i += 4 ) { - tmp = - ( revLookup[ b64.charCodeAt( i ) ] << 18 ) | - ( revLookup[ b64.charCodeAt( i + 1 ) ] << 12 ) | - ( revLookup[ b64.charCodeAt( i + 2 ) ] << 6 ) | - revLookup[ b64.charCodeAt( i + 3 ) ]; - arr[ curByte++ ] = ( tmp >> 16 ) & 0xff; - arr[ curByte++ ] = ( tmp >> 8 ) & 0xff; - arr[ curByte++ ] = tmp & 0xff; - } - - if ( placeHoldersLen === 2 ) { - tmp = - ( revLookup[ b64.charCodeAt( i ) ] << 2 ) | - ( revLookup[ b64.charCodeAt( i + 1 ) ] >> 4 ); - arr[ curByte++ ] = tmp & 0xff; - } - - if ( placeHoldersLen === 1 ) { - tmp = - ( revLookup[ b64.charCodeAt( i ) ] << 10 ) | - ( revLookup[ b64.charCodeAt( i + 1 ) ] << 4 ) | - ( revLookup[ b64.charCodeAt( i + 2 ) ] >> 2 ); - arr[ curByte++ ] = ( tmp >> 8 ) & 0xff; - arr[ curByte++ ] = tmp & 0xff; - } - - return arr; - } - - function tripletToBase64( num ) { - return ( - lookup[ ( num >> 18 ) & 0x3f ] + - lookup[ ( num >> 12 ) & 0x3f ] + - lookup[ ( num >> 6 ) & 0x3f ] + - lookup[ num & 0x3f ] - ); - } - - function encodeChunk( uint8, start, end ) { - var tmp; - var output = []; - for ( var i = start; i < end; i += 3 ) { - tmp = - ( ( uint8[ i ] << 16 ) & 0xff0000 ) + - ( ( uint8[ i + 1 ] << 8 ) & 0xff00 ) + - ( uint8[ i + 2 ] & 0xff ); - output.push( tripletToBase64( tmp ) ); - } - return output.join( '' ); - } - - function fromByteArray( uint8 ) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for ( - var i = 0, len2 = len - extraBytes; - i < len2; - i += maxChunkLength - ) { - parts.push( - encodeChunk( - uint8, - i, - i + maxChunkLength > len2 - ? len2 - : i + maxChunkLength - ) - ); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if ( extraBytes === 1 ) { - tmp = uint8[ len - 1 ]; - parts.push( - lookup[ tmp >> 2 ] + - lookup[ ( tmp << 4 ) & 0x3f ] + - '==' - ); - } else if ( extraBytes === 2 ) { - tmp = ( uint8[ len - 2 ] << 8 ) + uint8[ len - 1 ]; - parts.push( - lookup[ tmp >> 10 ] + - lookup[ ( tmp >> 4 ) & 0x3f ] + - lookup[ ( tmp << 2 ) & 0x3f ] + - '=' - ); - } - - return parts.join( '' ); - } - }, - {}, - ], - 9: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. +function NextTableBitSize(count, len, root_bits) { + var left = 1 << (len - root_bits); + while (len < MAX_LENGTH) { + left -= count[len]; + if (left <= 0) break; + ++len; + left <<= 1; + } + return len - root_bits; +} + +exports.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) { + var start_table = table; + var code; /* current table entry */ + var len; /* current code length */ + var symbol; /* symbol index in original or sorted table */ + var key; /* reversed prefix code */ + var step; /* step size to replicate values in current table */ + var low; /* low bits for current root entry */ + var mask; /* mask for low bits */ + var table_bits; /* key length of current table */ + var table_size; /* size of current table */ + var total_size; /* sum of root table size and 2nd level table sizes */ + var sorted; /* symbols sorted by code length */ + var count = new Int32Array(MAX_LENGTH + 1); /* number of codes of each length */ + var offset = new Int32Array(MAX_LENGTH + 1); /* offsets in sorted table for each length */ + + sorted = new Int32Array(code_lengths_size); + + /* build histogram of code lengths */ + for (symbol = 0; symbol < code_lengths_size; symbol++) { + count[code_lengths[symbol]]++; + } + + /* generate offsets into sorted symbol table by code length */ + offset[1] = 0; + for (len = 1; len < MAX_LENGTH; len++) { + offset[len + 1] = offset[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (symbol = 0; symbol < code_lengths_size; symbol++) { + if (code_lengths[symbol] !== 0) { + sorted[offset[code_lengths[symbol]]++] = symbol; + } + } + + table_bits = root_bits; + table_size = 1 << table_bits; + total_size = table_size; + + /* special case code with only one value */ + if (offset[MAX_LENGTH] === 1) { + for (key = 0; key < total_size; ++key) { + root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff); + } + + return total_size; + } + + /* fill in root table */ + key = 0; + symbol = 0; + for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) { + for (; count[len] > 0; --count[len]) { + code = new HuffmanCode(len & 0xff, sorted[symbol++] & 0xffff); + ReplicateValue(root_table, table + key, step, table_size, code); + key = GetNextKey(key, len); + } + } + + /* fill in 2nd level tables and add pointers to root table */ + mask = total_size - 1; + low = -1; + for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) { + for (; count[len] > 0; --count[len]) { + if ((key & mask) !== low) { + table += table_size; + table_bits = NextTableBitSize(count, len, root_bits); + table_size = 1 << table_bits; + total_size += table_size; + low = key & mask; + root_table[start_table + low] = new HuffmanCode((table_bits + root_bits) & 0xff, ((table - start_table) - low) & 0xffff); + } + code = new HuffmanCode((len - root_bits) & 0xff, sorted[symbol++] & 0xffff); + ReplicateValue(root_table, table + (key >> root_bits), step, table_size, code); + key = GetNextKey(key, len); + } + } + + return total_size; +} + +},{}],8:[function(require,module,exports){ +'use strict' + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + for (var i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + +},{}],9:[function(require,module,exports){ +/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6334,146 +5144,87 @@ decoding of the block lengths, literal insertion lengths and copy lengths. */ - /* Represents the range of values belonging to a prefix code: */ - /* [offset, offset + 2^nbits) */ - function PrefixCodeRange( offset, nbits ) { - this.offset = offset; - this.nbits = nbits; - } - - exports.kBlockLengthPrefixCode = [ - new PrefixCodeRange( 1, 2 ), - new PrefixCodeRange( 5, 2 ), - new PrefixCodeRange( 9, 2 ), - new PrefixCodeRange( 13, 2 ), - new PrefixCodeRange( 17, 3 ), - new PrefixCodeRange( 25, 3 ), - new PrefixCodeRange( 33, 3 ), - new PrefixCodeRange( 41, 3 ), - new PrefixCodeRange( 49, 4 ), - new PrefixCodeRange( 65, 4 ), - new PrefixCodeRange( 81, 4 ), - new PrefixCodeRange( 97, 4 ), - new PrefixCodeRange( 113, 5 ), - new PrefixCodeRange( 145, 5 ), - new PrefixCodeRange( 177, 5 ), - new PrefixCodeRange( 209, 5 ), - new PrefixCodeRange( 241, 6 ), - new PrefixCodeRange( 305, 6 ), - new PrefixCodeRange( 369, 7 ), - new PrefixCodeRange( 497, 8 ), - new PrefixCodeRange( 753, 9 ), - new PrefixCodeRange( 1265, 10 ), - new PrefixCodeRange( 2289, 11 ), - new PrefixCodeRange( 4337, 12 ), - new PrefixCodeRange( 8433, 13 ), - new PrefixCodeRange( 16625, 24 ), - ]; - - exports.kInsertLengthPrefixCode = [ - new PrefixCodeRange( 0, 0 ), - new PrefixCodeRange( 1, 0 ), - new PrefixCodeRange( 2, 0 ), - new PrefixCodeRange( 3, 0 ), - new PrefixCodeRange( 4, 0 ), - new PrefixCodeRange( 5, 0 ), - new PrefixCodeRange( 6, 1 ), - new PrefixCodeRange( 8, 1 ), - new PrefixCodeRange( 10, 2 ), - new PrefixCodeRange( 14, 2 ), - new PrefixCodeRange( 18, 3 ), - new PrefixCodeRange( 26, 3 ), - new PrefixCodeRange( 34, 4 ), - new PrefixCodeRange( 50, 4 ), - new PrefixCodeRange( 66, 5 ), - new PrefixCodeRange( 98, 5 ), - new PrefixCodeRange( 130, 6 ), - new PrefixCodeRange( 194, 7 ), - new PrefixCodeRange( 322, 8 ), - new PrefixCodeRange( 578, 9 ), - new PrefixCodeRange( 1090, 10 ), - new PrefixCodeRange( 2114, 12 ), - new PrefixCodeRange( 6210, 14 ), - new PrefixCodeRange( 22594, 24 ), - ]; - - exports.kCopyLengthPrefixCode = [ - new PrefixCodeRange( 2, 0 ), - new PrefixCodeRange( 3, 0 ), - new PrefixCodeRange( 4, 0 ), - new PrefixCodeRange( 5, 0 ), - new PrefixCodeRange( 6, 0 ), - new PrefixCodeRange( 7, 0 ), - new PrefixCodeRange( 8, 0 ), - new PrefixCodeRange( 9, 0 ), - new PrefixCodeRange( 10, 1 ), - new PrefixCodeRange( 12, 1 ), - new PrefixCodeRange( 14, 2 ), - new PrefixCodeRange( 18, 2 ), - new PrefixCodeRange( 22, 3 ), - new PrefixCodeRange( 30, 3 ), - new PrefixCodeRange( 38, 4 ), - new PrefixCodeRange( 54, 4 ), - new PrefixCodeRange( 70, 5 ), - new PrefixCodeRange( 102, 5 ), - new PrefixCodeRange( 134, 6 ), - new PrefixCodeRange( 198, 7 ), - new PrefixCodeRange( 326, 8 ), - new PrefixCodeRange( 582, 9 ), - new PrefixCodeRange( 1094, 10 ), - new PrefixCodeRange( 2118, 24 ), - ]; - - exports.kInsertRangeLut = [ 0, 0, 8, 8, 0, 16, 8, 16, 16 ]; - - exports.kCopyRangeLut = [ 0, 8, 0, 8, 16, 0, 16, 8, 16 ]; - }, - {}, - ], - 10: [ - function ( require, module, exports ) { - function BrotliInput( buffer ) { - this.buffer = buffer; - this.pos = 0; - } - - BrotliInput.prototype.read = function ( buf, i, count ) { - if ( this.pos + count > this.buffer.length ) { - count = this.buffer.length - this.pos; - } - - for ( var p = 0; p < count; p++ ) - buf[ i + p ] = this.buffer[ this.pos + p ]; - - this.pos += count; - return count; - }; - - exports.BrotliInput = BrotliInput; - - function BrotliOutput( buf ) { - this.buffer = buf; - this.pos = 0; - } - - BrotliOutput.prototype.write = function ( buf, count ) { - if ( this.pos + count > this.buffer.length ) - throw new Error( - 'Output buffer is not large enough' - ); - - this.buffer.set( buf.subarray( 0, count ), this.pos ); - this.pos += count; - return count; - }; - - exports.BrotliOutput = BrotliOutput; - }, - {}, - ], - 11: [ - function ( require, module, exports ) { - /* Copyright 2013 Google Inc. All Rights Reserved. +/* Represents the range of values belonging to a prefix code: */ +/* [offset, offset + 2^nbits) */ +function PrefixCodeRange(offset, nbits) { + this.offset = offset; + this.nbits = nbits; +} + +exports.kBlockLengthPrefixCode = [ + new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2), + new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3), + new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4), + new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5), + new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8), + new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12), + new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24) +]; + +exports.kInsertLengthPrefixCode = [ + new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), + new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1), + new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3), + new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5), + new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9), + new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24), +]; + +exports.kCopyLengthPrefixCode = [ + new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), + new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0), + new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2), + new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4), + new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7), + new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24), +]; + +exports.kInsertRangeLut = [ + 0, 0, 8, 8, 0, 16, 8, 16, 16, +]; + +exports.kCopyRangeLut = [ + 0, 8, 0, 8, 16, 0, 16, 8, 16, +]; + +},{}],10:[function(require,module,exports){ +function BrotliInput(buffer) { + this.buffer = buffer; + this.pos = 0; +} + +BrotliInput.prototype.read = function(buf, i, count) { + if (this.pos + count > this.buffer.length) { + count = this.buffer.length - this.pos; + } + + for (var p = 0; p < count; p++) + buf[i + p] = this.buffer[this.pos + p]; + + this.pos += count; + return count; +} + +exports.BrotliInput = BrotliInput; + +function BrotliOutput(buf) { + this.buffer = buf; + this.pos = 0; +} + +BrotliOutput.prototype.write = function(buf, count) { + if (this.pos + count > this.buffer.length) + throw new Error('Output buffer is not large enough'); + + this.buffer.set(buf.subarray(0, count), this.pos); + this.pos += count; + return count; +}; + +exports.BrotliOutput = BrotliOutput; + +},{}],11:[function(require,module,exports){ +/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -6490,259 +5241,242 @@ Transformations on dictionary words. */ - var BrotliDictionary = require( './dictionary' ); - - var kIdentity = 0; - var kOmitLast1 = 1; - var kOmitLast2 = 2; - var kOmitLast3 = 3; - var kOmitLast4 = 4; - var kOmitLast5 = 5; - var kOmitLast6 = 6; - var kOmitLast7 = 7; - var kOmitLast8 = 8; - var kOmitLast9 = 9; - var kUppercaseFirst = 10; - var kUppercaseAll = 11; - var kOmitFirst1 = 12; - var kOmitFirst2 = 13; - var kOmitFirst3 = 14; - var kOmitFirst4 = 15; - var kOmitFirst5 = 16; - var kOmitFirst6 = 17; - var kOmitFirst7 = 18; - var kOmitFirst8 = 19; - var kOmitFirst9 = 20; - - function Transform( prefix, transform, suffix ) { - this.prefix = new Uint8Array( prefix.length ); - this.transform = transform; - this.suffix = new Uint8Array( suffix.length ); - - for ( var i = 0; i < prefix.length; i++ ) - this.prefix[ i ] = prefix.charCodeAt( i ); - - for ( var i = 0; i < suffix.length; i++ ) - this.suffix[ i ] = suffix.charCodeAt( i ); - } - - var kTransforms = [ - new Transform( '', kIdentity, '' ), - new Transform( '', kIdentity, ' ' ), - new Transform( ' ', kIdentity, ' ' ), - new Transform( '', kOmitFirst1, '' ), - new Transform( '', kUppercaseFirst, ' ' ), - new Transform( '', kIdentity, ' the ' ), - new Transform( ' ', kIdentity, '' ), - new Transform( 's ', kIdentity, ' ' ), - new Transform( '', kIdentity, ' of ' ), - new Transform( '', kUppercaseFirst, '' ), - new Transform( '', kIdentity, ' and ' ), - new Transform( '', kOmitFirst2, '' ), - new Transform( '', kOmitLast1, '' ), - new Transform( ', ', kIdentity, ' ' ), - new Transform( '', kIdentity, ', ' ), - new Transform( ' ', kUppercaseFirst, ' ' ), - new Transform( '', kIdentity, ' in ' ), - new Transform( '', kIdentity, ' to ' ), - new Transform( 'e ', kIdentity, ' ' ), - new Transform( '', kIdentity, '"' ), - new Transform( '', kIdentity, '.' ), - new Transform( '', kIdentity, '">' ), - new Transform( '', kIdentity, '\n' ), - new Transform( '', kOmitLast3, '' ), - new Transform( '', kIdentity, ']' ), - new Transform( '', kIdentity, ' for ' ), - new Transform( '', kOmitFirst3, '' ), - new Transform( '', kOmitLast2, '' ), - new Transform( '', kIdentity, ' a ' ), - new Transform( '', kIdentity, ' that ' ), - new Transform( ' ', kUppercaseFirst, '' ), - new Transform( '', kIdentity, '. ' ), - new Transform( '.', kIdentity, '' ), - new Transform( ' ', kIdentity, ', ' ), - new Transform( '', kOmitFirst4, '' ), - new Transform( '', kIdentity, ' with ' ), - new Transform( '', kIdentity, "'" ), - new Transform( '', kIdentity, ' from ' ), - new Transform( '', kIdentity, ' by ' ), - new Transform( '', kOmitFirst5, '' ), - new Transform( '', kOmitFirst6, '' ), - new Transform( ' the ', kIdentity, '' ), - new Transform( '', kOmitLast4, '' ), - new Transform( '', kIdentity, '. The ' ), - new Transform( '', kUppercaseAll, '' ), - new Transform( '', kIdentity, ' on ' ), - new Transform( '', kIdentity, ' as ' ), - new Transform( '', kIdentity, ' is ' ), - new Transform( '', kOmitLast7, '' ), - new Transform( '', kOmitLast1, 'ing ' ), - new Transform( '', kIdentity, '\n\t' ), - new Transform( '', kIdentity, ':' ), - new Transform( ' ', kIdentity, '. ' ), - new Transform( '', kIdentity, 'ed ' ), - new Transform( '', kOmitFirst9, '' ), - new Transform( '', kOmitFirst7, '' ), - new Transform( '', kOmitLast6, '' ), - new Transform( '', kIdentity, '(' ), - new Transform( '', kUppercaseFirst, ', ' ), - new Transform( '', kOmitLast8, '' ), - new Transform( '', kIdentity, ' at ' ), - new Transform( '', kIdentity, 'ly ' ), - new Transform( ' the ', kIdentity, ' of ' ), - new Transform( '', kOmitLast5, '' ), - new Transform( '', kOmitLast9, '' ), - new Transform( ' ', kUppercaseFirst, ', ' ), - new Transform( '', kUppercaseFirst, '"' ), - new Transform( '.', kIdentity, '(' ), - new Transform( '', kUppercaseAll, ' ' ), - new Transform( '', kUppercaseFirst, '">' ), - new Transform( '', kIdentity, '="' ), - new Transform( ' ', kIdentity, '.' ), - new Transform( '.com/', kIdentity, '' ), - new Transform( ' the ', kIdentity, ' of the ' ), - new Transform( '', kUppercaseFirst, "'" ), - new Transform( '', kIdentity, '. This ' ), - new Transform( '', kIdentity, ',' ), - new Transform( '.', kIdentity, ' ' ), - new Transform( '', kUppercaseFirst, '(' ), - new Transform( '', kUppercaseFirst, '.' ), - new Transform( '', kIdentity, ' not ' ), - new Transform( ' ', kIdentity, '="' ), - new Transform( '', kIdentity, 'er ' ), - new Transform( ' ', kUppercaseAll, ' ' ), - new Transform( '', kIdentity, 'al ' ), - new Transform( ' ', kUppercaseAll, '' ), - new Transform( '', kIdentity, "='" ), - new Transform( '', kUppercaseAll, '"' ), - new Transform( '', kUppercaseFirst, '. ' ), - new Transform( ' ', kIdentity, '(' ), - new Transform( '', kIdentity, 'ful ' ), - new Transform( ' ', kUppercaseFirst, '. ' ), - new Transform( '', kIdentity, 'ive ' ), - new Transform( '', kIdentity, 'less ' ), - new Transform( '', kUppercaseAll, "'" ), - new Transform( '', kIdentity, 'est ' ), - new Transform( ' ', kUppercaseFirst, '.' ), - new Transform( '', kUppercaseAll, '">' ), - new Transform( ' ', kIdentity, "='" ), - new Transform( '', kUppercaseFirst, ',' ), - new Transform( '', kIdentity, 'ize ' ), - new Transform( '', kUppercaseAll, '.' ), - new Transform( '\xc2\xa0', kIdentity, '' ), - new Transform( ' ', kIdentity, ',' ), - new Transform( '', kUppercaseFirst, '="' ), - new Transform( '', kUppercaseAll, '="' ), - new Transform( '', kIdentity, 'ous ' ), - new Transform( '', kUppercaseAll, ', ' ), - new Transform( '', kUppercaseFirst, "='" ), - new Transform( ' ', kUppercaseFirst, ',' ), - new Transform( ' ', kUppercaseAll, '="' ), - new Transform( ' ', kUppercaseAll, ', ' ), - new Transform( '', kUppercaseAll, ',' ), - new Transform( '', kUppercaseAll, '(' ), - new Transform( '', kUppercaseAll, '. ' ), - new Transform( ' ', kUppercaseAll, '.' ), - new Transform( '', kUppercaseAll, "='" ), - new Transform( ' ', kUppercaseAll, '. ' ), - new Transform( ' ', kUppercaseFirst, '="' ), - new Transform( ' ', kUppercaseAll, "='" ), - new Transform( ' ', kUppercaseFirst, "='" ), - ]; - - exports.kTransforms = kTransforms; - exports.kNumTransforms = kTransforms.length; - - function ToUpperCase( p, i ) { - if ( p[ i ] < 0xc0 ) { - if ( p[ i ] >= 97 && p[ i ] <= 122 ) { - p[ i ] ^= 32; - } - return 1; - } - - /* An overly simplified uppercasing model for utf-8. */ - if ( p[ i ] < 0xe0 ) { - p[ i + 1 ] ^= 32; - return 2; - } - - /* An arbitrary transform for three byte characters. */ - p[ i + 2 ] ^= 5; - return 3; - } - - exports.transformDictionaryWord = function ( - dst, - idx, - word, - len, - transform - ) { - var prefix = kTransforms[ transform ].prefix; - var suffix = kTransforms[ transform ].suffix; - var t = kTransforms[ transform ].transform; - var skip = - t < kOmitFirst1 ? 0 : t - ( kOmitFirst1 - 1 ); - var i = 0; - var start_idx = idx; - var uppercase; - - if ( skip > len ) { - skip = len; - } - - var prefix_pos = 0; - while ( prefix_pos < prefix.length ) { - dst[ idx++ ] = prefix[ prefix_pos++ ]; - } - - word += skip; - len -= skip; - - if ( t <= kOmitLast9 ) { - len -= t; - } - - for ( i = 0; i < len; i++ ) { - dst[ idx++ ] = - BrotliDictionary.dictionary[ word + i ]; - } - - uppercase = idx - len; - - if ( t === kUppercaseFirst ) { - ToUpperCase( dst, uppercase ); - } else if ( t === kUppercaseAll ) { - while ( len > 0 ) { - var step = ToUpperCase( dst, uppercase ); - uppercase += step; - len -= step; - } - } - - var suffix_pos = 0; - while ( suffix_pos < suffix.length ) { - dst[ idx++ ] = suffix[ suffix_pos++ ]; - } - - return idx - start_idx; - }; - }, - { './dictionary': 6 }, - ], - 12: [ - function ( require, module, exports ) { - module.exports = - require( './dec/decode' ).BrotliDecompressBuffer; - }, - { './dec/decode': 3 }, - ], - }, - {}, - [ 12 ] - )( 12 ); -} ); +var BrotliDictionary = require('./dictionary'); + +var kIdentity = 0; +var kOmitLast1 = 1; +var kOmitLast2 = 2; +var kOmitLast3 = 3; +var kOmitLast4 = 4; +var kOmitLast5 = 5; +var kOmitLast6 = 6; +var kOmitLast7 = 7; +var kOmitLast8 = 8; +var kOmitLast9 = 9; +var kUppercaseFirst = 10; +var kUppercaseAll = 11; +var kOmitFirst1 = 12; +var kOmitFirst2 = 13; +var kOmitFirst3 = 14; +var kOmitFirst4 = 15; +var kOmitFirst5 = 16; +var kOmitFirst6 = 17; +var kOmitFirst7 = 18; +var kOmitFirst8 = 19; +var kOmitFirst9 = 20; + +function Transform(prefix, transform, suffix) { + this.prefix = new Uint8Array(prefix.length); + this.transform = transform; + this.suffix = new Uint8Array(suffix.length); + + for (var i = 0; i < prefix.length; i++) + this.prefix[i] = prefix.charCodeAt(i); + + for (var i = 0; i < suffix.length; i++) + this.suffix[i] = suffix.charCodeAt(i); +} + +var kTransforms = [ + new Transform( "", kIdentity, "" ), + new Transform( "", kIdentity, " " ), + new Transform( " ", kIdentity, " " ), + new Transform( "", kOmitFirst1, "" ), + new Transform( "", kUppercaseFirst, " " ), + new Transform( "", kIdentity, " the " ), + new Transform( " ", kIdentity, "" ), + new Transform( "s ", kIdentity, " " ), + new Transform( "", kIdentity, " of " ), + new Transform( "", kUppercaseFirst, "" ), + new Transform( "", kIdentity, " and " ), + new Transform( "", kOmitFirst2, "" ), + new Transform( "", kOmitLast1, "" ), + new Transform( ", ", kIdentity, " " ), + new Transform( "", kIdentity, ", " ), + new Transform( " ", kUppercaseFirst, " " ), + new Transform( "", kIdentity, " in " ), + new Transform( "", kIdentity, " to " ), + new Transform( "e ", kIdentity, " " ), + new Transform( "", kIdentity, "\"" ), + new Transform( "", kIdentity, "." ), + new Transform( "", kIdentity, "\">" ), + new Transform( "", kIdentity, "\n" ), + new Transform( "", kOmitLast3, "" ), + new Transform( "", kIdentity, "]" ), + new Transform( "", kIdentity, " for " ), + new Transform( "", kOmitFirst3, "" ), + new Transform( "", kOmitLast2, "" ), + new Transform( "", kIdentity, " a " ), + new Transform( "", kIdentity, " that " ), + new Transform( " ", kUppercaseFirst, "" ), + new Transform( "", kIdentity, ". " ), + new Transform( ".", kIdentity, "" ), + new Transform( " ", kIdentity, ", " ), + new Transform( "", kOmitFirst4, "" ), + new Transform( "", kIdentity, " with " ), + new Transform( "", kIdentity, "'" ), + new Transform( "", kIdentity, " from " ), + new Transform( "", kIdentity, " by " ), + new Transform( "", kOmitFirst5, "" ), + new Transform( "", kOmitFirst6, "" ), + new Transform( " the ", kIdentity, "" ), + new Transform( "", kOmitLast4, "" ), + new Transform( "", kIdentity, ". The " ), + new Transform( "", kUppercaseAll, "" ), + new Transform( "", kIdentity, " on " ), + new Transform( "", kIdentity, " as " ), + new Transform( "", kIdentity, " is " ), + new Transform( "", kOmitLast7, "" ), + new Transform( "", kOmitLast1, "ing " ), + new Transform( "", kIdentity, "\n\t" ), + new Transform( "", kIdentity, ":" ), + new Transform( " ", kIdentity, ". " ), + new Transform( "", kIdentity, "ed " ), + new Transform( "", kOmitFirst9, "" ), + new Transform( "", kOmitFirst7, "" ), + new Transform( "", kOmitLast6, "" ), + new Transform( "", kIdentity, "(" ), + new Transform( "", kUppercaseFirst, ", " ), + new Transform( "", kOmitLast8, "" ), + new Transform( "", kIdentity, " at " ), + new Transform( "", kIdentity, "ly " ), + new Transform( " the ", kIdentity, " of " ), + new Transform( "", kOmitLast5, "" ), + new Transform( "", kOmitLast9, "" ), + new Transform( " ", kUppercaseFirst, ", " ), + new Transform( "", kUppercaseFirst, "\"" ), + new Transform( ".", kIdentity, "(" ), + new Transform( "", kUppercaseAll, " " ), + new Transform( "", kUppercaseFirst, "\">" ), + new Transform( "", kIdentity, "=\"" ), + new Transform( " ", kIdentity, "." ), + new Transform( ".com/", kIdentity, "" ), + new Transform( " the ", kIdentity, " of the " ), + new Transform( "", kUppercaseFirst, "'" ), + new Transform( "", kIdentity, ". This " ), + new Transform( "", kIdentity, "," ), + new Transform( ".", kIdentity, " " ), + new Transform( "", kUppercaseFirst, "(" ), + new Transform( "", kUppercaseFirst, "." ), + new Transform( "", kIdentity, " not " ), + new Transform( " ", kIdentity, "=\"" ), + new Transform( "", kIdentity, "er " ), + new Transform( " ", kUppercaseAll, " " ), + new Transform( "", kIdentity, "al " ), + new Transform( " ", kUppercaseAll, "" ), + new Transform( "", kIdentity, "='" ), + new Transform( "", kUppercaseAll, "\"" ), + new Transform( "", kUppercaseFirst, ". " ), + new Transform( " ", kIdentity, "(" ), + new Transform( "", kIdentity, "ful " ), + new Transform( " ", kUppercaseFirst, ". " ), + new Transform( "", kIdentity, "ive " ), + new Transform( "", kIdentity, "less " ), + new Transform( "", kUppercaseAll, "'" ), + new Transform( "", kIdentity, "est " ), + new Transform( " ", kUppercaseFirst, "." ), + new Transform( "", kUppercaseAll, "\">" ), + new Transform( " ", kIdentity, "='" ), + new Transform( "", kUppercaseFirst, "," ), + new Transform( "", kIdentity, "ize " ), + new Transform( "", kUppercaseAll, "." ), + new Transform( "\xc2\xa0", kIdentity, "" ), + new Transform( " ", kIdentity, "," ), + new Transform( "", kUppercaseFirst, "=\"" ), + new Transform( "", kUppercaseAll, "=\"" ), + new Transform( "", kIdentity, "ous " ), + new Transform( "", kUppercaseAll, ", " ), + new Transform( "", kUppercaseFirst, "='" ), + new Transform( " ", kUppercaseFirst, "," ), + new Transform( " ", kUppercaseAll, "=\"" ), + new Transform( " ", kUppercaseAll, ", " ), + new Transform( "", kUppercaseAll, "," ), + new Transform( "", kUppercaseAll, "(" ), + new Transform( "", kUppercaseAll, ". " ), + new Transform( " ", kUppercaseAll, "." ), + new Transform( "", kUppercaseAll, "='" ), + new Transform( " ", kUppercaseAll, ". " ), + new Transform( " ", kUppercaseFirst, "=\"" ), + new Transform( " ", kUppercaseAll, "='" ), + new Transform( " ", kUppercaseFirst, "='" ) +]; + +exports.kTransforms = kTransforms; +exports.kNumTransforms = kTransforms.length; + +function ToUpperCase(p, i) { + if (p[i] < 0xc0) { + if (p[i] >= 97 && p[i] <= 122) { + p[i] ^= 32; + } + return 1; + } + + /* An overly simplified uppercasing model for utf-8. */ + if (p[i] < 0xe0) { + p[i + 1] ^= 32; + return 2; + } + + /* An arbitrary transform for three byte characters. */ + p[i + 2] ^= 5; + return 3; +} + +exports.transformDictionaryWord = function(dst, idx, word, len, transform) { + var prefix = kTransforms[transform].prefix; + var suffix = kTransforms[transform].suffix; + var t = kTransforms[transform].transform; + var skip = t < kOmitFirst1 ? 0 : t - (kOmitFirst1 - 1); + var i = 0; + var start_idx = idx; + var uppercase; + + if (skip > len) { + skip = len; + } + + var prefix_pos = 0; + while (prefix_pos < prefix.length) { + dst[idx++] = prefix[prefix_pos++]; + } + + word += skip; + len -= skip; + + if (t <= kOmitLast9) { + len -= t; + } + + for (i = 0; i < len; i++) { + dst[idx++] = BrotliDictionary.dictionary[word + i]; + } + + uppercase = idx - len; + + if (t === kUppercaseFirst) { + ToUpperCase(dst, uppercase); + } else if (t === kUppercaseAll) { + while (len > 0) { + var step = ToUpperCase(dst, uppercase); + uppercase += step; + len -= step; + } + } + + var suffix_pos = 0; + while (suffix_pos < suffix.length) { + dst[idx++] = suffix[suffix_pos++]; + } + + return idx - start_idx; +} + +},{"./dictionary":6}],12:[function(require,module,exports){ +module.exports = require('./dec/decode').BrotliDecompressBuffer; + +},{"./dec/decode":3}]},{},[12])(12) +}); /* eslint-enable */ @@ -7234,46 +5968,6 @@ module.exports.remove = removeAccents; -/***/ }), - -/***/ 8477: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} -function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; - - -/***/ }), - -/***/ 422: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(8477); -} else {} - - -/***/ }), - -/***/ 1609: -/***/ ((module) => { - -"use strict"; -module.exports = window["React"]; - /***/ }) /******/ }); @@ -7375,7 +6069,7 @@ /******/ /************************************************************************/ var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG @@ -7388,6 +6082,7 @@ PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem), PluginTemplateSettingPanel: () => (/* reexport */ plugin_template_setting_panel), initializeEditor: () => (/* binding */ initializeEditor), + initializePostsDashboard: () => (/* reexport */ initializePostsDashboard), reinitializeEditor: () => (/* binding */ reinitializeEditor), store: () => (/* reexport */ store) }); @@ -7426,8 +6121,9 @@ var private_actions_namespaceObject = {}; __webpack_require__.r(private_actions_namespaceObject); __webpack_require__.d(private_actions_namespaceObject, { - setCanvasMode: () => (setCanvasMode), - setEditorCanvasContainerView: () => (setEditorCanvasContainerView) + registerRoute: () => (registerRoute), + setEditorCanvasContainerView: () => (setEditorCanvasContainerView), + unregisterRoute: () => (unregisterRoute) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js @@ -7461,195 +6157,60 @@ var private_selectors_namespaceObject = {}; __webpack_require__.r(private_selectors_namespaceObject); __webpack_require__.d(private_selectors_namespaceObject, { - getCanvasMode: () => (getCanvasMode), - getEditorCanvasContainerView: () => (getEditorCanvasContainerView) -}); - -;// CONCATENATED MODULE: external ["wp","blocks"] + getEditorCanvasContainerView: () => (getEditorCanvasContainerView), + getRoutes: () => (getRoutes) +}); + +;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; -;// CONCATENATED MODULE: external ["wp","blockLibrary"] +;// external ["wp","blockLibrary"] const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; -;// CONCATENATED MODULE: external ["wp","data"] +;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; -;// CONCATENATED MODULE: external ["wp","deprecated"] +;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); -;// CONCATENATED MODULE: external ["wp","element"] +;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; -;// CONCATENATED MODULE: external ["wp","editor"] +;// external ["wp","editor"] const external_wp_editor_namespaceObject = window["wp"]["editor"]; -;// CONCATENATED MODULE: external ["wp","preferences"] +;// external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; -;// CONCATENATED MODULE: external ["wp","widgets"] +;// external ["wp","widgets"] const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; -;// CONCATENATED MODULE: external ["wp","hooks"] +;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; -;// CONCATENATED MODULE: external ["wp","compose"] +;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; -;// CONCATENATED MODULE: external ["wp","blockEditor"] +;// external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; -;// CONCATENATED MODULE: external ["wp","components"] +;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; -;// CONCATENATED MODULE: external ["wp","i18n"] +;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; -;// CONCATENATED MODULE: external ["wp","notices"] +;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; -;// CONCATENATED MODULE: external ["wp","coreData"] +;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; -;// CONCATENATED MODULE: ./node_modules/colord/index.mjs +;// ./node_modules/colord/index.mjs var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,colord_p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||colord_p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof colord_j?r:new colord_j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(colord_j,y),S.push(r))})},E=function(){return new colord_j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; -;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs +;// ./node_modules/colord/plugins/a11y.mjs var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/clone-deep.js -/** - * Makes a copy of an object without storing any references to the original object. - * @param {Object} object - * @return {Object} The cloned object. - */ -function cloneDeep(object) { - return !object ? {} : JSON.parse(JSON.stringify(object)); -} - -;// CONCATENATED MODULE: external ["wp","privateApis"] +;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/lock-unlock.js +;// ./node_modules/@wordpress/edit-site/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, - unlock: lock_unlock_unlock + unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site'); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - -const { - GlobalStylesContext -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - mergeBaseAndUserConfigs -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); - -/** - * Removes all instances of a property from an object. - * - * @param {Object} object The object to remove the property from. - * @param {string} property The property to remove. - * @return {Object} The modified object. - */ -function removePropertyFromObject(object, property) { - if (!property || typeof property !== 'string') { - return object; - } - if (typeof object !== 'object' || !object || !Object.keys(object).length) { - return object; - } - for (const key in object) { - if (key === property) { - delete object[key]; - } else if (typeof object[key] === 'object') { - removePropertyFromObject(object[key], property); - } - } - return object; -} - -/** - * Fetches the current theme style variations that contain only the specified property - * and merges them with the user config. - * - * @param {Object} props Object of hook args. - * @param {string} props.property The property to filter by. - * @return {Object[]|*} The merged object. - */ -function useCurrentMergeThemeStyleVariationsWithUserConfig({ - property -}) { - const { - variationsFromTheme - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const _variationsFromTheme = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); - return { - variationsFromTheme: _variationsFromTheme || [] - }; - }, []); - const { - user: userVariation - } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - const clonedUserVariation = cloneDeep(userVariation); - - // Get user variation and remove the settings for the given property. - const userVariationWithoutProperty = removePropertyFromObject(clonedUserVariation, property); - userVariationWithoutProperty.title = (0,external_wp_i18n_namespaceObject.__)('Default'); - const variationsWithSinglePropertyAndBase = variationsFromTheme.filter(variation => { - return isVariationWithSingleProperty(variation, property); - }).map(variation => { - return mergeBaseAndUserConfigs(userVariationWithoutProperty, variation); - }); - return [userVariationWithoutProperty, ...variationsWithSinglePropertyAndBase]; - }, [property, userVariation, variationsFromTheme]); -} - -/** - * Returns a new object, with properties specified in `property`, - * maintain the original object tree structure. - * The function is recursive, so it will perform a deep search for the given property. - * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`. - * - * @param {Object} object The object to filter - * @param {Object} property The property to filter by - * @return {Object} The merged object. - */ -const filterObjectByProperty = (object, property) => { - if (!object) { - return {}; - } - const newObject = {}; - Object.keys(object).forEach(key => { - if (key === property) { - newObject[key] = object[key]; - } else if (typeof object[key] === 'object') { - const newFilter = filterObjectByProperty(object[key], property); - if (Object.keys(newFilter).length) { - newObject[key] = newFilter; - } - } - }); - return newObject; -}; - -/** - * Compares a style variation to the same variation filtered by a single property. - * Returns true if the variation contains only the property specified. - * - * @param {Object} variation The variation to compare. - * @param {string} property The property to compare. - * @return {boolean} Whether the variation contains only a single property. - */ -function isVariationWithSingleProperty(variation, property) { - const variationWithProperty = filterObjectByProperty(cloneDeep(variation), property); - return JSON.stringify(variationWithProperty?.styles) === JSON.stringify(variation?.styles) && JSON.stringify(variationWithProperty?.settings) === JSON.stringify(variation?.settings); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js /** * External dependencies */ @@ -7662,17 +6223,15 @@ - -/** - * Internal dependencies - */ - +/** + * Internal dependencies + */ const { useGlobalSetting, useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Enable colord's a11y plugin. k([a11y]); @@ -7728,49 +6287,13 @@ supportedPanels } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { - supportedPanels: lock_unlock_unlock(select(external_wp_blocks_namespaceObject.store)).getSupportedStyles(name, element) + supportedPanels: unlock(select(external_wp_blocks_namespaceObject.store)).getSupportedStyles(name, element) }; }, [name, element]); return supportedPanels; } -function useColorVariations() { - const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig({ - property: 'color' - }); - /* - * Filter out variations with no settings or styles. - */ - return colorVariations?.length ? colorVariations.filter(variation => { - const { - settings, - styles, - title - } = variation; - return title === (0,external_wp_i18n_namespaceObject.__)('Default') || - // Always preseve the default variation. - Object.keys(settings).length > 0 || Object.keys(styles).length > 0; - }) : []; -} -function useTypographyVariations() { - const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig({ - property: 'typography' - }); - /* - * Filter out variations with no settings or styles. - */ - return typographyVariations?.length ? typographyVariations.filter(variation => { - const { - settings, - styles, - title - } = variation; - return title === (0,external_wp_i18n_namespaceObject.__)('Default') || - // Always preseve the default variation. - Object.keys(settings).length > 0 || Object.keys(styles).length > 0; - }) : []; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/set-nested-value.js + +;// ./node_modules/@wordpress/edit-site/build-module/utils/set-nested-value.js /** * Sets the value at path of object. * If a portion of path doesn’t exist, it’s created. @@ -7809,37 +6332,35 @@ return object; } -;// CONCATENATED MODULE: external "ReactJSXRuntime" +;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/push-changes-to-global-styles/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - - -/** - * Internal dependencies - */ - - - +;// ./node_modules/@wordpress/edit-site/build-module/hooks/push-changes-to-global-styles/index.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + + + + +/** + * Internal dependencies + */ const { cleanEmptyObject, - GlobalStylesContext: push_changes_to_global_styles_GlobalStylesContext -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); + GlobalStylesContext +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Block Gap is a special case and isn't defined within the blocks // style properties config. We'll add it here to allow it to be pushed @@ -8042,7 +6563,7 @@ const { user: userConfig, setUserConfig - } = (0,external_wp_element_namespaceObject.useContext)(push_changes_to_global_styles_GlobalStylesContext); + } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const changes = useChangesToPush(name, attributes, userConfig); const { __unstableMarkNextChangeAsNotPersistent @@ -8058,8 +6579,8 @@ const { style: blockStyles } = attributes; - const newBlockStyles = cloneDeep(blockStyles); - const newUserConfig = cloneDeep(userConfig); + const newBlockStyles = structuredClone(blockStyles); + const newUserConfig = structuredClone(userConfig); for (const { path, value @@ -8104,6 +6625,7 @@ } }, [__unstableMarkNextChangeAsNotPersistent, attributes, changes, createSuccessNotice, name, setAttributes, setUserConfig, userConfig]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { + __nextHasNoMarginBottom: true, className: "edit-site-push-changes-to-global-styles-control", help: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the block e.g. 'Heading'. @@ -8113,7 +6635,7 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, disabled: changes.length === 0, onClick: pushChanges, children: (0,external_wp_i18n_namespaceObject.__)('Apply globally') @@ -8137,19 +6659,19 @@ const withPushChangesToGlobalStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props - }), props.isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PushChangesToGlobalStyles, { + }, "edit"), props.isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PushChangesToGlobalStyles, { ...props })] })); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-site/push-changes-to-global-styles', withPushChangesToGlobalStyles); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/index.js -/** - * Internal dependencies - */ - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/reducer.js +;// ./node_modules/@wordpress/edit-site/build-module/hooks/index.js +/** + * Internal dependencies + */ + + +;// ./node_modules/@wordpress/edit-site/build-module/store/reducer.js /** * WordPress dependencies */ @@ -8210,22 +6732,6 @@ switch (action.type) { case 'SET_IS_SAVE_VIEW_OPENED': return action.isOpen; - case 'SET_CANVAS_MODE': - return false; - } - return state; -} - -/** - * Reducer used to track the site editor canvas mode (edit or view). - * - * @param {Object} state Current state. - * @param {Object} action Dispatched action. - */ -function canvasMode(state = 'init', action) { - switch (action.type) { - case 'SET_CANVAS_MODE': - return action.mode; } return state; } @@ -8245,17 +6751,26 @@ } return state; } +function routes(state = [], action) { + switch (action.type) { + case 'REGISTER_ROUTE': + return [...state, action.route]; + case 'UNREGISTER_ROUTE': + return state.filter(route => route.name !== action.name); + } + return state; +} /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ settings, editedPost, saveViewPanel, - canvasMode, - editorCanvasContainerView + editorCanvasContainerView, + routes })); -;// CONCATENATED MODULE: external ["wp","patterns"] +;// external ["wp","patterns"] const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/constants.js +;// ./node_modules/@wordpress/edit-site/build-module/utils/constants.js /** * WordPress dependencies */ @@ -8288,7 +6803,7 @@ PATTERN_USER_CATEGORY, EXCLUDED_PATTERN_SOURCES, PATTERN_SYNC_TYPES -} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); +} = unlock(external_wp_patterns_namespaceObject.privateApis); // Entities that are editable in focus mode. const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user]; @@ -8308,7 +6823,7 @@ const OPERATOR_IS_ANY = 'isAny'; const OPERATOR_IS_NONE = 'isNone'; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/actions.js +;// ./node_modules/@wordpress/edit-site/build-module/store/actions.js /** * WordPress dependencies */ @@ -8326,7 +6841,7 @@ const { interfaceStore -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); /** * Dispatches an action that toggles a feature flag. @@ -8422,17 +6937,21 @@ const removeTemplate = template => ({ registry }) => { - return lock_unlock_unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).removeTemplates([template]); + return unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).removeTemplates([template]); }; /** * Action that sets a template part. * + * @deprecated * @param {string} templatePartId The template part ID. * * @return {Object} Action object. */ function setTemplatePart(templatePartId) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setTemplatePart", { + since: '6.8' + }); return { type: 'SET_EDITED_POST', postType: TEMPLATE_PART_POST_TYPE, @@ -8443,11 +6962,15 @@ /** * Action that sets a navigation menu. * + * @deprecated * @param {string} navigationMenuId The Navigation Menu Post ID. * * @return {Object} Action object. */ function setNavigationMenu(navigationMenuId) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setNavigationMenu", { + since: '6.8' + }); return { type: 'SET_EDITED_POST', postType: NAVIGATION_POST_TYPE, @@ -8458,6 +6981,7 @@ /** * Action that sets an edited entity. * + * @deprecated * @param {string} postType The entity's post type. * @param {string} postId The entity's ID. * @param {Object} context The entity's context. @@ -8489,11 +7013,15 @@ /** * Set's the current block editor context. * + * @deprecated * @param {Object} context The context object. * * @return {Object} Action object. */ function setEditedPostContext(context) { + external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setEditedPostContext", { + since: '6.8' + }); return { type: 'SET_EDITED_POST_CONTEXT', context @@ -8638,7 +7166,7 @@ const revertTemplate = (template, options) => ({ registry }) => { - return lock_unlock_unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).revertTemplate(template, options); + return unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).revertTemplate(template, options); }; /** @@ -8718,66 +7246,7 @@ registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); }; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js -/** - * WordPress dependencies - */ - - - - -/** - * Action that switches the canvas mode. - * - * @param {?string} mode Canvas mode. - */ -const setCanvasMode = mode => ({ - registry, - dispatch -}) => { - const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; - const switchCanvasMode = () => { - registry.batch(() => { - registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock(); - registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType('Desktop'); - registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableSetEditorMode('edit'); - const isPublishSidebarOpened = registry.select(external_wp_editor_namespaceObject.store).isPublishSidebarOpened(); - dispatch({ - type: 'SET_CANVAS_MODE', - mode - }); - const isEditMode = mode === 'edit'; - if (isPublishSidebarOpened && !isEditMode) { - registry.dispatch(external_wp_editor_namespaceObject.store).closePublishSidebar(); - } - - // Check if the block list view should be open by default. - // If `distractionFree` mode is enabled, the block list view should not be open. - // This behavior is disabled for small viewports. - if (isMediumOrBigger && isEditMode && registry.select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { - registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); - } else { - registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(false); - } - registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(false); - }); - }; - - /* - * Skip transition in mobile, otherwise it crashes the browser. - * See: https://github.com/WordPress/gutenberg/pull/63002. - */ - if (!isMediumOrBigger || !document.startViewTransition) { - switchCanvasMode(); - } else { - document.documentElement.classList.add(`canvas-mode-${mode}-transition`); - const transition = document.startViewTransition(() => switchCanvasMode()); - transition.finished.finally(() => { - document.documentElement.classList.remove(`canvas-mode-${mode}-transition`); - }); - } -}; - +;// ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js /** * Action that switches the editor canvas container view. * @@ -8791,21 +7260,94 @@ view }); }; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ +function registerRoute(route) { + return { + type: 'REGISTER_ROUTE', + route + }; +} +function unregisterRoute(name) { + return { + type: 'UNREGISTER_ROUTE', + name + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/utils/get-filtered-template-parts.js +/** + * WordPress dependencies + */ + +const EMPTY_ARRAY = []; + +/** + * Get a flattened and filtered list of template parts and the matching block for that template part. + * + * Takes a list of blocks defined within a template, and a list of template parts, and returns a + * flattened list of template parts and the matching block for that template part. + * + * @param {Array} blocks Blocks to flatten. + * @param {?Array} templateParts Available template parts. + * @return {Array} An array of template parts and their blocks. + */ +function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) { + const templatePartsById = templateParts ? + // Key template parts by their ID. + templateParts.reduce((newTemplateParts, part) => ({ + ...newTemplateParts, + [part.id]: part + }), {}) : {}; + const result = []; + + // Iterate over all blocks, recursing into inner blocks. + // Output will be based on a depth-first traversal. + const stack = [...blocks]; + while (stack.length) { + const { + innerBlocks, + ...block + } = stack.shift(); + // Place inner blocks at the beginning of the stack to preserve order. + stack.unshift(...innerBlocks); + if ((0,external_wp_blocks_namespaceObject.isTemplatePart)(block)) { + const { + attributes: { + theme, + slug + } + } = block; + const templatePartId = `${theme}//${slug}`; + const templatePart = templatePartsById[templatePartId]; + + // Only add to output if the found template part block is in the list of available template parts. + if (templatePart) { + result.push({ + templatePart, + block + }); + } + } + } + return result; +} + +;// ./node_modules/@wordpress/edit-site/build-module/store/selectors.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + /** @@ -8854,7 +7396,13 @@ * * @return {Object} Whether the current user can create media or not. */ -const getCanUserCreateMedia = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => select(external_wp_coreData_namespaceObject.store).canUser('create', 'media')); +const getCanUserCreateMedia = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { + external_wp_deprecated_default()(`wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()`, { + since: '6.7', + alternative: `wp.data.select( 'core' ).canUser( 'create', { kind: 'root', type: 'media' } )` + }); + return select(external_wp_coreData_namespaceObject.store).canUser('create', 'media'); +}); /** * Returns any available Reusable blocks. @@ -8864,9 +7412,10 @@ * @return {Array} The available reusable blocks. */ const getReusableBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { - external_wp_deprecated_default()("select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )", { + external_wp_deprecated_default()(`select( 'core/edit-site' ).getReusableBlocks()`, { since: '6.5', - version: '6.8' + version: '6.8', + alternative: `select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )` }); const isWeb = external_wp_element_namespaceObject.Platform.OS === 'web'; return isWeb ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block', { @@ -8901,22 +7450,32 @@ /** * Returns the current edited post type (wp_template or wp_template_part). * + * @deprecated * @param {Object} state Global application state. * * @return {?TemplateType} Template type. */ function getEditedPostType(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostType", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostType" + }); return state.editedPost.postType; } /** * Returns the ID of the currently edited template or template part. * + * @deprecated * @param {Object} state Global application state. * * @return {?string} Post ID. */ function getEditedPostId(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostId", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostId" + }); return state.editedPost.id; } @@ -8929,6 +7488,9 @@ * @return {Object} Page. */ function getEditedPostContext(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getEditedPostContext", { + since: '6.8' + }); return state.editedPost.context; } @@ -8941,6 +7503,9 @@ * @return {Object} Page. */ function getPage(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).getPage", { + since: '6.8' + }); return { context: state.editedPost.context }; @@ -8977,7 +7542,7 @@ since: '6.5', version: '6.7' }); - return lock_unlock_unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); + return unlock(select(external_wp_editor_namespaceObject.store)).getInserter(); }); /** @@ -9005,16 +7570,34 @@ function isSaveViewOpened(state) { return state.saveViewPanel; } +function getBlocksAndTemplateParts(select) { + const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 + }); + const { + getBlocksByName, + getBlocksByClientId + } = select(external_wp_blockEditor_namespaceObject.store); + const clientIds = getBlocksByName('core/template-part'); + const blocks = getBlocksByClientId(clientIds); + return [blocks, templateParts]; +} /** * Returns the template parts and their blocks for the current edited template. * + * @deprecated * @param {Object} state Global application state. * @return {Array} Template parts and their blocks in an array. */ -const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { - return lock_unlock_unlock(select(external_wp_editor_namespaceObject.store)).getCurrentTemplateTemplateParts(); -}); +const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(() => { + external_wp_deprecated_default()(`select( 'core/edit-site' ).getCurrentTemplateTemplateParts()`, { + since: '6.7', + version: '6.9', + alternative: `select( 'core/block-editor' ).getBlocksByName( 'core/template-part' )` + }); + return getFilteredTemplatePartBlocks(...getBlocksAndTemplateParts(select)); +}, () => getBlocksAndTemplateParts(select))); /** * Returns the current editing mode. @@ -9061,12 +7644,16 @@ * Whether or not the editor has a page loaded into it. * * @see setPage - * + * @deprecated * @param {Object} state Global application state. * * @return {boolean} Whether or not the editor has a page loaded into it. */ function isPage(state) { + external_wp_deprecated_default()("select( 'core/edit-site' ).isPage", { + since: '6.8', + alternative: "select( 'core/editor' ).getCurrentPostType" + }); return !!state.editedPost.context?.postId; } @@ -9084,18 +7671,7 @@ return false; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js -/** - * Returns the current canvas mode. - * - * @param {Object} state Global application state. - * - * @return {string} Canvas mode. - */ -function getCanvasMode(state) { - return state.canvasMode; -} - +;// ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js /** * Returns the editor canvas container view. * @@ -9106,8 +7682,11 @@ function getEditorCanvasContainerView(state) { return state.editorCanvasContainerView; } - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/constants.js +function getRoutes(state) { + return state.routes; +} + +;// ./node_modules/@wordpress/edit-site/build-module/store/constants.js /** * The identifier for the data store. * @@ -9115,7 +7694,7 @@ */ const STORE_NAME = 'core/edit-site'; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/index.js +;// ./node_modules/@wordpress/edit-site/build-module/store/index.js /** * WordPress dependencies */ @@ -9138,302 +7717,24 @@ }; const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, storeConfig); (0,external_wp_data_namespaceObject.register)(store); -lock_unlock_unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); -lock_unlock_unlock(store).registerPrivateActions(private_actions_namespaceObject); - -;// CONCATENATED MODULE: external ["wp","plugins"] -const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; -;// CONCATENATED MODULE: external ["wp","router"] +unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); +unlock(store).registerPrivateActions(private_actions_namespaceObject); + +;// external ["wp","router"] const external_wp_router_namespaceObject = window["wp"]["router"]; -;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs +;// ./node_modules/clsx/dist/clsx.mjs function clsx_r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t { - const { - getSite, - getUnstableBase, - getEntityRecords - } = select(external_wp_coreData_namespaceObject.store); - const siteData = getSite(); - const base = getUnstableBase(); - const templates = getEntityRecords('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - }); - const _homepageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) && !!+siteData.page_on_front // We also need to check if it's not zero(`0`). - ? siteData.page_on_front.toString() : null; - const _postsPageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_for_posts) ? siteData.page_for_posts.toString() : null; - let _frontPageTemplateId; - if (templates) { - const frontPageTemplate = templates.find(t => t.slug === 'front-page'); - _frontPageTemplateId = frontPageTemplate ? frontPageTemplate.id : false; - } - return { - hasLoadedAllDependencies: !!base && !!siteData, - homepageId: _homepageId, - postsPageId: _postsPageId, - url: base?.home, - frontPageTemplateId: _frontPageTemplateId - }; - }, []); - - /** - * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId - * in order to match the frontend as closely as possible in the site editor. - * - * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution. - */ - const resolvedTemplateId = (0,external_wp_data_namespaceObject.useSelect)(select => { - // If we're rendering a post type that doesn't have a template - // no need to resolve its template. - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return undefined; - } - const { - getEditedEntityRecord, - getEntityRecords, - getDefaultTemplateId, - __experimentalGetTemplateForLink - } = select(external_wp_coreData_namespaceObject.store); - function resolveTemplateForPostTypeAndId(postTypeToResolve, postIdToResolve) { - // For the front page, we always use the front page template if existing. - if (postTypeToResolve === 'page' && homepageId === postIdToResolve) { - // We're still checking whether the front page template exists. - // Don't resolve the template yet. - if (frontPageTemplateId === undefined) { - return undefined; - } - if (!!frontPageTemplateId) { - return frontPageTemplateId; - } - } - const editedEntity = getEditedEntityRecord('postType', postTypeToResolve, postIdToResolve); - if (!editedEntity) { - return undefined; - } - // Check if the current page is the posts page. - if (postTypeToResolve === 'page' && postsPageId === postIdToResolve) { - return __experimentalGetTemplateForLink(editedEntity.link)?.id; - } - // First see if the post/page has an assigned template and fetch it. - const currentTemplateSlug = editedEntity.template; - if (currentTemplateSlug) { - const currentTemplate = getEntityRecords('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - })?.find(({ - slug - }) => slug === currentTemplateSlug); - if (currentTemplate) { - return currentTemplate.id; - } - } - // If no template is assigned, use the default template. - let slugToCheck; - // In `draft` status we might not have a slug available, so we use the `single` - // post type templates slug(ex page, single-post, single-product etc..). - // Pages do not need the `single` prefix in the slug to be prioritized - // through template hierarchy. - if (editedEntity.slug) { - slugToCheck = postTypeToResolve === 'page' ? `${postTypeToResolve}-${editedEntity.slug}` : `single-${postTypeToResolve}-${editedEntity.slug}`; - } else { - slugToCheck = postTypeToResolve === 'page' ? 'page' : `single-${postTypeToResolve}`; - } - return getDefaultTemplateId({ - slug: slugToCheck - }); - } - if (!hasLoadedAllDependencies) { - return undefined; - } - - // If we're rendering a specific page, we need to resolve its template. - // The site editor only supports pages for now, not other CPTs. - if (postType && postId && authorizedPostTypes.includes(postType)) { - return resolveTemplateForPostTypeAndId(postType, postId); - } - - // If we're rendering the home page, and we have a static home page, resolve its template. - if (homepageId) { - return resolveTemplateForPostTypeAndId('page', homepageId); - } - - // If we're not rendering a specific page, use the front page template. - if (url) { - const template = __experimentalGetTemplateForLink(url); - return template?.id; - } - }, [homepageId, postsPageId, hasLoadedAllDependencies, url, postId, postType, frontPageTemplateId]); - const context = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return {}; - } - if (postType && postId && authorizedPostTypes.includes(postType)) { - return { - postType, - postId - }; - } - if (homepageId) { - return { - postType: 'page', - postId: homepageId - }; - } - return {}; - }, [homepageId, postType, postId]); - if (postTypesWithoutParentTemplate.includes(postType) && postId) { - return { - isReady: true, - postType, - postId, - context - }; - } - if (hasLoadedAllDependencies) { - return { - isReady: resolvedTemplateId !== undefined, - postType: TEMPLATE_POST_TYPE, - postId: resolvedTemplateId, - context - }; - } - return { - isReady: false - }; -} -function useInitEditedEntityFromURL() { - const { - params = {} - } = useLocation(); - const { - postType, - postId, - context, - isReady - } = useResolveEditedEntityAndContext(params); - const { - setEditedEntity - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (isReady) { - setEditedEntity(postType, postId, context); - } - }, [isReady, postType, postId, context, setEditedEntity]); -} - -;// CONCATENATED MODULE: external ["wp","htmlEntities"] +;// external ["wp","plugins"] +const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; +;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; -;// CONCATENATED MODULE: external ["wp","primitives"] +;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js +;// ./node_modules/@wordpress/icons/build-module/library/search.js /** * WordPress dependencies */ @@ -9448,11 +7749,11 @@ }); /* harmony default export */ const library_search = (search); -;// CONCATENATED MODULE: external ["wp","keycodes"] +;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; -;// CONCATENATED MODULE: external ["wp","url"] +;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js +;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js /** * WordPress dependencies */ @@ -9467,7 +7768,7 @@ }); /* harmony default export */ const library_wordpress = (wordpress); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-icon/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/site-icon/index.js /** * External dependencies */ @@ -9519,9 +7820,9 @@ } /* harmony default export */ const site_icon = (SiteIcon); -;// CONCATENATED MODULE: external ["wp","dom"] +;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js /** * External dependencies */ @@ -9569,7 +7870,8 @@ }; } function SidebarContentWrapper({ - children + children, + shouldAnimate }) { const navState = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(); @@ -9582,33 +7884,45 @@ focusSidebarElement(wrapperRef.current, direction, focusSelector); setNavAnimation(direction); }, [navState]); - const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', { + const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', + /* + * Some panes do not have sub-panes and therefore + * should not animate when clicked on. + */ + shouldAnimate ? { 'slide-from-left': navAnimation === 'back', 'slide-from-right': navAnimation === 'forward' - }); + } : {}); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: wrapperRef, className: wrapperCls, children: children }); } -function SidebarContent({ - routeKey, +function SidebarNavigationProvider({ children }) { const [navState] = (0,external_wp_element_namespaceObject.useState)(createNavState); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationContext.Provider, { value: navState, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar__content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContentWrapper, { - children: children - }, routeKey) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js + children: children + }); +} +function SidebarContent({ + routeKey, + shouldAnimate, + children +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar__content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContentWrapper, { + shouldAnimate: shouldAnimate, + children: children + }, routeKey) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js /** * External dependencies */ @@ -9635,12 +7949,12 @@ -const { + + +const { + useLocation, useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); - - - +} = unlock(external_wp_router_namespaceObject.privateApis); const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({ isTransparent }, ref) => { @@ -9651,15 +7965,14 @@ } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings - } = lock_unlock_unlock(select(store)); - const { - getSite, - getUnstableBase // Site index. + } = unlock(select(store)); + const { + getEntityRecord } = select(external_wp_coreData_namespaceObject.store); - const _site = getSite(); - return { - dashboardLink: getSettings().__experimentalDashboardLink || 'index.php', - homeUrl: getUnstableBase()?.home, + const _site = getEntityRecord('root', 'site'); + return { + dashboardLink: getSettings().__experimentalDashboardLink, + homeUrl: getEntityRecord('root', '__unstableBase')?.home, siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title }; }, []); @@ -9676,12 +7989,14 @@ 'has-transparent-background': isTransparent }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, ref: ref, href: dashboardLink, label: (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), className: "edit-site-layout__view-mode-toggle", style: { - transform: 'scale(0.5)', + transform: 'scale(0.5333) translateX(-4px)', + // Offset to position the icon 12px from viewport edge borderRadius: 4 }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, { @@ -9691,18 +8006,23 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub__title", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "link", href: homeUrl, target: "_blank", - label: (0,external_wp_i18n_namespaceObject.__)('View site (opens in a new tab)'), - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle) + children: [(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "span", + children: /* translators: accessibility text */ + (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') + })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 0, expanded: false, className: "edit-site-site-hub__actions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", className: "edit-site-site-hub_toggle-command-center", icon: library_search, onClick: () => openCommandCenter(), @@ -9718,27 +8038,66 @@ const SiteHubMobile = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({ isTransparent }, ref) => { + const { + path + } = useLocation(); const history = useHistory(); const { navigate } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); const { + dashboardLink, homeUrl, - siteTitle + siteTitle, + isBlockTheme, + isClassicThemeWithStyleBookSupport } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getSite, - getUnstableBase // Site index. + getSettings + } = unlock(select(store)); + const { + getEntityRecord, + getCurrentTheme } = select(external_wp_coreData_namespaceObject.store); - const _site = getSite(); - return { - homeUrl: getUnstableBase()?.home, - siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title + const _site = getEntityRecord('root', 'site'); + const currentTheme = getCurrentTheme(); + const settings = getSettings(); + const supportsEditorStyles = currentTheme.theme_supports['editor-styles']; + // This is a temp solution until the has_theme_json value is available for the current theme. + const hasThemeJson = settings.supportsLayout; + return { + dashboardLink: settings.__experimentalDashboardLink, + homeUrl: getEntityRecord('root', '__unstableBase')?.home, + siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title, + isBlockTheme: currentTheme?.is_block_theme, + isClassicThemeWithStyleBookSupport: !currentTheme?.is_block_theme && (supportsEditorStyles || hasThemeJson) }; }, []); const { open: openCommandCenter } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store); + let backPath; + + // If the current path is not the root page, find a page to back to. + if (path !== '/') { + if (isBlockTheme || isClassicThemeWithStyleBookSupport) { + // If the current theme is a block theme or a classic theme that supports StyleBook, + // back to the Design screen. + backPath = '/'; + } else if (path !== '/pattern') { + // If the current theme is a classic theme that does not support StyleBook, + // back to the Patterns page. + backPath = '/pattern'; + } + } + const backButtonProps = { + href: !!backPath ? undefined : dashboardLink, + label: !!backPath ? (0,external_wp_i18n_namespaceObject.__)('Go to Site Editor') : (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), + onClick: !!backPath ? () => { + history.navigate(backPath); + navigate('back'); + } : undefined + }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { @@ -9749,17 +8108,14 @@ 'has-transparent-background': isTransparent }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, ref: ref, - label: (0,external_wp_i18n_namespaceObject.__)('Go to Site Editor'), className: "edit-site-layout__view-mode-toggle", style: { transform: 'scale(0.5)', borderRadius: 4 }, - onClick: () => { - history.push({}); - navigate('back'); - }, + ...backButtonProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, { className: "edit-site-layout__view-mode-toggle-icon" }) @@ -9768,6 +8124,7 @@ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-site-hub__title", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "link", href: homeUrl, target: "_blank", @@ -9779,6 +8136,7 @@ expanded: false, className: "edit-site-site-hub__actions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, className: "edit-site-site-hub_toggle-command-center", icon: library_search, onClick: () => openCommandCenter(), @@ -9791,7 +8149,7 @@ }); })); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/resizable-frame/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/resizable-frame/index.js /** * External dependencies */ @@ -9806,16 +8164,20 @@ -/** - * Internal dependencies - */ - - + + +/** + * Internal dependencies + */ + + + +const { + useLocation: resizable_frame_useLocation, + useHistory: resizable_frame_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); // Removes the inline styles in the drag handles. - - - const HANDLE_STYLES_OVERRIDE = { position: undefined, userSelect: undefined, @@ -9862,10 +8224,18 @@ setIsOversized, isReady, children, - /** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */ + /** The default (unresized) width/height of the frame, based on the space available in the viewport. */ defaultSize, innerContentStyle }) { + const history = resizable_frame_useHistory(); + const { + path, + query + } = resizable_frame_useLocation(); + const { + canvas = 'view' + } = query; const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [frameSize, setFrameSize] = (0,external_wp_element_namespaceObject.useState)(INITIAL_FRAME_SIZE); // The width of the resizable frame when a new resize gesture starts. @@ -9873,10 +8243,6 @@ const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const [shouldShowHandle, setShouldShowHandle] = (0,external_wp_element_namespaceObject.useState)(false); const [resizeRatio, setResizeRatio] = (0,external_wp_element_namespaceObject.useState)(1); - const canvasMode = (0,external_wp_data_namespaceObject.useSelect)(select => lock_unlock_unlock(select(store)).getCanvasMode(), []); - const { - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 @@ -9884,6 +8250,12 @@ const frameRef = (0,external_wp_element_namespaceObject.useRef)(null); const resizableHandleHelpId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help'); const defaultAspectRatio = defaultSize.width / defaultSize.height; + const isBlockTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getCurrentTheme + } = select(external_wp_coreData_namespaceObject.store); + return getCurrentTheme()?.is_block_theme; + }, []); const handleResizeStart = (_event, _direction, ref) => { // Remember the starting width so we don't have to get `ref.offsetWidth` on // every resize event thereafter, which will cause layout thrashing. @@ -9917,13 +8289,17 @@ } setIsOversized(false); const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth; - if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) { + if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) { // Reset the initial aspect ratio if the frame is resized slightly // above the sidebar but not far enough to trigger full screen. setFrameSize(INITIAL_FRAME_SIZE); } else { // Trigger full screen if the frame is resized far enough to the left. - setCanvasMode('edit'); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); } }; @@ -9934,7 +8310,7 @@ } event.preventDefault(); const step = 20 * (event.shiftKey ? 5 : 1); - const delta = step * (event.key === 'ArrowLeft' ? 1 : -1); + const delta = step * (event.key === 'ArrowLeft' ? 1 : -1) * ((0,external_wp_i18n_namespaceObject.isRTL)() ? -1 : 1); const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta), defaultSize.width); setFrameSize({ width: newWidth, @@ -9954,16 +8330,29 @@ const resizeHandleVariants = { hidden: { opacity: 0, - left: 0 + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: 0 + } : { + left: 0 + }) }, visible: { opacity: 1, - left: -14 // Account for the handle's width. + // Account for the handle's width. + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: -14 + } : { + left: -14 + }) }, active: { opacity: 1, - left: -14, // Account for the handle's width. + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: -14 + } : { + left: -14 + }), scaleY: 1.3 } }; @@ -9987,7 +8376,7 @@ }); } }, - whileHover: canvasMode === 'view' ? { + whileHover: canvas === 'view' && isBlockTheme ? { scale: 1.005, transition: { duration: disableMotion ? 0 : 0.5, @@ -9998,10 +8387,15 @@ size: frameSize, enable: { top: false, - right: false, bottom: false, // Resizing will be disabled until the editor content is loaded. - left: isReady, + ...((0,external_wp_i18n_namespaceObject.isRTL)() ? { + right: isReady, + left: false + } : { + left: isReady, + right: false + }), topRight: false, bottomRight: false, bottomLeft: false, @@ -10021,7 +8415,7 @@ onMouseOver: () => setShouldShowHandle(true), onMouseOut: () => setShouldShowHandle(false), handleComponent: { - left: canvasMode === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + [(0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left']: canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.button, { @@ -10067,85 +8461,52 @@ } /* harmony default export */ const resizable_frame = (ResizableFrame); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -const { - useLocation: use_sync_canvas_mode_with_url_useLocation, - useHistory: use_sync_canvas_mode_with_url_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useSyncCanvasModeWithURL() { - const history = use_sync_canvas_mode_with_url_useHistory(); - const { - params - } = use_sync_canvas_mode_with_url_useLocation(); - const canvasMode = (0,external_wp_data_namespaceObject.useSelect)(select => lock_unlock_unlock(select(store)).getCanvasMode(), []); - const { - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const currentCanvasMode = (0,external_wp_element_namespaceObject.useRef)(canvasMode); - const { - canvas: canvasInUrl - } = params; - const currentCanvasInUrl = (0,external_wp_element_namespaceObject.useRef)(canvasInUrl); - const currentUrlParams = (0,external_wp_element_namespaceObject.useRef)(params); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentUrlParams.current = params; - }, [params]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentCanvasMode.current = canvasMode; - if (canvasMode === 'init') { - return; - } - if (canvasMode === 'edit' && currentCanvasInUrl.current !== canvasMode) { - history.push({ - ...currentUrlParams.current, - canvas: 'edit' - }); - } - if (canvasMode === 'view' && currentCanvasInUrl.current !== undefined) { - history.push({ - ...currentUrlParams.current, - canvas: undefined - }); - } - }, [canvasMode, history]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - currentCanvasInUrl.current = canvasInUrl; - if (canvasInUrl !== 'edit' && currentCanvasMode.current !== 'view') { - setCanvasMode('view'); - } else if (canvasInUrl === 'edit' && currentCanvasMode.current !== 'edit') { - setCanvasMode('edit'); - } - }, [canvasInUrl, setCanvasMode]); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/register.js -/** - * WordPress dependencies - */ - - - - -function KeyboardShortcutsRegister() { - // Registering the shortcuts. - const { - registerShortcut +;// external ["wp","keyboardShortcuts"] +const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; +;// ./node_modules/@wordpress/edit-site/build-module/components/save-keyboard-shortcut/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + +const shortcutName = 'core/edit-site/save'; + +/** + * Register the save keyboard shortcut in view mode. + * + * @return {null} Returns null. + */ +function SaveKeyboardShortcut() { + const { + __experimentalGetDirtyEntityRecords, + isSavingEntityRecord + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); + const { + hasNonPostEntityChanges, + isPostSavingLocked + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); + const { + savePost + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const { + setIsSaveViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + registerShortcut, + unregisterShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ - name: 'core/edit-site/save', + name: shortcutName, category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'), keyCombination: { @@ -10153,865 +8514,37 @@ character: 's' } }); - }, [registerShortcut]); - return null; -} -/* harmony default export */ const register = (KeyboardShortcutsRegister); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcuts/global.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function KeyboardShortcutsGlobal() { - const { - __experimentalGetDirtyEntityRecords, - isSavingEntityRecord - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); - const { - hasNonPostEntityChanges - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); - const { - getCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const { - setIsSaveViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(store); + return () => { + unregisterShortcut(shortcutName); + }; + }, [registerShortcut, unregisterShortcut]); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/save', event => { event.preventDefault(); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const hasDirtyEntities = !!dirtyEntityRecords.length; const isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)); - const _hasNonPostEntityChanges = hasNonPostEntityChanges(); - const isViewMode = getCanvasMode() === 'view'; - if ((!hasDirtyEntities || !_hasNonPostEntityChanges || isSaving) && !isViewMode) { + if (!hasDirtyEntities || isSaving) { return; } - // At this point, we know that there are dirty entities, other than - // the edited post, and we're not in the process of saving, so open - // save view. - setIsSaveViewOpened(true); + if (hasNonPostEntityChanges()) { + setIsSaveViewOpened(true); + } else if (!isPostSavingLocked()) { + savePost(); + } }); return null; } -/* harmony default export */ const global = (KeyboardShortcutsGlobal); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/styles.js -/** - * WordPress dependencies - */ - - -const styles = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z" - }) -}); -/* harmony default export */ const library_styles = (styles); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/help.js -/** - * WordPress dependencies - */ - - -const help = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z" - }) -}); -/* harmony default export */ const library_help = (help); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js -/** - * WordPress dependencies - */ - - -const rotateRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" - }) -}); -/* harmony default export */ const rotate_right = (rotateRight); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-left.js -/** - * WordPress dependencies - */ - - -const rotateLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" - }) -}); -/* harmony default export */ const rotate_left = (rotateLeft); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/brush.js -/** - * WordPress dependencies - */ - - -const brush = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" - }) -}); -/* harmony default export */ const library_brush = (brush); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/backup.js -/** - * WordPress dependencies - */ - - -const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" - }) -}); -/* harmony default export */ const library_backup = (backup); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js -/** - * WordPress dependencies - */ - - -const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" - }) -}); -/* harmony default export */ const library_external = (external); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-common-commands.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - -const { - useGlobalStylesReset -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - useHistory: use_common_commands_useHistory, - useLocation: use_common_commands_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useGlobalStylesOpenStylesCommands() { - const { - openGeneralSidebar, - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - params - } = use_common_commands_useLocation(); - const { - getCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const history = use_common_commands_useHistory(); - const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; - }, []); - const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!isBlockBasedTheme) { - return []; - } - return [{ - name: 'core/edit-site/open-styles', - label: (0,external_wp_i18n_namespaceObject.__)('Open styles'), - callback: ({ - close - }) => { - close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' - }); - } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } - openGeneralSidebar('edit-site/global-styles'); - }, - icon: library_styles - }]; - }, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, params.postId]); - return { - isLoading: false, - commands - }; -} -function useGlobalStylesToggleWelcomeGuideCommands() { - const { - openGeneralSidebar, - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - params - } = use_common_commands_useLocation(); - const { - getCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const { - set - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const history = use_common_commands_useHistory(); - const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; - }, []); - const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!isBlockBasedTheme) { - return []; - } - return [{ - name: 'core/edit-site/toggle-styles-welcome-guide', - label: (0,external_wp_i18n_namespaceObject.__)('Learn about styles'), - callback: ({ - close - }) => { - close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' - }); - } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } - openGeneralSidebar('edit-site/global-styles'); - set('core/edit-site', 'welcomeGuideStyles', true); - // sometimes there's a focus loss that happens after some time - // that closes the modal, we need to force reopening it. - setTimeout(() => { - set('core/edit-site', 'welcomeGuideStyles', true); - }, 500); - }, - icon: library_help - }]; - }, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, set, params.postId]); - return { - isLoading: false, - commands - }; -} -function useGlobalStylesResetCommands() { - const [canReset, onReset] = useGlobalStylesReset(); - const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!canReset) { - return []; - } - return [{ - name: 'core/edit-site/reset-global-styles', - label: (0,external_wp_i18n_namespaceObject.__)('Reset styles'), - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left, - callback: ({ - close - }) => { - close(); - onReset(); - } - }]; - }, [canReset, onReset]); - return { - isLoading: false, - commands - }; -} -function useGlobalStylesOpenCssCommands() { - const { - openGeneralSidebar, - setEditorCanvasContainerView, - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - params - } = use_common_commands_useLocation(); - const history = use_common_commands_useHistory(); - const { - canEditCSS - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord, - __experimentalGetCurrentGlobalStylesId - } = select(external_wp_coreData_namespaceObject.store); - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - return { - canEditCSS: !!globalStyles?._links?.['wp:action-edit-css'] - }; - }, []); - const { - getCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!canEditCSS) { - return []; - } - return [{ - name: 'core/edit-site/open-styles-css', - label: (0,external_wp_i18n_namespaceObject.__)('Customize CSS'), - icon: library_brush, - callback: ({ - close - }) => { - close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' - }); - } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } - openGeneralSidebar('edit-site/global-styles'); - setEditorCanvasContainerView('global-styles-css'); - } - }]; - }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, getCanvasMode, setCanvasMode, params.postId]); - return { - isLoading: false, - commands - }; -} -function useGlobalStylesOpenRevisionsCommands() { - const { - openGeneralSidebar, - setEditorCanvasContainerView, - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - getCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(store)); - const { - params - } = use_common_commands_useLocation(); - const history = use_common_commands_useHistory(); - const hasRevisions = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord, - __experimentalGetCurrentGlobalStylesId - } = select(external_wp_coreData_namespaceObject.store); - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - return !!globalStyles?._links?.['version-history']?.[0]?.count; - }, []); - const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!hasRevisions) { - return []; - } - return [{ - name: 'core/edit-site/open-global-styles-revisions', - label: (0,external_wp_i18n_namespaceObject.__)('Style revisions'), - icon: library_backup, - callback: ({ - close - }) => { - close(); - if (!params.postId) { - history.push({ - path: '/wp_global_styles', - canvas: 'edit' - }); - } - if (params.postId && getCanvasMode() !== 'edit') { - setCanvasMode('edit'); - } - openGeneralSidebar('edit-site/global-styles'); - setEditorCanvasContainerView('global-styles-revisions'); - } - }]; - }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, getCanvasMode, setCanvasMode, params.postId]); - return { - isLoading: false, - commands - }; -} -function useCommonCommands() { - const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getUnstableBase // Site index. - } = select(external_wp_coreData_namespaceObject.store); - return getUnstableBase()?.home; - }, []); - (0,external_wp_commands_namespaceObject.useCommand)({ - name: 'core/edit-site/view-site', - label: (0,external_wp_i18n_namespaceObject.__)('View site'), - callback: ({ - close - }) => { - close(); - window.open(homeUrl, '_blank'); - }, - icon: library_external - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/open-styles', - hook: useGlobalStylesOpenStylesCommands - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/toggle-styles-welcome-guide', - hook: useGlobalStylesToggleWelcomeGuideCommands - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/reset-global-styles', - hook: useGlobalStylesResetCommands - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/open-styles-css', - hook: useGlobalStylesOpenCssCommands - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/open-styles-revisions', - hook: useGlobalStylesOpenRevisionsCommands - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js -/** - * WordPress dependencies - */ - - -const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" - }) -}); -/* harmony default export */ const library_layout = (layout); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js -/** - * WordPress dependencies - */ - - - -const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" - })] -}); -/* harmony default export */ const library_page = (page); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/trash.js -/** - * WordPress dependencies - */ - - -const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" - }) -}); -/* harmony default export */ const library_trash = (trash); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/use-edited-entity-record/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -function useEditedEntityRecord(postType, postId) { - const { - record, - title, - description, - isLoaded, - icon - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditedPostType, - getEditedPostId - } = select(store); - const { - getEditedEntityRecord, - hasFinishedResolution - } = select(external_wp_coreData_namespaceObject.store); - const { - __experimentalGetTemplateInfo: getTemplateInfo - } = select(external_wp_editor_namespaceObject.store); - const usedPostType = postType !== null && postType !== void 0 ? postType : getEditedPostType(); - const usedPostId = postId !== null && postId !== void 0 ? postId : getEditedPostId(); - const _record = getEditedEntityRecord('postType', usedPostType, usedPostId); - const _isLoaded = usedPostId && hasFinishedResolution('getEditedEntityRecord', ['postType', usedPostType, usedPostId]); - const templateInfo = getTemplateInfo(_record); - return { - record: _record, - title: templateInfo.title, - description: templateInfo.description, - isLoaded: _isLoaded, - icon: templateInfo.icon - }; - }, [postType, postId]); - return { - isLoaded, - icon, - record, - getTitle: () => title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : null, - getDescription: () => description ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(description) : null - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-removable.js -/** - * Internal dependencies - */ - - -/** - * Check if a template is removable. - * - * @param {Object} template The template entity to check. - * @return {boolean} Whether the template is revertable. - */ -function isTemplateRemovable(template) { - if (!template) { - return false; - } - return template.source === TEMPLATE_ORIGINS.custom && !template.has_theme_file; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-template-revertable.js -/** - * Internal dependencies - */ - - -/** - * Check if a template is revertable to its original theme-provided template file. - * - * @param {Object} template The template entity to check. - * @return {boolean} Whether the template is revertable. - */ -function isTemplateRevertable(template) { - if (!template) { - return false; - } - /* eslint-disable camelcase */ - return template?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file; - /* eslint-enable camelcase */ -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/is-previewing-theme.js -/** - * WordPress dependencies - */ - -function isPreviewingTheme() { - return (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview') !== undefined; -} -function currentlyPreviewingTheme() { - if (isPreviewingTheme()) { - return (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview'); - } - return null; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/link.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -const { - useHistory: link_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useLink(params, state, shouldReplace = false) { - const history = link_useHistory(); - function onClick(event) { - event?.preventDefault(); - if (shouldReplace) { - history.replace(params, state); - } else { - history.push(params, state); - } - } - const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href); - const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs)); - if (isPreviewingTheme()) { - params = { - ...params, - wp_theme_preview: currentlyPreviewingTheme() - }; - } - const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params); - return { - href: newUrl, - onClick - }; -} -function Link({ - params = {}, - state, - replace: shouldReplace = false, - children, - ...props -}) { - const { - href, - onClick - } = useLink(params, state, shouldReplace); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { - href: href, - onClick: onClick, - ...props, - children: children - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-edit-mode-commands.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const { - useHistory: use_edit_mode_commands_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function usePageContentFocusCommands() { - const { - record: template - } = useEditedEntityRecord(); - const { - isPage, - canvasMode, - templateId, - currentPostType - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isPage: _isPage, - getCanvasMode - } = lock_unlock_unlock(select(store)); - const { - getCurrentPostType, - getCurrentTemplateId - } = select(external_wp_editor_namespaceObject.store); - return { - isPage: _isPage(), - canvasMode: getCanvasMode(), - templateId: getCurrentTemplateId(), - currentPostType: getCurrentPostType() - }; - }, []); - const { - onClick: editTemplate - } = useLink({ - postType: 'wp_template', - postId: templateId - }); - const { - setRenderingMode - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - if (!isPage || canvasMode !== 'edit') { - return { - isLoading: false, - commands: [] - }; - } - const commands = []; - if (currentPostType !== 'wp_template') { - commands.push({ - name: 'core/switch-to-template-focus', - label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Edit template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)), - icon: library_layout, - callback: ({ - close - }) => { - editTemplate(); - close(); - } - }); - } else { - commands.push({ - name: 'core/switch-to-page-focus', - label: (0,external_wp_i18n_namespaceObject.__)('Back to page'), - icon: library_page, - callback: ({ - close - }) => { - setRenderingMode('template-locked'); - close(); - } - }); - } - return { - isLoading: false, - commands - }; -} -function useManipulateDocumentCommands() { - const { - isLoaded, - record: template - } = useEditedEntityRecord(); - const { - removeTemplate, - revertTemplate - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const history = use_edit_mode_commands_useHistory(); - const isEditingPage = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isPage() && select(external_wp_editor_namespaceObject.store).getCurrentPostType() !== 'wp_template', []); - if (!isLoaded) { - return { - isLoading: true, - commands: [] - }; - } - const commands = []; - if (isTemplateRevertable(template) && !isEditingPage) { - const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Reset template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title */ - (0,external_wp_i18n_namespaceObject.__)('Reset template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)); - commands.push({ - name: 'core/reset-template', - label, - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left, - callback: ({ - close - }) => { - revertTemplate(template); - close(); - } - }); - } - if (isTemplateRemovable(template) && !isEditingPage) { - const label = template.type === TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template title */ - (0,external_wp_i18n_namespaceObject.__)('Delete template: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: template part title */ - (0,external_wp_i18n_namespaceObject.__)('Delete template part: %s'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title)); - commands.push({ - name: 'core/remove-template', - label, - icon: library_trash, - callback: ({ - close - }) => { - removeTemplate(template); - // Navigate to the template list - history.push({ - postType: template.type - }); - close(); - } - }); - } - return { - isLoading: !isLoaded, - commands - }; -} -function useEditModeCommands() { - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/page-content-focus', - hook: usePageContentFocusCommands, - context: 'entity-edit' - }); - (0,external_wp_commands_namespaceObject.useCommandLoader)({ - name: 'core/edit-site/manipulate-document', - hook: useManipulateDocumentCommands - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/hooks.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ + +;// ./node_modules/@wordpress/edit-site/build-module/components/layout/hooks.js +/** + * WordPress dependencies + */ + + const MAX_LOADING_TIME = 10000; // 10 seconds function useIsSiteEditorLoading() { - const { - isLoaded: hasLoadedPost - } = useEditedEntityRecord(); const [loaded, setLoaded] = (0,external_wp_element_namespaceObject.useState)(false); const inLoadingPause = (0,external_wp_data_namespaceObject.useSelect)(select => { const hasResolvingSelectors = select(external_wp_coreData_namespaceObject.store).hasResolvingSelectors(); @@ -11053,11 +8586,2162 @@ }; } }, [inLoadingPause]); - return !loaded || !hasLoadedPost; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js - + return !loaded; +} + +;// ./node_modules/@react-spring/rafz/dist/esm/index.js +var esm_f=esm_l(),esm_n=e=>esm_c(e,esm_f),esm_m=esm_l();esm_n.write=e=>esm_c(e,esm_m);var esm_d=esm_l();esm_n.onStart=e=>esm_c(e,esm_d);var esm_h=esm_l();esm_n.onFrame=e=>esm_c(e,esm_h);var esm_p=esm_l();esm_n.onFinish=e=>esm_c(e,esm_p);var esm_i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=esm_i.findIndex(z=>z.cancel==o);~F&&esm_i.splice(F,1),esm_u-=~F?1:0},s={time:a,handler:e,cancel:o};return esm_i.splice(esm_w(a),0,s),esm_u+=1,esm_v(),s};var esm_w=e=>~(~esm_i.findIndex(t=>t.time>e)||~esm_i.length);esm_n.cancel=e=>{esm_d.delete(e),esm_h.delete(e),esm_p.delete(e),esm_f.delete(e),esm_m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{esm_d.delete(a),t=null},o};var esm_y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>esm_y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):esm_x()};var esm_r=-1,esm_u=0,T=!1;function esm_c(e,t){T?(t.delete(e),e(0)):(t.add(e),esm_v())}function esm_v(){esm_r<0&&(esm_r=0,esm_n.frameLoop!=="demand"&&esm_y(esm_b))}function esm_R(){esm_r=-1}function esm_b(){~esm_r&&(esm_y(esm_b),esm_n.batchedUpdates(esm_x))}function esm_x(){let e=esm_r;esm_r=esm_n.now();let t=esm_w(esm_r);if(t&&(Q(esm_i.splice(0,t),a=>a.handler()),esm_u-=t),!esm_u){esm_R();return}esm_d.flush(),esm_f.flush(e?Math.min(64,esm_r-e):16.667),esm_h.flush(),esm_m.flush(),esm_p.flush()}function esm_l(){let e=new Set,t=e;return{add(a){esm_u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return esm_u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,esm_u-=t.size,Q(t,o=>o(a)&&e.add(o)),esm_u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var esm_S={count(){return esm_u},isRunning(){return esm_r>=0},clear(){esm_r=-1,esm_i=[],esm_d=esm_l(),esm_f=esm_l(),esm_h=esm_l(),esm_m=esm_l(),esm_p=esm_l(),esm_u=0}}; + +// EXTERNAL MODULE: external "React" +var external_React_ = __webpack_require__(1609); +var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); +;// ./node_modules/@react-spring/shared/dist/esm/index.js +var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var dist_esm_p={};Le(dist_esm_p,{assign:()=>U,colors:()=>dist_esm_c,createStringInterpolator:()=>esm_k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>dist_esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),dist_esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(dist_esm_l.arr(e)){if(!dist_esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function xt(e,t,r){if(dist_esm_l.arr(e)){for(let n=0;ndist_esm_l.und(e)?[]:dist_esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),esm_Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),dist_esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var esm_k,J,dist_esm_c=null,ee=!1,dist_esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(dist_esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(esm_k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(dist_esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var esm_E=new Set,dist_esm_u=[],esm_H=[],A=0,qe={get idle(){return!esm_E.size&&!dist_esm_u.length},start(e){A>e.priority?(esm_E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=dist_esm_u.indexOf(e);~t&&(dist_esm_u.splice(t,1),re(e))}},clear(){dist_esm_u=[],esm_E.clear()}};function $e(){esm_E.forEach(te),esm_E.clear(),esm_n(B)}function te(e){dist_esm_u.includes(e)||re(e)}function re(e){dist_esm_u.splice(Ge(dist_esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=esm_H;for(let r=0;r0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var dist_esm_d="[-+]?\\d*\\.?\\d+",esm_M=dist_esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(dist_esm_d,dist_esm_d,dist_esm_d)),fe=new RegExp("rgba"+C(dist_esm_d,dist_esm_d,dist_esm_d,dist_esm_d)),ae=new RegExp("hsl"+C(dist_esm_d,esm_M,esm_M)),ie=new RegExp("hsla"+C(dist_esm_d,esm_M,esm_M,dist_esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,esm_ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:dist_esm_c&&dist_esm_c[e]!==void 0?dist_esm_c[e]:(t=oe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=esm_ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function dist_esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function esm_pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function esm_z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(dist_esm_l.fun(e))return e;if(dist_esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(dist_esm_l.str(e.output[0]))return esm_k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(ar){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var esm_g=Symbol.for("FluidValue.get"),dist_esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[esm_g]),ve=e=>e&&e[esm_g]?e[esm_g]():e,esm_qt=e=>e[dist_esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[dist_esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[esm_g];[dist_esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,esm_g,t);function Gt(e,t){if(e[esm_g]){let r=e[dist_esm_m];r||Ee(e,dist_esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[dist_esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[dist_esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,dist_esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var esm_N=e=>{let[t,r]=We(e);if(!t||dist_esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&dist_esm_b.test(r))return esm_N(r);if(r)return r}return e},We=e=>{let t=dist_esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,esm_Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=dist_esm_c?new RegExp(`(${Object.keys(dist_esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(dist_esm_b,esm_N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,esm_Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return dist_esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!dist_esm_h()&&dist_esm_b.test(e)||e in(dist_esm_c||{}))}var dist_esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){dist_esm_v||typeof ResizeObserver<"u"&&(dist_esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),dist_esm_v&&dist_esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&dist_esm_v&&dist_esm_v.unobserve(t))}}var esm_$=new Set,dist_esm_w,esm_Xe=()=>{let e=()=>{esm_$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>(esm_$.add(e),dist_esm_w||(dist_esm_w=esm_Xe()),()=>{esm_$.delete(e),!esm_$.size&&dist_esm_w&&(dist_esm_w(),dist_esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var esm_Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=esm_Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=dist_esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=ct();return lt(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e}; + +;// ./node_modules/@react-spring/animated/dist/esm/index.js +var animated_dist_esm_h=Symbol.for("Animated:node"),animated_dist_esm_v=e=>!!e&&e[animated_dist_esm_h]===e,dist_esm_k=e=>e&&e[animated_dist_esm_h],esm_D=(e,t)=>mt(e,animated_dist_esm_h,t),F=e=>e&&e[animated_dist_esm_h]&&e[animated_dist_esm_h].getPayload(),animated_dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var animated_dist_esm_l=class extends animated_dist_esm_c{constructor(r){super();this._value=r;dist_esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new animated_dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return dist_esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,dist_esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var animated_dist_esm_d=class extends animated_dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new animated_dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(dist_esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var dist_esm_f={dependencies:null};var animated_dist_esm_u=class extends animated_dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{animated_dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&esm_Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){dist_esm_f.dependencies&&Pt(r)&&dist_esm_f.dependencies.add(r);let n=F(r);n&&esm_Ve(n,a=>this.add(a))}};var animated_dist_esm_y=class extends animated_dist_esm_u{constructor(t){super(t)}static create(t){return new animated_dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(dist_esm_z)),!0)}};function dist_esm_z(e){return(esm_or(e)?animated_dist_esm_d:animated_dist_esm_l).create(e)}function esm_Le(e){let t=dist_esm_k(e);return t?t.constructor:dist_esm_l.arr(e)?animated_dist_esm_y:esm_or(e)?animated_dist_esm_d:animated_dist_esm_l}var dist_esm_x=(e,t)=>{let r=!dist_esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new animated_dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,esm_Ve(T,s=>Gt(s,_)),()=>{p.current&&(esm_Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;esm_Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},animated_dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return dist_esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new animated_dist_esm_u(e),dist_esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(dist_esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),dist_esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new animated_dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=esm_I(o)||"Anonymous";return dist_esm_l.str(o)?o=i[o]||(i[o]=dist_esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=dist_esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{dist_esm_l.arr(e)&&(m=esm_I(o)),i[m]=i(o)}),{animated:i}},esm_I=e=>dist_esm_l.str(e)?e:e&&dist_esm_l.str(e.displayName)?e.displayName:dist_esm_l.fun(e)&&e.name||null; + +;// ./node_modules/@react-spring/core/dist/esm/index.js +function dist_esm_I(t,...e){return dist_esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(dist_esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>dist_esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);dist_esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),dist_esm_l.arr(t)?t.map(esm_me):esm_or(t)?dist_esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return dist_esm_l.fun(t)||dist_esm_l.arr(t)&&dist_esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+dist_esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return dist_esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!dist_esm_l.und(e.decay))t.duration=void 0;else{let n=!dist_esm_l.und(e.tension)||!dist_esm_l.und(e.friction);(n||!dist_esm_l.und(e.frequency)||!dist_esm_l.und(e.damping)||!dist_esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{dist_esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=dist_esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!dist_esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):dist_esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),dist_esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&dist_esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(dist_esm_p.skipAnimation)throw esm_oe(n),x.result=dist_esm_E(r,!1),d(x),x;b(g);let S=dist_esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{dist_esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(dist_esm_p.skipAnimation)return esm_oe(n),dist_esm_E(r,!1);try{let l;dist_esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=dist_esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return dist_esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=dist_esm_k(this);return e&&e.getValue()}to(...e){return dist_esm_p.to(this,e)}interpolate(...e){return Jt(),dist_esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!dist_esm_l.und(e)||!dist_esm_l.und(n)){let r=dist_esm_l.obj(e)?{...e}:{...n,from:e};dist_esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=dist_esm_k(this);return e instanceof animated_dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==animated_dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=dist_esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(dist_esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!dist_esm_l.und(A),_=l==m?f.v0>0:lS,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=dist_esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return dist_esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[dist_esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=dist_esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=dist_esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),dist_esm_l.und(o)?dist_esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!dist_esm_l.und(e.to),s=!dist_esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||dist_esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,dist_esm_I(n.config,a),n.config!==i.config?dist_esm_I(i.config,a):void 0);let x=dist_esm_k(this);if(!x||dist_esm_l.und(d))return r(dist_esm_E(this,!0));let S=dist_esm_l.und(n.reset)?s&&!n.default:!dist_esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=dist_esm_l.num(V)||dist_esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==animated_dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;esm_Ve(_n,y=>_t(this,n,y));let N=dist_esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?dist_esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!dist_esm_l.und(r)){let o=dist_esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return dist_esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",dist_esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),dist_esm_I(this.animation.onChange,e,this)),dist_esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;dist_esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){dist_esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;esm_Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):dist_esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=dist_esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return dist_esm_l.obj(e)&&Vt(e,r),dist_esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return R.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];dist_esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;esm_Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(dist_esm_l.und(e))this.start({pause:!0});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(dist_esm_l.und(e))this.start({pause:!1});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=dist_esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=dist_esm_l.arr(o)||dist_esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):esm_Ve(Fn,P=>{let l=e[P];if(dist_esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=esm_Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&esm_Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){esm_Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var dist_esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(dist_esm_H,{});dist_esm_H.Provider=esm_Ge.Provider;dist_esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?esm_fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;xesm_e(h,p[g])),b=Mn(dist_esm_H),c=Dt(b),P=b!==c&&esm_Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=Qn.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),dist_esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=dist_esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=dist_esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=dist_esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=dist_esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{dist_esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=dist_esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(dist_esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(dist_esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&esm_ct(this)}_get(){let n=dist_esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,esm_Ve(F(this),n=>{n.done=!1}),dist_esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),esm_ct(this)):qe.start(this))}_attach(){let n=1;esm_Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){esm_Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),esm_ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function esm_ct(t){t.idle||(t.idle=!0,esm_Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));dist_esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance; + +;// external "ReactDOM" +const external_ReactDOM_namespaceObject = window["ReactDOM"]; +;// ./node_modules/@react-spring/web/dist/esm/index.js +var web_dist_esm_k=/^--/;function web_dist_esm_I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!web_dist_esm_k.test(t)&&!(web_dist_esm_c.hasOwnProperty(t)&&web_dist_esm_c[t])?e+"px":(""+e).trim()}var web_dist_esm_v={};function esm_V(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:u,scrollLeft:l,viewBox:a,...n}=e,d=Object.values(n),m=Object.keys(n).map(o=>r||t.hasAttribute(o)?o:web_dist_esm_v[o]||(web_dist_esm_v[o]=o.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));s!==void 0&&(t.textContent=s);for(let o in i)if(i.hasOwnProperty(o)){let p=web_dist_esm_I(o,i[o]);web_dist_esm_k.test(o)?t.style.setProperty(o,p):t.style[o]=p}m.forEach((o,p)=>{t.setAttribute(o,d[p])}),u!==void 0&&(t.scrollTop=u),l!==void 0&&(t.scrollLeft=l),a!==void 0&&t.setAttribute("viewBox",a)}var web_dist_esm_c={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},esm_F=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),esm_L=["Webkit","Ms","Moz","O"];web_dist_esm_c=Object.keys(web_dist_esm_c).reduce((t,e)=>(esm_L.forEach(r=>t[esm_F(r,e)]=t[e]),t),web_dist_esm_c);var esm_=/^(matrix|translate|scale|rotate|skew)/,dist_esm_$=/^(translate)/,dist_esm_G=/^(rotate|skew)/,web_dist_esm_y=(t,e)=>dist_esm_l.num(t)&&t!==0?t+e:t,web_dist_esm_h=(t,e)=>dist_esm_l.arr(t)?t.every(r=>web_dist_esm_h(r,e)):dist_esm_l.num(t)?t===e:parseFloat(t)===e,dist_esm_g=class extends animated_dist_esm_u{constructor({x:e,y:r,z:i,...s}){let u=[],l=[];(e||r||i)&&(u.push([e||0,r||0,i||0]),l.push(a=>[`translate3d(${a.map(n=>web_dist_esm_y(n,"px")).join(",")})`,web_dist_esm_h(a,0)])),xt(s,(a,n)=>{if(n==="transform")u.push([a||""]),l.push(d=>[d,d===""]);else if(esm_.test(n)){if(delete s[n],dist_esm_l.und(a))return;let d=dist_esm_$.test(n)?"px":dist_esm_G.test(n)?"deg":"";u.push(ht(a)),l.push(n==="rotate3d"?([m,o,p,O])=>[`rotate3d(${m},${o},${p},${web_dist_esm_y(O,d)})`,web_dist_esm_h(O,0)]:m=>[`${n}(${m.map(o=>web_dist_esm_y(o,d)).join(",")})`,web_dist_esm_h(m,n.startsWith("scale")?1:0)])}}),u.length&&(s.transform=new web_dist_esm_x(u,l)),super(s)}},web_dist_esm_x=class extends esm_ge{constructor(r,i){super();this.inputs=r;this.transforms=i}_value=null;get(){return this._value||(this._value=this._get())}_get(){let r="",i=!0;return esm_Ve(this.inputs,(s,u)=>{let l=ve(s[0]),[a,n]=this.transforms[u](dist_esm_l.arr(l)?l:s.map(ve));r+=" "+a,i=i&&n}),i?"none":r}observerAdded(r){r==1&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Gt(s,this)))}observerRemoved(r){r==0&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Qt(s,this)))}eventObserved(r){r.type=="change"&&(this._value=null),$t(this,r)}};var esm_C=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dist_esm_p.assign({batchedUpdates:external_ReactDOM_namespaceObject.unstable_batchedUpdates,createStringInterpolator:Xt,colors:It});var dist_esm_q=dist_esm_Ke(esm_C,{applyAnimatedValues:esm_V,createAnimatedStyle:t=>new dist_esm_g(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),dist_esm_it=dist_esm_q.animated; + +;// ./node_modules/@wordpress/edit-site/build-module/components/layout/animation.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + +function getAbsolutePosition(element) { + return { + top: element.offsetTop, + left: element.offsetLeft + }; +} +const ANIMATION_DURATION = 400; + +/** + * Hook used to compute the styles required to move a div into a new position. + * + * The way this animation works is the following: + * - It first renders the element as if there was no animation. + * - It takes a snapshot of the position of the block to use it + * as a destination point for the animation. + * - It restores the element to the previous position using a CSS transform + * - It uses the "resetAnimation" flag to reset the animation + * from the beginning in order to animate to the new destination point. + * + * @param {Object} $1 Options + * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. + */ +function useMovingAnimation({ + triggerAnimationOnChange +}) { + const ref = (0,external_wp_element_namespaceObject.useRef)(); + + // Whenever the trigger changes, we need to take a snapshot of the current + // position of the block to use it as a destination point for the animation. + const { + previous, + prevRect + } = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + previous: ref.current && getAbsolutePosition(ref.current), + prevRect: ref.current && ref.current.getBoundingClientRect() + }), [triggerAnimationOnChange]); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!previous || !ref.current) { + return; + } + + // We disable the animation if the user has a preference for reduced + // motion. + const disableAnimation = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if (disableAnimation) { + return; + } + const controller = new esm_le({ + x: 0, + y: 0, + width: prevRect.width, + height: prevRect.height, + config: { + duration: ANIMATION_DURATION, + easing: Lt.easeInOutQuint + }, + onChange({ + value + }) { + if (!ref.current) { + return; + } + let { + x, + y, + width, + height + } = value; + x = Math.round(x); + y = Math.round(y); + width = Math.round(width); + height = Math.round(height); + const finishedMoving = x === 0 && y === 0; + ref.current.style.transformOrigin = 'center center'; + ref.current.style.transform = finishedMoving ? null // Set to `null` to explicitly remove the transform. + : `translate3d(${x}px,${y}px,0)`; + ref.current.style.width = finishedMoving ? null : `${width}px`; + ref.current.style.height = finishedMoving ? null : `${height}px`; + } + }); + ref.current.style.transform = undefined; + const destination = ref.current.getBoundingClientRect(); + const x = Math.round(prevRect.left - destination.left); + const y = Math.round(prevRect.top - destination.top); + const width = destination.width; + const height = destination.height; + controller.start({ + x: 0, + y: 0, + width, + height, + from: { + x, + y, + width: prevRect.width, + height: prevRect.height + } + }); + return () => { + controller.stop(); + controller.set({ + x: 0, + y: 0, + width: prevRect.width, + height: prevRect.height + }); + }; + }, [previous, prevRect]); + return ref; +} +/* harmony default export */ const animation = (useMovingAnimation); + +;// ./node_modules/@wordpress/icons/build-module/library/check.js +/** + * WordPress dependencies + */ + + +const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" + }) +}); +/* harmony default export */ const library_check = (check); + +;// ./node_modules/@wordpress/edit-site/build-module/utils/is-previewing-theme.js +/** + * WordPress dependencies + */ + +function isPreviewingTheme() { + return !!(0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview'); +} +function currentlyPreviewingTheme() { + if (isPreviewingTheme()) { + return (0,external_wp_url_namespaceObject.getQueryArg)(window.location.href, 'wp_theme_preview'); + } + return null; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useLocation: save_button_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function SaveButton({ + className = 'edit-site-save-button__button', + variant = 'primary', + showTooltip = true, + showReviewMessage, + icon, + size, + __next40pxDefaultSize = false +}) { + const { + params + } = save_button_useLocation(); + const { + setIsSaveViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + saveDirtyEntities + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store)); + const { + dirtyEntityRecords + } = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)(); + const { + isSaving, + isSaveViewOpen, + previewingThemeName + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isSavingEntityRecord, + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const { + isSaveViewOpened + } = select(store); + const isActivatingTheme = isResolving('activateTheme'); + const currentlyPreviewingThemeId = currentlyPreviewingTheme(); + return { + isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme, + isSaveViewOpen: isSaveViewOpened(), + // Do not call `getTheme` with null, it will cause a request to + // the server. + previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined + }; + }, [dirtyEntityRecords]); + const hasDirtyEntities = !!dirtyEntityRecords.length; + let isOnlyCurrentEntityDirty; + // Check if the current entity is the only entity with changes. + // We have some extra logic for `wp_global_styles` for now, that + // is used in navigation sidebar. + if (dirtyEntityRecords.length === 1) { + if (params.postId) { + isOnlyCurrentEntityDirty = `${dirtyEntityRecords[0].key}` === params.postId && dirtyEntityRecords[0].name === params.postType; + } else if (params.path?.includes('wp_global_styles')) { + isOnlyCurrentEntityDirty = dirtyEntityRecords[0].name === 'globalStyles'; + } + } + const disabled = isSaving || !hasDirtyEntities && !isPreviewingTheme(); + const getLabel = () => { + if (isPreviewingTheme()) { + if (isSaving) { + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ + (0,external_wp_i18n_namespaceObject.__)('Activating %s'), previewingThemeName); + } else if (disabled) { + return (0,external_wp_i18n_namespaceObject.__)('Saved'); + } else if (hasDirtyEntities) { + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ + (0,external_wp_i18n_namespaceObject.__)('Activate %s & Save'), previewingThemeName); + } + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of theme to be activated. */ + (0,external_wp_i18n_namespaceObject.__)('Activate %s'), previewingThemeName); + } + if (isSaving) { + return (0,external_wp_i18n_namespaceObject.__)('Saving'); + } + if (disabled) { + return (0,external_wp_i18n_namespaceObject.__)('Saved'); + } + if (!isOnlyCurrentEntityDirty && showReviewMessage) { + return (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %d: number of unsaved changes (number). + (0,external_wp_i18n_namespaceObject._n)('Review %d change…', 'Review %d changes…', dirtyEntityRecords.length), dirtyEntityRecords.length); + } + return (0,external_wp_i18n_namespaceObject.__)('Save'); + }; + const label = getLabel(); + const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({ + dirtyEntityRecords + }) : () => setIsSaveViewOpened(true); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: variant, + className: className, + "aria-disabled": disabled, + "aria-expanded": isSaveViewOpen, + isBusy: isSaving, + onClick: disabled ? undefined : onClick, + label: label + /* + * We want the tooltip to show the keyboard shortcut only when the + * button does something, i.e. when it's not disabled. + */, + shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s') + /* + * Displaying the keyboard shortcut conditionally makes the tooltip + * itself show conditionally. This would trigger a full-rerendering + * of the button that we want to avoid. By setting `showTooltip`, + * the tooltip is always rendered even when there's no keyboard shortcut. + */, + showTooltip: showTooltip, + icon: icon, + __next40pxDefaultSize: __next40pxDefaultSize, + size: size, + children: label + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +function SaveHub() { + const { + isDisabled, + isSaving + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + __experimentalGetDirtyEntityRecords, + isSavingEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); + const _isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)); + return { + isSaving: _isSaving, + isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme() + }; + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "edit-site-save-hub", + alignment: "right", + spacing: 4, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveButton, { + className: "edit-site-save-hub__button", + variant: isDisabled ? null : 'primary', + showTooltip: false, + icon: isDisabled && !isSaving ? library_check : null, + showReviewMessage: true, + __next40pxDefaultSize: true + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/utils/use-activate-theme.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + useHistory: use_activate_theme_useHistory, + useLocation: use_activate_theme_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); + +/** + * This should be refactored to use the REST API, once the REST API can activate themes. + * + * @return {Function} A function that activates the theme. + */ +function useActivateTheme() { + const history = use_activate_theme_useHistory(); + const { + path + } = use_activate_theme_useLocation(); + const { + startResolution, + finishResolution + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + return async () => { + if (isPreviewingTheme()) { + const activationURL = 'themes.php?action=activate&stylesheet=' + currentlyPreviewingTheme() + '&_wpnonce=' + window.WP_BLOCK_THEME_ACTIVATE_NONCE; + startResolution('activateTheme'); + await window.fetch(activationURL); + finishResolution('activateTheme'); + // Remove the wp_theme_preview query param: we've finished activating + // the queue and are switching to normal Site Editor. + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + wp_theme_preview: '' + })); + } + }; +} + +;// external ["wp","apiFetch"] +const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; +var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); +;// ./node_modules/@wordpress/edit-site/build-module/utils/use-actual-current-theme.js +/** + * WordPress dependencies + */ + + + +const ACTIVE_THEMES_URL = '/wp/v2/themes?status=active'; +function useActualCurrentTheme() { + const [currentTheme, setCurrentTheme] = (0,external_wp_element_namespaceObject.useState)(); + (0,external_wp_element_namespaceObject.useEffect)(() => { + // Set the `wp_theme_preview` to empty string to bypass the createThemePreviewMiddleware. + const path = (0,external_wp_url_namespaceObject.addQueryArgs)(ACTIVE_THEMES_URL, { + context: 'edit', + wp_theme_preview: '' + }); + external_wp_apiFetch_default()({ + path + }).then(activeThemes => setCurrentTheme(activeThemes[0])) + // Do nothing + .catch(() => {}); + }, []); + return currentTheme; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const { + EntitiesSavedStatesExtensible, + NavigableRegion +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: save_panel_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const EntitiesSavedStatesForPreview = ({ + onClose, + renderDialog, + variant +}) => { + var _currentTheme$name$re, _previewingTheme$name; + const isDirtyProps = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)(); + let activateSaveLabel; + if (isDirtyProps.isDirty) { + activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)('Activate & Save'); + } else { + activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)('Activate'); + } + const currentTheme = useActualCurrentTheme(); + const previewingTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme(), []); + const additionalPrompt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: The name of active theme, 2: The name of theme to be activated. */ + (0,external_wp_i18n_namespaceObject.__)('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...') + }); + const activateTheme = useActivateTheme(); + const onSave = async values => { + await activateTheme(); + return values; + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesExtensible, { + ...isDirtyProps, + additionalPrompt, + close: onClose, + onSave, + saveEnabled: true, + saveLabel: activateSaveLabel, + renderDialog, + variant + }); +}; +const _EntitiesSavedStates = ({ + onClose, + renderDialog, + variant +}) => { + if (isPreviewingTheme()) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesForPreview, { + onClose: onClose, + renderDialog: renderDialog, + variant: variant + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EntitiesSavedStates, { + close: onClose, + renderDialog: renderDialog, + variant: variant + }); +}; +function SavePanel() { + const { + query + } = save_panel_useLocation(); + const { + canvas = 'view' + } = query; + const { + isSaveViewOpen, + isDirty, + isSaving + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + __experimentalGetDirtyEntityRecords, + isSavingEntityRecord, + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); + const isActivatingTheme = isResolving('activateTheme'); + const { + isSaveViewOpened + } = unlock(select(store)); + + // The currently selected entity to display. + // Typically template or template part in the site editor. + return { + isSaveViewOpen: isSaveViewOpened(), + isDirty: dirtyEntityRecords.length > 0, + isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme + }; + }, []); + const { + setIsSaveViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const onClose = () => setIsSaveViewOpened(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + setIsSaveViewOpened(false); + }, [canvas, setIsSaveViewOpened]); + if (canvas === 'view') { + return isSaveViewOpen ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + className: "edit-site-save-panel__modal", + onRequestClose: onClose, + title: (0,external_wp_i18n_namespaceObject.__)('Review changes'), + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { + onClose: onClose, + variant: "inline" + }) + }) : null; + } + const activateSaveEnabled = isPreviewingTheme() || isDirty; + const disabled = isSaving || !activateSaveEnabled; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(NavigableRegion, { + className: dist_clsx('edit-site-layout__actions', { + 'is-entity-save-view-open': isSaveViewOpen + }), + ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Save panel'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('edit-site-editor__toggle-save-panel', { + 'screen-reader-text': isSaveViewOpen + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "secondary", + className: "edit-site-editor__toggle-save-panel-button", + onClick: () => setIsSaveViewOpened(true), + "aria-haspopup": "dialog", + disabled: disabled, + accessibleWhenDisabled: true, + children: (0,external_wp_i18n_namespaceObject.__)('Open save panel') + }) + }), isSaveViewOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { + onClose: onClose, + renderDialog: true + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + + +const { + useCommands +} = unlock(external_wp_coreCommands_namespaceObject.privateApis); +const { + useGlobalStyle: layout_useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + NavigableRegion: layout_NavigableRegion, + GlobalStylesProvider +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: layout_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const layout_ANIMATION_DURATION = 0.3; +function Layout() { + const { + query, + name: routeKey, + areas, + widths + } = layout_useLocation(); + const { + canvas = 'view' + } = query; + useCommands(); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const toggleRef = (0,external_wp_element_namespaceObject.useRef)(); + const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); + const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); + const [canvasResizer, canvasSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + const isEditorLoading = useIsSiteEditorLoading(); + const [isResizableFrameOversized, setIsResizableFrameOversized] = (0,external_wp_element_namespaceObject.useState)(false); + const animationRef = animation({ + triggerAnimationOnChange: routeKey + '-' + canvas + }); + const { + showIconLabels + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return { + showIconLabels: select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels') + }; + }); + const [backgroundColor] = layout_useGlobalStyle('color.background'); + const [gradientValue] = layout_useGlobalStyle('color.gradient'); + const previousCanvaMode = (0,external_wp_compose_namespaceObject.usePrevious)(canvas); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (previousCanvaMode === 'edit') { + toggleRef.current?.focus(); + } + // Should not depend on the previous canvas mode value but the next. + }, [canvas]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveKeyboardShortcut, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...navigateRegionsProps, + ref: navigateRegionsProps.ref, + className: dist_clsx('edit-site-layout', navigateRegionsProps.className, { + 'is-full-canvas': canvas === 'edit', + 'show-icon-labels': showIconLabels + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-layout__content", + children: [(!isMobileViewport || !areas.mobile) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout_NavigableRegion, { + ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation'), + className: "edit-site-layout__sidebar-region", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { + children: canvas === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { + initial: { + opacity: 0 + }, + animate: { + opacity: 1 + }, + exit: { + opacity: 0 + }, + transition: { + type: 'tween', + duration: + // Disable transition in mobile to emulate a full page transition. + disableMotion || isMobileViewport ? 0 : layout_ANIMATION_DURATION, + ease: 'easeOut' + }, + className: "edit-site-layout__sidebar", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_hub, { + ref: toggleRef, + isTransparent: isResizableFrameOversized + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationProvider, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { + shouldAnimate: routeKey !== 'styles', + routeKey: routeKey, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.sidebar + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})] + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-layout__mobile", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationProvider, { + children: canvas !== 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteHubMobile, { + ref: toggleRef, + isTransparent: isResizableFrameOversized + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { + routeKey: routeKey, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.mobile + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})] + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.mobile + }) + }) + }), !isMobileViewport && areas.content && canvas !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-layout__area", + style: { + maxWidth: widths?.content + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.content + }) + }), !isMobileViewport && areas.edit && canvas !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-layout__area", + style: { + maxWidth: widths?.edit + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: areas.edit + }) + }), !isMobileViewport && areas.preview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-layout__canvas-container", + children: [canvasResizer, !!canvasSize.width && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('edit-site-layout__canvas', { + 'is-right-aligned': isResizableFrameOversized + }), + ref: animationRef, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.ErrorBoundary, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_frame, { + isReady: !isEditorLoading, + isFullWidth: canvas === 'edit', + defaultSize: { + width: canvasSize.width - 24 /* $canvas-padding */, + height: canvasSize.height + }, + isOversized: isResizableFrameOversized, + setIsOversized: setIsResizableFrameOversized, + innerContentStyle: { + background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor + }, + children: areas.preview + }) + }) + })] + })] + }) + })] + }); +} +function LayoutWithGlobalStylesProvider(props) { + const { + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + function onPluginAreaError(name) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ + (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(GlobalStylesProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { + onError: onPluginAreaError + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, { + ...props + })] + }) + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/styles.js +/** + * WordPress dependencies + */ + + +const styles = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" + }) +}); +/* harmony default export */ const library_styles = (styles); + +;// ./node_modules/@wordpress/icons/build-module/library/help.js +/** + * WordPress dependencies + */ + + +const help = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z" + }) +}); +/* harmony default export */ const library_help = (help); + +;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js +/** + * WordPress dependencies + */ + + +const rotateRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" + }) +}); +/* harmony default export */ const rotate_right = (rotateRight); + +;// ./node_modules/@wordpress/icons/build-module/library/rotate-left.js +/** + * WordPress dependencies + */ + + +const rotateLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" + }) +}); +/* harmony default export */ const rotate_left = (rotateLeft); + +;// ./node_modules/@wordpress/icons/build-module/library/brush.js +/** + * WordPress dependencies + */ + + +const brush = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" + }) +}); +/* harmony default export */ const library_brush = (brush); + +;// ./node_modules/@wordpress/icons/build-module/library/backup.js +/** + * WordPress dependencies + */ + + +const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" + }) +}); +/* harmony default export */ const library_backup = (backup); + +;// ./node_modules/@wordpress/icons/build-module/library/external.js +/** + * WordPress dependencies + */ + + +const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" + }) +}); +/* harmony default export */ const library_external = (external); + +;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-common-commands.js +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + +const { + useGlobalStylesReset +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + useHistory: use_common_commands_useHistory, + useLocation: use_common_commands_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStylesCommands() { + const { + openGeneralSidebar + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + params + } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; + const history = use_common_commands_useHistory(); + const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; + }, []); + const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isBlockBasedTheme) { + return []; + } + return [{ + name: 'core/edit-site/open-styles', + label: (0,external_wp_i18n_namespaceObject.__)('Open styles'), + callback: ({ + close + }) => { + close(); + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' + }); + } + openGeneralSidebar('edit-site/global-styles'); + }, + icon: library_styles + }]; + }, [history, openGeneralSidebar, canvas, isBlockBasedTheme]); + return { + isLoading: false, + commands + }; +}; +const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() { + const { + openGeneralSidebar + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + params + } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; + const { + set + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); + const history = use_common_commands_useHistory(); + const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; + }, []); + const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isBlockBasedTheme) { + return []; + } + return [{ + name: 'core/edit-site/toggle-styles-welcome-guide', + label: (0,external_wp_i18n_namespaceObject.__)('Learn about styles'), + callback: ({ + close + }) => { + close(); + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' + }); + } + openGeneralSidebar('edit-site/global-styles'); + set('core/edit-site', 'welcomeGuideStyles', true); + // sometimes there's a focus loss that happens after some time + // that closes the modal, we need to force reopening it. + setTimeout(() => { + set('core/edit-site', 'welcomeGuideStyles', true); + }, 500); + }, + icon: library_help + }]; + }, [history, openGeneralSidebar, canvas, isBlockBasedTheme, set]); + return { + isLoading: false, + commands + }; +}; +const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands() { + const [canReset, onReset] = useGlobalStylesReset(); + const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!canReset) { + return []; + } + return [{ + name: 'core/edit-site/reset-global-styles', + label: (0,external_wp_i18n_namespaceObject.__)('Reset styles'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? rotate_right : rotate_left, + callback: ({ + close + }) => { + close(); + onReset(); + } + }]; + }, [canReset, onReset]); + return { + isLoading: false, + commands + }; +}; +const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() { + const { + openGeneralSidebar, + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + params + } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; + const history = use_common_commands_useHistory(); + const { + canEditCSS + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + __experimentalGetCurrentGlobalStylesId + } = select(external_wp_coreData_namespaceObject.store); + const globalStylesId = __experimentalGetCurrentGlobalStylesId(); + const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; + return { + canEditCSS: !!globalStyles?._links?.['wp:action-edit-css'] + }; + }, []); + const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!canEditCSS) { + return []; + } + return [{ + name: 'core/edit-site/open-styles-css', + label: (0,external_wp_i18n_namespaceObject.__)('Customize CSS'), + icon: library_brush, + callback: ({ + close + }) => { + close(); + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' + }); + } + openGeneralSidebar('edit-site/global-styles'); + setEditorCanvasContainerView('global-styles-css'); + } + }]; + }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas]); + return { + isLoading: false, + commands + }; +}; +const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() { + const { + openGeneralSidebar, + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + params + } = use_common_commands_useLocation(); + const { + canvas = 'view' + } = params; + const history = use_common_commands_useHistory(); + const hasRevisions = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord, + __experimentalGetCurrentGlobalStylesId + } = select(external_wp_coreData_namespaceObject.store); + const globalStylesId = __experimentalGetCurrentGlobalStylesId(); + const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; + return !!globalStyles?._links?.['version-history']?.[0]?.count; + }, []); + const commands = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!hasRevisions) { + return []; + } + return [{ + name: 'core/edit-site/open-global-styles-revisions', + label: (0,external_wp_i18n_namespaceObject.__)('Style revisions'), + icon: library_backup, + callback: ({ + close + }) => { + close(); + if (canvas !== 'edit') { + history.navigate('/styles?canvas=edit', { + transition: 'canvas-mode-edit-transition' + }); + } + openGeneralSidebar('edit-site/global-styles'); + setEditorCanvasContainerView('global-styles-revisions'); + } + }]; + }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas]); + return { + isLoading: false, + commands + }; +}; +function useCommonCommands() { + const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { + // Site index. + return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; + }, []); + (0,external_wp_commands_namespaceObject.useCommand)({ + name: 'core/edit-site/view-site', + label: (0,external_wp_i18n_namespaceObject.__)('View site'), + callback: ({ + close + }) => { + close(); + window.open(homeUrl, '_blank'); + }, + icon: library_external + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/open-styles', + hook: getGlobalStylesOpenStylesCommands() + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/toggle-styles-welcome-guide', + hook: getGlobalStylesToggleWelcomeGuideCommands() + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/reset-global-styles', + hook: getGlobalStylesResetCommands() + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/open-styles-css', + hook: getGlobalStylesOpenCssCommands() + }); + (0,external_wp_commands_namespaceObject.useCommandLoader)({ + name: 'core/edit-site/open-styles-revisions', + hook: getGlobalStylesOpenRevisionsCommands() + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/close-small.js +/** + * WordPress dependencies + */ + + +const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" + }) +}); +/* harmony default export */ const close_small = (closeSmall); + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + +const { + EditorContentSlotFill, + ResizableEditor +} = unlock(external_wp_editor_namespaceObject.privateApis); + +/** + * Returns a translated string for the title of the editor canvas container. + * + * @param {string} view Editor canvas container view. + * + * @return {Object} Translated string for the view title and associated icon, both defaulting to ''. + */ +function getEditorCanvasContainerTitle(view) { + switch (view) { + case 'style-book': + return (0,external_wp_i18n_namespaceObject.__)('Style Book'); + case 'global-styles-revisions': + case 'global-styles-revisions:style-book': + return (0,external_wp_i18n_namespaceObject.__)('Style Revisions'); + default: + return ''; + } +} +function EditorCanvasContainer({ + children, + closeButtonLabel, + onClose, + enableResizing = false +}) { + const { + editorCanvasContainerView, + showListViewByDefault + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const _editorCanvasContainerView = unlock(select(store)).getEditorCanvasContainerView(); + const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); + return { + editorCanvasContainerView: _editorCanvasContainerView, + showListViewByDefault: _showListViewByDefault + }; + }, []); + const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + setIsListViewOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); + const sectionFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)(); + function onCloseContainer() { + setIsListViewOpened(showListViewByDefault); + setEditorCanvasContainerView(undefined); + setIsClosed(true); + if (typeof onClose === 'function') { + onClose(); + } + } + function closeOnEscape(event) { + if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { + event.preventDefault(); + onCloseContainer(); + } + } + const childrenWithProps = Array.isArray(children) ? external_wp_element_namespaceObject.Children.map(children, (child, index) => index === 0 ? (0,external_wp_element_namespaceObject.cloneElement)(child, { + ref: sectionFocusReturnRef + }) : child) : (0,external_wp_element_namespaceObject.cloneElement)(children, { + ref: sectionFocusReturnRef + }); + if (isClosed) { + return null; + } + const title = getEditorCanvasContainerTitle(editorCanvasContainerView); + const shouldShowCloseButton = onClose || closeButtonLabel; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorContentSlotFill.Fill, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-editor-canvas-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableEditor, { + enableResizing: enableResizing, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { + className: "edit-site-editor-canvas-container__section", + ref: shouldShowCloseButton ? focusOnMountRef : null, + onKeyDown: closeOnEscape, + "aria-label": title, + children: [shouldShowCloseButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + className: "edit-site-editor-canvas-container__close-button", + icon: close_small, + label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)('Close'), + onClick: onCloseContainer + }), childrenWithProps] + }) + }) + }) + }); +} +function useHasEditorCanvasContainer() { + const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(EditorContentSlotFill.name); + return !!fills?.length; +} +/* harmony default export */ const editor_canvas_container = (EditorCanvasContainer); + + +;// ./node_modules/@wordpress/edit-site/build-module/hooks/commands/use-set-command-context.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + useCommandContext +} = unlock(external_wp_commands_namespaceObject.privateApis); +const { + useLocation: use_set_command_context_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); + +/** + * React hook used to set the correct command context based on the current state. + */ +function useSetCommandContext() { + const { + query = {} + } = use_set_command_context_useLocation(); + const { + canvas = 'view' + } = query; + const hasBlockSelected = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(); + }, []); + const hasEditorCanvasContainer = useHasEditorCanvasContainer(); + + // Sets the right context for the command palette + let commandContext = 'site-editor'; + if (canvas === 'edit') { + commandContext = 'entity-edit'; + } + if (hasBlockSelected) { + commandContext = 'block-selection-edit'; + } + if (hasEditorCanvasContainer) { + /* + * The editor canvas overlay will likely be deprecated in the future, so for now we clear the command context + * to remove the suggested commands that may not make sense with Style Book or Style Revisions open. + * See https://github.com/WordPress/gutenberg/issues/62216. + */ + commandContext = ''; + } + useCommandContext(commandContext); +} + +;// ./node_modules/@wordpress/icons/build-module/library/navigation.js +/** + * WordPress dependencies + */ + + +const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" + }) +}); +/* harmony default export */ const library_navigation = (navigation); + +;// ./node_modules/@wordpress/icons/build-module/library/page.js +/** + * WordPress dependencies + */ + + +const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" + })] +}); +/* harmony default export */ const library_page = (page); + +;// ./node_modules/@wordpress/icons/build-module/library/layout.js +/** + * WordPress dependencies + */ + + +const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" + }) +}); +/* harmony default export */ const library_layout = (layout); + +;// ./node_modules/@wordpress/icons/build-module/library/symbol.js +/** + * WordPress dependencies + */ + + +const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" + }) +}); +/* harmony default export */ const library_symbol = (symbol); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js +/** + * WordPress dependencies + */ + + +const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" + }) +}); +/* harmony default export */ const chevron_right = (chevronRight); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js +/** + * WordPress dependencies + */ + + +const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" + }) +}); +/* harmony default export */ const chevron_left = (chevronLeft); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-button/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +function SidebarButton(props) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + ...props, + className: dist_clsx('edit-site-sidebar-button', props.className) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const { + useHistory: sidebar_navigation_screen_useHistory, + useLocation: sidebar_navigation_screen_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function SidebarNavigationScreen({ + isRoot, + title, + actions, + content, + footer, + description, + backPath: backPathProp +}) { + const { + dashboardLink, + dashboardLinkText, + previewingThemeName + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = unlock(select(store)); + const currentlyPreviewingThemeId = currentlyPreviewingTheme(); + return { + dashboardLink: getSettings().__experimentalDashboardLink, + dashboardLinkText: getSettings().__experimentalDashboardLinkText, + // Do not call `getTheme` with null, it will cause a request to + // the server. + previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined + }; + }, []); + const location = sidebar_navigation_screen_useLocation(); + const history = sidebar_navigation_screen_useHistory(); + const { + navigate + } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); + const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath; + const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: dist_clsx('edit-site-sidebar-navigation-screen__main', { + 'has-footer': !!footer + }), + spacing: 0, + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + alignment: "flex-start", + className: "edit-site-sidebar-navigation-screen__title-icon", + children: [!isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { + onClick: () => { + history.navigate(backPath); + navigate('back'); + }, + icon: icon, + label: (0,external_wp_i18n_namespaceObject.__)('Back'), + showTooltip: false + }), isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { + icon: icon, + label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), + href: dashboardLink + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + className: "edit-site-sidebar-navigation-screen__title", + color: '#e0e0e0' /* $gray-200 */, + level: 1, + size: 20, + children: !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: theme name. 2: title */ + (0,external_wp_i18n_namespaceObject.__)('Previewing %1$s: %2$s'), previewingThemeName, title) + }), actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen__actions", + children: actions + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-sidebar-navigation-screen__content", + children: [description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen__description", + children: description + }), content] + })] + }), footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("footer", { + className: "edit-site-sidebar-navigation-screen__footer", + children: footer + })] + }); +} + +;// ./node_modules/@wordpress/icons/build-module/icon/index.js +/** + * WordPress dependencies + */ + + +/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ + +/** + * Return an SVG icon. + * + * @param {IconProps} props icon is the SVG component to render + * size is a number specifying the icon size in pixels + * Other props will be passed to wrapped SVG component + * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. + * + * @return {JSX.Element} Icon component + */ +function Icon({ + icon, + size = 24, + ...props +}, ref) { + return (0,external_wp_element_namespaceObject.cloneElement)(icon, { + width: size, + height: size, + ...props, + ref + }); +} +/* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js +/** + * WordPress dependencies + */ + + +const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" + }) +}); +/* harmony default export */ const chevron_left_small = (chevronLeftSmall); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js +/** + * WordPress dependencies + */ + + +const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" + }) +}); +/* harmony default export */ const chevron_right_small = (chevronRightSmall); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + useHistory: sidebar_navigation_item_useHistory, + useLink +} = unlock(external_wp_router_namespaceObject.privateApis); +function SidebarNavigationItem({ + className, + icon, + withChevron = false, + suffix, + uid, + to, + onClick, + children, + ...props +}) { + const history = sidebar_navigation_item_useHistory(); + const { + navigate + } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); + // If there is no custom click handler, create one that navigates to `params`. + function handleClick(e) { + if (onClick) { + onClick(e); + navigate('forward'); + } else if (to) { + e.preventDefault(); + history.navigate(to); + navigate('forward', `[id="${uid}"]`); + } + } + const linkProps = useLink(to); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { + className: dist_clsx('edit-site-sidebar-navigation-item', { + 'with-suffix': !withChevron && suffix + }, className), + id: uid, + onClick: handleClick, + href: to ? linkProps.href : undefined, + ...props, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "flex-start", + children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + style: { + fill: 'currentcolor' + }, + icon: icon, + size: 24 + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { + children: children + }), withChevron && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small, + className: "edit-site-sidebar-navigation-item__drilldown-indicator", + size: 24 + }), !withChevron && suffix] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + +const SITE_EDITOR_AUTHORS_QUERY = { + per_page: -1, + _fields: 'id,name,avatar_urls', + context: 'view', + capabilities: ['edit_theme_options'] +}; +const DEFAULT_QUERY = { + per_page: 100, + page: 1 +}; +const use_global_styles_revisions_EMPTY_ARRAY = []; +const { + GlobalStylesContext: use_global_styles_revisions_GlobalStylesContext +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function useGlobalStylesRevisions({ + query +} = {}) { + const { + user: userConfig + } = (0,external_wp_element_namespaceObject.useContext)(use_global_styles_revisions_GlobalStylesContext); + const _query = { + ...DEFAULT_QUERY, + ...query + }; + const { + authors, + currentUser, + isDirty, + revisions, + isLoadingGlobalStylesRevisions, + revisionsCount + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _globalStyles$_links$; + const { + __experimentalGetDirtyEntityRecords, + getCurrentUser, + getUsers, + getRevisions, + __experimentalGetCurrentGlobalStylesId, + getEntityRecord, + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); + const _currentUser = getCurrentUser(); + const _isDirty = dirtyEntityRecords.length > 0; + const globalStylesId = __experimentalGetCurrentGlobalStylesId(); + const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; + const _revisionsCount = (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0; + const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, _query) || use_global_styles_revisions_EMPTY_ARRAY; + const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || use_global_styles_revisions_EMPTY_ARRAY; + const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, _query]); + return { + authors: _authors, + currentUser: _currentUser, + isDirty: _isDirty, + revisions: globalStylesRevisions, + isLoadingGlobalStylesRevisions: _isResolving, + revisionsCount: _revisionsCount + }; + }, [query]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!authors.length || isLoadingGlobalStylesRevisions) { + return { + revisions: use_global_styles_revisions_EMPTY_ARRAY, + hasUnsavedChanges: isDirty, + isLoading: true, + revisionsCount + }; + } + + // Adds author details to each revision. + const _modifiedRevisions = revisions.map(revision => { + return { + ...revision, + author: authors.find(author => author.id === revision.author) + }; + }); + const fetchedRevisionsCount = revisions.length; + if (fetchedRevisionsCount) { + // Flags the most current saved revision. + if (_modifiedRevisions[0].id !== 'unsaved' && _query.page === 1) { + _modifiedRevisions[0].isLatest = true; + } + + // Adds an item for unsaved changes. + if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) { + const unsavedRevision = { + id: 'unsaved', + styles: userConfig?.styles, + settings: userConfig?.settings, + _links: userConfig?._links, + author: { + name: currentUser?.name, + avatar_urls: currentUser?.avatar_urls + }, + modified: new Date() + }; + _modifiedRevisions.unshift(unsavedRevision); + } + if (_query.page === Math.ceil(revisionsCount / _query.per_page)) { + // Adds an item for the default theme styles. + _modifiedRevisions.push({ + id: 'parent', + styles: {}, + settings: {} + }); + } + } + return { + revisions: _modifiedRevisions, + hasUnsavedChanges: isDirty, + isLoading: false, + revisionsCount + }; + }, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function SidebarNavigationScreenDetailsFooter({ + record, + revisionsCount, + ...otherProps +}) { + var _record$_links$predec; + /* + * There might be other items in the future, + * but for now it's just modified date. + * Later we might render a list of items and isolate + * the following logic. + */ + const hrefProps = {}; + const lastRevisionId = (_record$_links$predec = record?._links?.['predecessor-version']?.[0]?.id) !== null && _record$_links$predec !== void 0 ? _record$_links$predec : null; + + // Use incoming prop first, then the record's version history, if available. + revisionsCount = revisionsCount || record?._links?.['version-history']?.[0]?.count || 0; + + /* + * Enable the revisions link if there is a last revision and there is more than one revision. + * This link is used for theme assets, e.g., templates, which have no database record until they're edited. + * For these files there's only a "revision" after they're edited twice, + * which means the revision.php page won't display a proper diff. + * See: https://github.com/WordPress/gutenberg/issues/49164. + */ + if (lastRevisionId && revisionsCount > 1) { + hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { + revision: record?._links['predecessor-version'][0].id + }); + hrefProps.as = 'a'; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + size: "large", + className: "edit-site-sidebar-navigation-screen-details-footer", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + icon: library_backup, + ...hrefProps, + ...otherProps, + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of Styles revisions. */ + (0,external_wp_i18n_namespaceObject._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +const { + useLocation: sidebar_navigation_screen_global_styles_useLocation, + useHistory: sidebar_navigation_screen_global_styles_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +function SidebarNavigationItemGlobalStyles(props) { + const { + name + } = sidebar_navigation_screen_global_styles_useLocation(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + ...props, + "aria-current": name === 'styles' + }); +} +function SidebarNavigationScreenGlobalStyles() { + const history = sidebar_navigation_screen_global_styles_useHistory(); + const { + path + } = sidebar_navigation_screen_global_styles_useLocation(); + const { + revisions, + isLoading: isLoadingRevisions, + revisionsCount + } = useGlobalStylesRevisions(); + const { + openGeneralSidebar + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const { + set: setPreference + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); + const openGlobalStyles = (0,external_wp_element_namespaceObject.useCallback)(async () => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); + return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]); + }, [path, history, openGeneralSidebar, setPreference]); + const openRevisions = (0,external_wp_element_namespaceObject.useCallback)(async () => { + await openGlobalStyles(); + // Open the global styles revisions once the canvas mode is set to edit, + // and the global styles sidebar is open. The global styles UI is responsible + // for redirecting to the revisions screen once the editor canvas container + // has been set to 'global-styles-revisions'. + setEditorCanvasContainerView('global-styles-revisions'); + }, [openGlobalStyles, setEditorCanvasContainerView]); + + // If there are no revisions, do not render a footer. + const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + isRoot: true, + description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainSidebarNavigationContent, { + activeItem: "styles-navigation-item" + }), + footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsFooter, { + record: revisions?.[0], + revisionsCount: revisionsCount, + onClick: openRevisions + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + +function MainSidebarNavigationContent({ + isBlockBasedTheme = true +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-main", + children: [isBlockBasedTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "navigation-navigation-item", + to: "/navigation", + withChevron: true, + icon: library_navigation, + children: (0,external_wp_i18n_namespaceObject.__)('Navigation') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItemGlobalStyles, { + to: "/styles", + uid: "global-styles-navigation-item", + icon: library_styles, + children: (0,external_wp_i18n_namespaceObject.__)('Styles') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "page-navigation-item", + to: "/page", + withChevron: true, + icon: library_page, + children: (0,external_wp_i18n_namespaceObject.__)('Pages') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "template-navigation-item", + to: "/template", + withChevron: true, + icon: library_layout, + children: (0,external_wp_i18n_namespaceObject.__)('Templates') + })] + }), !isBlockBasedTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "stylebook-navigation-item", + to: "/stylebook", + withChevron: true, + icon: library_styles, + children: (0,external_wp_i18n_namespaceObject.__)('Styles') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + uid: "patterns-navigation-item", + to: "/pattern", + withChevron: true, + icon: library_symbol, + children: (0,external_wp_i18n_namespaceObject.__)('Patterns') + })] + }); +} +function SidebarNavigationScreenMain({ + customDescription +}) { + const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + + // Clear the editor canvas container view when accessing the main navigation screen. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setEditorCanvasContainerView(undefined); + }, [setEditorCanvasContainerView]); + let description; + if (customDescription) { + description = customDescription; + } else if (isBlockBasedTheme) { + description = (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'); + } else { + description = (0,external_wp_i18n_namespaceObject.__)('Explore block styles and patterns to refine your site.'); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + isRoot: true, + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + description: description, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainSidebarNavigationContent, { + isBlockBasedTheme: isBlockBasedTheme + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-unsupported/index.js +/** + * WordPress dependencies + */ + + + +function SidebarNavigationScreenUnsupported() { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + padding: 3, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { + status: "warning", + isDismissible: false, + children: (0,external_wp_i18n_namespaceObject.__)('The theme you are currently using does not support this screen.') + }) + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/arrow-up-left.js +/** + * WordPress dependencies + */ + + +const arrowUpLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" + }) +}); +/* harmony default export */ const arrow_up_left = (arrowUpLeft); + +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/image.js function WelcomeGuideImage({ nonAnimatedSrc, @@ -11077,22 +10761,20 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/editor.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/editor.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ function WelcomeGuideEditor() { @@ -11142,27 +10824,25 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/styles.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/styles.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ const { interfaceStore: styles_interfaceStore -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); function WelcomeGuideStyles() { const { toggle @@ -11249,18 +10929,11 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/page.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/page.js +/** + * WordPress dependencies + */ + @@ -11272,10 +10945,7 @@ const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { const isPageActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuidePage'); const isEditorActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuide'); - const { - isPage - } = select(store); - return isPageActive && !isEditorActive && isPage(); + return isPageActive && !isEditorActive; }, []); if (!isVisible) { return null; @@ -11305,26 +10975,21 @@ children: heading }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-site-welcome-guide__text", - children: (0,external_wp_i18n_namespaceObject.__)('It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.') + children: (0,external_wp_i18n_namespaceObject.__)( + // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts + 'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.') })] }) }] }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/template.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/template.js +/** + * WordPress dependencies + */ + + @@ -11333,17 +10998,22 @@ const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { - const isTemplateActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuideTemplate'); - const isEditorActive = !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', 'welcomeGuide'); - const { - isPage - } = select(store); - const { - getCurrentPostType + const { + isActive, + hasPreviousEntity + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEditorSettings } = select(external_wp_editor_namespaceObject.store); - return isTemplateActive && !isEditorActive && isPage() && getCurrentPostType() === 'wp_template'; - }, []); + const { + get + } = select(external_wp_preferences_namespaceObject.store); + return { + isActive: get('core/edit-site', 'welcomeGuideTemplate'), + hasPreviousEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord + }; + }, []); + const isVisible = isActive && hasPreviousEntity; if (!isVisible) { return null; } @@ -11379,45 +11049,41 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/index.js -/** - * Internal dependencies - */ - - - - - - - -function WelcomeGuide() { +;// ./node_modules/@wordpress/edit-site/build-module/components/welcome-guide/index.js +/** + * Internal dependencies + */ + + + + + +function WelcomeGuide({ + postType +}) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideEditor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideStyles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuidePage, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {})] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles-renderer/index.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideEditor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideStyles, {}), postType === 'page' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuidePage, {}), postType === 'wp_template' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {})] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-renderer/index.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ const { useGlobalStylesOutput -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -function useGlobalStylesRenderer() { - const postType = (0,external_wp_data_namespaceObject.useSelect)(select => { - return select(store).getEditedPostType(); - }); - const [styles, settings] = useGlobalStylesOutput(postType !== TEMPLATE_POST_TYPE); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function useGlobalStylesRenderer(disableRootPadding) { + const [styles, settings] = useGlobalStylesOutput(disableRootPadding); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store); @@ -11438,12 +11104,14 @@ }); }, [styles, settings, updateSettings, getSettings]); } -function GlobalStylesRenderer() { - useGlobalStylesRenderer(); +function GlobalStylesRenderer({ + disableRootPadding +}) { + useGlobalStylesRenderer(disableRootPadding); return null; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/canvas-loader/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/canvas-loader/index.js /** * WordPress dependencies */ @@ -11460,10 +11128,10 @@ const { Theme -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_components_namespaceObject.privateApis); const { useGlobalStyle: canvas_loader_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CanvasLoader({ id }) { @@ -11501,194 +11169,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-regular.js -/** - * WordPress dependencies - */ - - - - - -function ConvertToRegularBlocks({ - clientId, - onClose -}) { - const { - getBlocks - } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); - const { - replaceBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); - if (!canRemove) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - replaceBlocks(clientId, getBlocks(clientId)); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Detach') - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js -/** - * WordPress dependencies - */ - - -const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" - }) -}); -/* harmony default export */ const symbol_filled = (symbolFilled); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/convert-to-template-part.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - -const { - CreateTemplatePartModal -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -function ConvertToTemplatePart({ - clientIds, - blocks -}) { - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const { - replaceBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const { - createSuccessNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - canCreate - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - supportsTemplatePartsMode - } = select(store).getSettings(); - return { - canCreate: !supportsTemplatePartsMode - }; - }, []); - if (!canCreate) { - return null; - } - const onConvert = async templatePart => { - replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.createBlock)('core/template-part', { - slug: templatePart.slug, - theme: templatePart.theme - })); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template part created.'), { - type: 'snackbar' - }); - - // The modal and this component will be unmounted because of `replaceBlocks` above, - // so no need to call `closeModal` or `onClose`. - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: symbol_filled, - onClick: () => { - setIsModalOpen(true); - }, - "aria-expanded": isModalOpen, - "aria-haspopup": "dialog", - children: (0,external_wp_i18n_namespaceObject.__)('Create template part') - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModal, { - closeModal: () => { - setIsModalOpen(false); - }, - blocks: blocks, - onCreate: onConvert - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-part-converter/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function TemplatePartConverter() { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { - children: ({ - selectedClientIds, - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartConverterMenuItem, { - clientIds: selectedClientIds, - onClose: onClose - }) - }); -} -function TemplatePartConverterMenuItem({ - clientIds, - onClose -}) { - const { - isContentOnly, - blocks - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlocksByClientId, - getBlockEditingMode - } = select(external_wp_blockEditor_namespaceObject.store); - return { - blocks: getBlocksByClientId(clientIds), - isContentOnly: clientIds.length === 1 && getBlockEditingMode(clientIds[0]) === 'contentOnly' - }; - }, [clientIds]); - - // Do not show the convert button if the block is in content-only mode. - if (isContentOnly) { - return null; - } - - // Allow converting a single template part to standard blocks. - if (blocks.length === 1 && blocks[0]?.name === 'core/template-part') { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToRegularBlocks, { - clientId: clientIds[0], - onClose: onClose - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToTemplatePart, { - clientIds: clientIds, - blocks: blocks - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-navigate-to-entity-record.js +;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-navigate-to-entity-record.js /** * WordPress dependencies */ @@ -11701,196 +11182,84 @@ const { useHistory: use_navigate_to_entity_record_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); function useNavigateToEntityRecord() { const history = use_navigate_to_entity_record_useHistory(); const onNavigateToEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(params => { - history.push({ - ...params, - focusMode: true, - canvas: 'edit' - }); + history.navigate(`/${params.postType}/${params.postId}?canvas=edit&focusMode=true`); }, [history]); return onNavigateToEntityRecord; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-site-editor-settings.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - -const { - useBlockEditorSettings -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-site-editor-settings.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + const { useLocation: use_site_editor_settings_useLocation, useHistory: use_site_editor_settings_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useArchiveLabel(templateSlug) { - const taxonomyMatches = templateSlug?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/); - let taxonomy; - let term; - let isAuthor = false; - let authorSlug; - if (taxonomyMatches) { - // If is for a all taxonomies of a type - if (taxonomyMatches[1]) { - taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; - } - // If is for a all taxonomies of a type - else if (taxonomyMatches[3]) { - taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; - term = taxonomyMatches[7]; - } - taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy; - - //getTaxonomy( 'category' ); - //wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} ); - } else { - const authorMatches = templateSlug?.match(/^(author)$|^author-(.+)$/); - if (authorMatches) { - isAuthor = true; - if (authorMatches[2]) { - authorSlug = authorMatches[2]; - } - } - } - return (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecords, - getTaxonomy, - getAuthors - } = select(external_wp_coreData_namespaceObject.store); - let archiveTypeLabel; - let archiveNameLabel; - if (taxonomy) { - archiveTypeLabel = getTaxonomy(taxonomy)?.labels?.singular_name; - } - if (term) { - const records = getEntityRecords('taxonomy', taxonomy, { - slug: term, - per_page: 1 - }); - if (records && records[0]) { - archiveNameLabel = records[0].name; - } - } - if (isAuthor) { - archiveTypeLabel = 'Author'; - if (authorSlug) { - const authorRecords = getAuthors({ - slug: authorSlug - }); - if (authorRecords && authorRecords[0]) { - archiveNameLabel = authorRecords[0].name; - } - } - } - return { - archiveTypeLabel, - archiveNameLabel - }; - }, [authorSlug, isAuthor, taxonomy, term]); -} +} = unlock(external_wp_router_namespaceObject.privateApis); function useNavigateToPreviousEntityRecord() { const location = use_site_editor_settings_useLocation(); const previousLocation = (0,external_wp_compose_namespaceObject.usePrevious)(location); const history = use_site_editor_settings_useHistory(); const goBack = (0,external_wp_element_namespaceObject.useMemo)(() => { - const isFocusMode = location.params.focusMode || location.params.postId && FOCUSABLE_ENTITIES.includes(location.params.postType); - const didComeFromEditorCanvas = previousLocation?.params.canvas === 'edit'; + const isFocusMode = location.query.focusMode || location?.params?.postId && FOCUSABLE_ENTITIES.includes(location?.params?.postType); + const didComeFromEditorCanvas = previousLocation?.query.canvas === 'edit'; const showBackButton = isFocusMode && didComeFromEditorCanvas; return showBackButton ? () => history.back() : undefined; - // Disable reason: previousLocation changes when the component updates for any reason, not + // `previousLocation` changes when the component updates for any reason, not // just when location changes. Until this is fixed we can't add it to deps. See // https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465. - // eslint-disable-next-line react-hooks/exhaustive-deps }, [location, history]); return goBack; } function useSpecificEditorSettings() { + const { + query + } = use_site_editor_settings_useLocation(); + const { + canvas = 'view' + } = query; const onNavigateToEntityRecord = useNavigateToEntityRecord(); const { - templateSlug, - canvasMode, - settings, - postWithTemplate + settings } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEditedPostType, - getEditedPostId, - getEditedPostContext, - getCanvasMode, getSettings - } = lock_unlock_unlock(select(store)); - const { - getEditedEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const usedPostType = getEditedPostType(); - const usedPostId = getEditedPostId(); - const _record = getEditedEntityRecord('postType', usedPostType, usedPostId); - const _context = getEditedPostContext(); - return { - templateSlug: _record.slug, - canvasMode: getCanvasMode(), - settings: getSettings(), - postWithTemplate: _context?.postId - }; - }, []); - const archiveLabels = useArchiveLabel(templateSlug); - const defaultRenderingMode = postWithTemplate ? 'template-locked' : 'post-only'; + } = select(store); + return { + settings: getSettings() + }; + }, []); const onNavigateToPreviousEntityRecord = useNavigateToPreviousEntityRecord(); const defaultEditorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => { return { ...settings, richEditingEnabled: true, supportsTemplateMode: true, - focusMode: canvasMode !== 'view', - defaultRenderingMode, + focusMode: canvas !== 'view', onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, - // I wonder if they should be set in the post editor too - __experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel, - __experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel, - __unstableIsPreviewMode: canvasMode === 'view' - }; - }, [settings, canvasMode, defaultRenderingMode, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel]); + isPreviewMode: canvas === 'view' + }; + }, [settings, canvas, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); return defaultEditorSettings; } -function useSiteEditorSettings() { - const defaultEditorSettings = useSpecificEditorSettings(); - const { - postType, - postId - } = useSelect(select => { - const { - getEditedPostType, - getEditedPostId - } = unlock(select(editSiteStore)); - const usedPostType = getEditedPostType(); - const usedPostId = getEditedPostId(); - return { - postType: usedPostType, - postId: usedPostId - }; - }, []); - return useBlockEditorSettings(defaultEditorSettings, postType, postId); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/plugin-template-setting-panel/index.js + +;// ./node_modules/@wordpress/edit-site/build-module/components/plugin-template-setting-panel/index.js /** * Defines an extensibility slot for the Template sidebar. */ @@ -11947,7 +11316,7 @@ */ /* harmony default export */ const plugin_template_setting_panel = (PluginTemplateSettingPanel); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/seen.js +;// ./node_modules/@wordpress/icons/build-module/library/seen.js /** * WordPress dependencies */ @@ -11962,7 +11331,7 @@ }); /* harmony default export */ const library_seen = (seen); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js +;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ @@ -11977,37 +11346,7 @@ }); /* harmony default export */ const more_vertical = (moreVertical); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js -/** - * WordPress dependencies - */ - - -const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" - }) -}); -/* harmony default export */ const chevron_left = (chevronLeft); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js -/** - * WordPress dependencies - */ - - -const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" - }) -}); -/* harmony default export */ const chevron_right = (chevronRight); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/icon-with-current-color.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/icon-with-current-color.js /** * External dependencies */ @@ -12028,16 +11367,15 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/navigation-button.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/navigation-button.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ function GenericNavigationButton({ @@ -12059,20 +11397,20 @@ }); } function NavigationButtonAsItem(props) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Button, { as: GenericNavigationButton, ...props }); } function NavigationBackButtonAsItem(props) { - return /*#__PURE__*/_jsx(NavigatorToParentButton, { + return /*#__PURE__*/_jsx(Navigator.BackButton, { as: GenericNavigationButton, ...props }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/typography.js +;// ./node_modules/@wordpress/icons/build-module/library/typography.js /** * WordPress dependencies */ @@ -12087,7 +11425,7 @@ }); /* harmony default export */ const library_typography = (typography); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/color.js +;// ./node_modules/@wordpress/icons/build-module/library/color.js /** * WordPress dependencies */ @@ -12102,7 +11440,24 @@ }); /* harmony default export */ const library_color = (color); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shadow.js +;// ./node_modules/@wordpress/icons/build-module/library/background.js +/** + * WordPress dependencies + */ + + +const background = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z" + }) +}); +/* harmony default export */ const library_background = (background); + +;// ./node_modules/@wordpress/icons/build-module/library/shadow.js /** * WordPress dependencies */ @@ -12117,20 +11472,18 @@ }); /* harmony default export */ const library_shadow = (shadow); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/root-menu.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/root-menu.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ @@ -12139,11 +11492,17 @@ useHasTypographyPanel, useHasColorPanel, useGlobalSetting: root_menu_useGlobalSetting, - useSettingsForBlockElement -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); + useSettingsForBlockElement, + useHasBackgroundPanel +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function RootMenu() { const [rawSettings] = root_menu_useGlobalSetting(''); const settings = useSettingsForBlockElement(rawSettings); + /* + * Use the raw settings to determine if the background panel should be displayed, + * as the background panel is not dependent on the block element settings. + */ + const hasBackgroundPanel = useHasBackgroundPanel(rawSettings); const hasTypographyPanel = useHasTypographyPanel(settings); const hasColorPanel = useHasColorPanel(settings); const hasShadowPanel = true; // useHasShadowPanel( settings ); @@ -12154,22 +11513,23 @@ children: [hasTypographyPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_typography, path: "/typography", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Typography styles'), children: (0,external_wp_i18n_namespaceObject.__)('Typography') }), hasColorPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_color, path: "/colors", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Colors styles'), children: (0,external_wp_i18n_namespaceObject.__)('Colors') + }), hasBackgroundPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { + icon: library_background, + path: "/background", + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Background styles'), + children: (0,external_wp_i18n_namespaceObject.__)('Background') }), hasShadowPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_shadow, path: "/shadows", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shadow styles'), children: (0,external_wp_i18n_namespaceObject.__)('Shadows') }), hasLayoutPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { icon: library_layout, path: "/layout", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Layout styles'), children: (0,external_wp_i18n_namespaceObject.__)('Layout') })] }) @@ -12177,7 +11537,7 @@ } /* harmony default export */ const root_menu = (RootMenu); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/preview-styles.js function findNearest(input, numbers) { // If the numbers array is empty, return null if (numbers.length === 0) { @@ -12305,7 +11665,7 @@ }; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js /** * * @param {string} variation The variation name. @@ -12354,7 +11714,16 @@ return fontFamilies.find(fontFamily => fontFamily.slug === fontFamilySlug); } function getFontFamilies(themeJson) { - const fontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; // TODO this could not be under theme. + const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; + const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom; + let fontFamilies = []; + if (themeFontFamilies && customFontFamilies) { + fontFamilies = [...themeFontFamilies, ...customFontFamilies]; + } else if (themeFontFamilies) { + fontFamilies = themeFontFamilies; + } else if (customFontFamilies) { + fontFamilies = customFontFamilies; + } const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily; const bodyFontFamily = getFontFamilyFromSetting(fontFamilies, bodyFontFamilySetting); const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily; @@ -12367,30 +11736,30 @@ return [bodyFontFamily, headingFontFamily]; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-example.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const { +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-example.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useGlobalStyle: typography_example_useGlobalStyle, GlobalStylesContext: typography_example_GlobalStylesContext -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - mergeBaseAndUserConfigs: typography_example_mergeBaseAndUserConfigs -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + mergeBaseAndUserConfigs +} = unlock(external_wp_editor_namespaceObject.privateApis); function PreviewTypography({ fontSize, variation @@ -12400,11 +11769,16 @@ } = (0,external_wp_element_namespaceObject.useContext)(typography_example_GlobalStylesContext); let config = base; if (variation) { - config = typography_example_mergeBaseAndUserConfigs(base, variation); - } + config = mergeBaseAndUserConfigs(base, variation); + } + const [textColor] = typography_example_useGlobalStyle('color.text'); const [bodyFontFamilies, headingFontFamilies] = getFontFamilies(config); const bodyPreviewStyle = bodyFontFamilies ? getFamilyPreviewStyle(bodyFontFamilies) : {}; const headingPreviewStyle = headingFontFamilies ? getFamilyPreviewStyle(headingFontFamilies) : {}; + if (textColor) { + bodyPreviewStyle.color = textColor; + headingPreviewStyle.color = textColor; + } if (fontSize) { bodyPreviewStyle.fontSize = fontSize; headingPreviewStyle.fontSize = fontSize; @@ -12423,7 +11797,8 @@ type: 'tween' }, style: { - textAlign: 'center' + textAlign: 'center', + lineHeight: 1 }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { style: headingPreviewStyle, @@ -12435,7 +11810,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/highlighted-colors.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/highlighted-colors.js /** * WordPress dependencies */ @@ -12478,26 +11853,23 @@ }, `${slug}-${index}`)); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-iframe.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const { - useGlobalStyle: preview_iframe_useGlobalStyle, - useGlobalStylesOutput: preview_iframe_useGlobalStylesOutput -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-wrapper.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + useGlobalStyle: preview_wrapper_useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const normalizedWidth = 248; const normalizedHeight = 152; @@ -12507,15 +11879,14 @@ leading: true, trailing: true }; -function PreviewIframe({ +function PreviewWrapper({ children, label, isFocused, withHoverView }) { - const [backgroundColor = 'white'] = preview_iframe_useGlobalStyle('color.background'); - const [gradientValue] = preview_iframe_useGlobalStyle('color.gradient'); - const [styles] = preview_iframe_useGlobalStylesOutput(); + const [backgroundColor = 'white'] = preview_wrapper_useGlobalStyle('color.background'); + const [gradientValue] = preview_wrapper_useGlobalStyle('color.gradient'); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const [containerResizeListener, { @@ -12525,7 +11896,7 @@ const [ratioState, setRatioState] = (0,external_wp_element_namespaceObject.useState)(); const setThrottledWidth = (0,external_wp_compose_namespaceObject.useThrottle)(setThrottledWidthState, 250, THROTTLE_OPTIONS); - // Must use useLayoutEffect to avoid a flash of the iframe at the wrong + // Must use useLayoutEffect to avoid a flash of the container at the wrong // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (width) { @@ -12533,7 +11904,7 @@ } }, [width, setThrottledWidth]); - // Must use useLayoutEffect to avoid a flash of the iframe at the wrong + // Must use useLayoutEffect to avoid a flash of the container at the wrong // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1; @@ -12558,21 +11929,6 @@ * See: https://github.com/WordPress/gutenberg/issues/55112 */ const ratio = ratioState ? ratioState : fallbackRatio; - - /* - * Reset leaked styles from WP common.css and remove main content layout padding and border. - * Add pointer cursor to the body to indicate the iframe is interactive, - * similar to Typography variation previews. - */ - const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (styles) { - return [...styles, { - css: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}', - isGlobalStyles: true - }]; - } - return styles; - }, [styles]); const isReady = !!width; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -12580,17 +11936,15 @@ position: 'relative' }, children: containerResizeListener - }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.__unstableIframe, { - className: "edit-site-global-styles-preview__iframe", + }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-global-styles-preview__wrapper", style: { height: normalizedHeight * ratio }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), tabIndex: -1, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { - styles: editorStyles - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { style: { height: normalizedHeight * ratio, width: '100%', @@ -12604,22 +11958,21 @@ ratio, key })) - })] - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-styles.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - + }) + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-styles.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ @@ -12628,7 +11981,7 @@ const { useGlobalStyle: preview_styles_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const firstFrameVariants = { start: { scale: 1, @@ -12672,7 +12025,7 @@ const { paletteColors } = useStylesPreviewColors(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewIframe, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewWrapper, { label: label, isFocused: isFocused, withHoverView: withHoverView, @@ -12771,22 +12124,20 @@ }; /* harmony default export */ const preview_styles = (PreviewStyles); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-root.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-root.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ @@ -12795,7 +12146,7 @@ const { useGlobalStyle: screen_root_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenRoot() { const [customCSS] = screen_root_useGlobalStyle('css'); const { @@ -12816,18 +12167,21 @@ }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Card, { size: "small", + isBorderless: true, className: "edit-site-global-styles-screen-root", + isRounded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Card, { + className: "edit-site-global-styles-screen-root__active-style-tile", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardMedia, { + className: "edit-site-global-styles-screen-root__active-style-tile-preview", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_styles, {}) }) }), hasVariations && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/variations", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Browse styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12845,7 +12199,7 @@ paddingTop: 2 /* * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border). - * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the + * This is an ad hoc override for this instance and the Additional CSS option below. Other options for matching the * the nav button inset should be looked at before reusing further. */, paddingX: "13px", @@ -12854,7 +12208,6 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/blocks", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Blocks styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12876,7 +12229,6 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: "/css", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Additional CSS'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -12893,9 +12245,9 @@ } /* harmony default export */ const screen_root = (ScreenRoot); -;// CONCATENATED MODULE: external ["wp","a11y"] +;// external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-panel.js /** * WordPress dependencies */ @@ -12912,7 +12264,7 @@ const { useGlobalStyle: variations_panel_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Only core block styles (source === block) or block styles with a matching // theme.json style variation will be configurable via Global Styles. @@ -12943,18 +12295,16 @@ } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: '/blocks/' + encodeURIComponent(name) + '/variations/' + encodeURIComponent(style.name), - "aria-label": style.label, children: style.label }, index); }) }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/header.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/header.js +/** + * WordPress dependencies + */ @@ -12973,14 +12323,7 @@ paddingY: 3, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, { - style: - // TODO: This style override is also used in ToolsPanelHeader. - // It should be supported out-of-the-box by Button. - { - minWidth: 24, - padding: 0 - }, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Back'), @@ -13003,24 +12346,22 @@ } /* harmony default export */ const header = (ScreenHeader); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block-list.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ @@ -13033,7 +12374,7 @@ useGlobalSetting: screen_block_list_useGlobalSetting, useSettingsForBlockElement: screen_block_list_useSettingsForBlockElement, useHasColorPanel: screen_block_list_useHasColorPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function useSortedBlockTypes() { const blockItems = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockTypes(), []); // Ensure core blocks are prioritized in the returned results, @@ -13078,12 +12419,8 @@ if (!hasBlockMenuItem) { return null; } - const navigationButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: is the name of a block e.g., 'Image' or 'Table'. - (0,external_wp_i18n_namespaceObject.__)('%s block styles'), block.title); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: '/blocks/' + encodeURIComponent(block.name), - "aria-label": navigationButtonLabel, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { @@ -13119,14 +12456,21 @@ // which is now one. // @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116 const count = blockTypesListRef.current.childElementCount; - const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */ + const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage, count); }, [filterValue, debouncedSpeak]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: blockTypesListRef, - className: "edit-site-block-types-item-list", - children: filteredBlockTypes.map(block => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMenuItem, { + className: "edit-site-block-types-item-list" + // By default, BlockMenuItem has a role=listitem so this div must have a list role. + , + role: "list", + children: filteredBlockTypes.length === 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + align: "center", + as: "p", + children: (0,external_wp_i18n_namespaceObject.__)('No blocks found.') + }) : filteredBlockTypes.map(block => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMenuItem, { block: block }, 'menu-itemblock-' + block.name)) }); @@ -13144,7 +12488,7 @@ className: "edit-site-block-types-search", onChange: setFilterValue, value: filterValue, - label: (0,external_wp_i18n_namespaceObject.__)('Search for blocks'), + label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, { filterValue: deferredFilterValue @@ -13153,7 +12497,7 @@ } /* harmony default export */ const screen_block_list = (ScreenBlockList); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/block-preview-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/block-preview-panel.js /** * WordPress dependencies */ @@ -13177,20 +12521,22 @@ if (!blockExample) { return null; } - let example = blockExample; - if (variation) { - example = { - ...example, - attributes: { - ...example.attributes, - className: getVariationClassName(variation) - } - }; - } + const example = { + ...blockExample, + attributes: { + ...blockExample.attributes, + style: undefined, + className: variation ? getVariationClassName(variation) : blockExample.attributes?.className + } + }; return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, example); }, [name, blockExample, variation]); - const viewportWidth = (_blockExample$viewpor = blockExample?.viewportWidth) !== null && _blockExample$viewpor !== void 0 ? _blockExample$viewpor : null; - const previewHeight = 150; + const viewportWidth = (_blockExample$viewpor = blockExample?.viewportWidth) !== null && _blockExample$viewpor !== void 0 ? _blockExample$viewpor : 500; + // Same as height of InserterPreviewPanel. + const previewHeight = 144; + const sidebarWidth = 235; + const scale = sidebarWidth / viewportWidth; + const minHeight = scale !== 0 && scale < 1 && previewHeight ? previewHeight / scale : previewHeight; if (!blockExample) { return null; } @@ -13207,12 +12553,17 @@ blocks: blocks, viewportWidth: viewportWidth, minHeight: previewHeight, - additionalStyles: [{ + additionalStyles: + //We want this CSS to be in sync with the one in InserterPreviewPanel. + [{ css: ` body{ - min-height:${previewHeight}px; - display:flex;align-items:center;justify-content:center; + padding: 24px; + min-height:${Math.round(minHeight)}px; + display:flex; + align-items:center; } + .is-root-container { width: 100%; } ` }] }) @@ -13221,7 +12572,7 @@ }; /* harmony default export */ const block_preview_panel = (BlockPreviewPanel); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/subtitle.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/subtitle.js /** * WordPress dependencies */ @@ -13239,29 +12590,34 @@ } /* harmony default export */ const subtitle = (Subtitle); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-block.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + + +// Initial control values. + +const BACKGROUND_BLOCK_DEFAULT_VALUES = { + backgroundSize: 'cover', + backgroundPosition: '50% 50%' // used only when backgroundSize is 'contain'. +}; function applyFallbackStyle(border) { if (!border) { return border; @@ -13302,6 +12658,8 @@ useHasFiltersPanel, useHasImageSettingsPanel, useGlobalStyle: screen_block_useGlobalStyle, + useHasBackgroundPanel: screen_block_useHasBackgroundPanel, + BackgroundPanel: StylesBackgroundPanel, BorderPanel: StylesBorderPanel, ColorPanel: StylesColorPanel, TypographyPanel: StylesTypographyPanel, @@ -13309,7 +12667,7 @@ FiltersPanel: StylesFiltersPanel, ImageSettingsPanel, AdvancedPanel: StylesAdvancedPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenBlock({ name, variation @@ -13327,12 +12685,13 @@ }); const [userSettings] = screen_block_useGlobalSetting('', name, 'user'); const [rawSettings, setSettings] = screen_block_useGlobalSetting('', name); - const settings = screen_block_useSettingsForBlockElement(rawSettings, name); + const settingsForBlockElement = screen_block_useSettingsForBlockElement(rawSettings, name); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); // Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied. - if (settings?.spacing?.blockGap && blockType?.supports?.spacing?.blockGap && (blockType?.supports?.spacing?.__experimentalSkipSerialization === true || blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(spacingType => spacingType === 'blockGap'))) { - settings.spacing.blockGap = false; + let disableBlockGap = false; + if (settingsForBlockElement?.spacing?.blockGap && blockType?.supports?.spacing?.blockGap && (blockType?.supports?.spacing?.__experimentalSkipSerialization === true || blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(spacingType => spacingType === 'blockGap'))) { + disableBlockGap = true; } // Only allow `aspectRatio` support if the block is not the grouping block. @@ -13341,10 +12700,22 @@ // for all three at once. Until there is the ability to set a different aspect // ratio for each variation, we disable the aspect ratio controls for the // grouping block in global styles. - if (settings?.dimensions?.aspectRatio && name === 'core/group') { - settings.dimensions.aspectRatio = false; - } + let disableAspectRatio = false; + if (settingsForBlockElement?.dimensions?.aspectRatio && name === 'core/group') { + disableAspectRatio = true; + } + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { + const updatedSettings = structuredClone(settingsForBlockElement); + if (disableBlockGap) { + updatedSettings.spacing.blockGap = false; + } + if (disableAspectRatio) { + updatedSettings.dimensions.aspectRatio = false; + } + return updatedSettings; + }, [settingsForBlockElement, disableBlockGap, disableAspectRatio]); const blockVariations = useBlockVariations(name); + const hasBackgroundPanel = screen_block_useHasBackgroundPanel(settings); const hasTypographyPanel = screen_block_useHasTypographyPanel(settings); const hasColorPanel = screen_block_useHasColorPanel(settings); const hasBorderPanel = screen_block_useHasBorderPanel(settings); @@ -13477,6 +12848,12 @@ value: style, onChange: setStyle, settings: settings + }), hasBackgroundPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StylesBackgroundPanel, { + inheritedValue: inheritedStyle, + value: style, + onChange: setStyle, + settings: settings, + defaultValues: BACKGROUND_BLOCK_DEFAULT_VALUES }), hasTypographyPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StylesTypographyPanel, { inheritedValue: inheritedStyle, value: style, @@ -13520,25 +12897,24 @@ } /* harmony default export */ const screen_block = (ScreenBlock); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-elements.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-elements.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ const { useGlobalStyle: typography_elements_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ElementItem({ parentMenu, element, @@ -13552,17 +12928,12 @@ const [fontFamily] = typography_elements_useGlobalStyle(prefix + 'typography.fontFamily'); const [fontStyle] = typography_elements_useGlobalStyle(prefix + 'typography.fontStyle'); const [fontWeight] = typography_elements_useGlobalStyle(prefix + 'typography.fontWeight'); - const [letterSpacing] = typography_elements_useGlobalStyle(prefix + 'typography.letterSpacing'); const [backgroundColor] = typography_elements_useGlobalStyle(prefix + 'color.background'); const [fallbackBackgroundColor] = typography_elements_useGlobalStyle('color.background'); const [gradientValue] = typography_elements_useGlobalStyle(prefix + 'color.gradient'); const [color] = typography_elements_useGlobalStyle(prefix + 'color.text'); - const navigationButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: is a subset of Typography, e.g., 'text' or 'links'. - (0,external_wp_i18n_namespaceObject.__)('Typography %s styles'), label); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: parentMenu + '/typography/' + element, - "aria-label": navigationButtonLabel, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { @@ -13573,9 +12944,9 @@ color, fontStyle, fontWeight, - letterSpacing, ...extraStyles }, + "aria-hidden": "true", children: (0,external_wp_i18n_namespaceObject.__)('Aa') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: label @@ -13619,7 +12990,196 @@ } /* harmony default export */ const typography_elements = (TypographyElements); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variation.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-typography.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const StylesPreviewTypography = ({ + variation, + isFocused, + withHoverView +}) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewWrapper, { + label: variation.title, + isFocused: isFocused, + withHoverView: withHoverView, + children: ({ + ratio, + key + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 10 * ratio, + justify: "center", + style: { + height: '100%', + overflow: 'hidden' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewTypography, { + variation: variation, + fontSize: 85 * ratio + }) + }, key) + }); +}; +/* harmony default export */ const preview_typography = (StylesPreviewTypography); + +;// ./node_modules/@wordpress/edit-site/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +/* wp:polyfill */ +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + +const use_theme_style_variations_by_property_EMPTY_ARRAY = []; +const { + GlobalStylesContext: use_theme_style_variations_by_property_GlobalStylesContext, + areGlobalStyleConfigsEqual +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + mergeBaseAndUserConfigs: use_theme_style_variations_by_property_mergeBaseAndUserConfigs +} = unlock(external_wp_editor_namespaceObject.privateApis); + +/** + * Removes all instances of properties from an object. + * + * @param {Object} object The object to remove the properties from. + * @param {string[]} properties The properties to remove. + * @return {Object} The modified object. + */ +function removePropertiesFromObject(object, properties) { + if (!properties?.length) { + return object; + } + if (typeof object !== 'object' || !object || !Object.keys(object).length) { + return object; + } + for (const key in object) { + if (properties.includes(key)) { + delete object[key]; + } else if (typeof object[key] === 'object') { + removePropertiesFromObject(object[key], properties); + } + } + return object; +} + +/** + * Checks whether a style variation is empty. + * + * @param {Object} variation A style variation object. + * @param {string} variation.title The title of the variation. + * @param {Object} variation.settings The settings of the variation. + * @param {Object} variation.styles The styles of the variation. + * @return {boolean} Whether the variation is empty. + */ +function hasThemeVariation({ + title, + settings, + styles +}) { + return title === (0,external_wp_i18n_namespaceObject.__)('Default') || + // Always preserve the default variation. + Object.keys(settings).length > 0 || Object.keys(styles).length > 0; +} + +/** + * Fetches the current theme style variations that contain only the specified properties + * and merges them with the user config. + * + * @param {string[]} properties The properties to filter by. + * @return {Object[]|*} The merged object. + */ +function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) { + const { + variationsFromTheme + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const _variationsFromTheme = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); + return { + variationsFromTheme: _variationsFromTheme || use_theme_style_variations_by_property_EMPTY_ARRAY + }; + }, []); + const { + user: userVariation + } = (0,external_wp_element_namespaceObject.useContext)(use_theme_style_variations_by_property_GlobalStylesContext); + const propertiesAsString = properties.toString(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const clonedUserVariation = structuredClone(userVariation); + + // Get user variation and remove the settings for the given property. + const userVariationWithoutProperties = removePropertiesFromObject(clonedUserVariation, properties); + userVariationWithoutProperties.title = (0,external_wp_i18n_namespaceObject.__)('Default'); + const variationsWithPropertiesAndBase = variationsFromTheme.filter(variation => { + return isVariationWithProperties(variation, properties); + }).map(variation => { + return use_theme_style_variations_by_property_mergeBaseAndUserConfigs(userVariationWithoutProperties, variation); + }); + const variationsByProperties = [userVariationWithoutProperties, ...variationsWithPropertiesAndBase]; + + /* + * Filter out variations with no settings or styles. + */ + return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : []; + }, [propertiesAsString, userVariation, variationsFromTheme]); +} + +/** + * Returns a new object, with properties specified in `properties` array., + * maintain the original object tree structure. + * The function is recursive, so it will perform a deep search for the given properties. + * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`. + * + * @param {Object} object The object to filter + * @param {string[]} properties The properties to filter by + * @return {Object} The merged object. + */ +const filterObjectByProperties = (object, properties) => { + if (!object || !properties?.length) { + return {}; + } + const newObject = {}; + Object.keys(object).forEach(key => { + if (properties.includes(key)) { + newObject[key] = object[key]; + } else if (typeof object[key] === 'object') { + const newFilter = filterObjectByProperties(object[key], properties); + if (Object.keys(newFilter).length) { + newObject[key] = newFilter; + } + } + }); + return newObject; +}; + +/** + * Compares a style variation to the same variation filtered by the specified properties. + * Returns true if the variation contains only the properties specified. + * + * @param {Object} variation The variation to compare. + * @param {string[]} properties The properties to compare. + * @return {boolean} Whether the variation contains only the specified properties. + */ +function isVariationWithProperties(variation, properties) { + const variationWithProperties = filterObjectByProperties(structuredClone(variation), properties); + return areGlobalStyleConfigsEqual(variationWithProperties, variation); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variation.js /** * External dependencies */ @@ -13634,6 +13194,7 @@ + /** * Internal dependencies */ @@ -13642,16 +13203,17 @@ const { mergeBaseAndUserConfigs: variation_mergeBaseAndUserConfigs -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); const { GlobalStylesContext: variation_GlobalStylesContext, - areGlobalStyleConfigsEqual -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); + areGlobalStyleConfigsEqual: variation_areGlobalStyleConfigsEqual +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function Variation({ variation, children, isPill, - property + properties, + showTooltip }) { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); const { @@ -13661,8 +13223,8 @@ } = (0,external_wp_element_namespaceObject.useContext)(variation_GlobalStylesContext); const context = (0,external_wp_element_namespaceObject.useMemo)(() => { let merged = variation_mergeBaseAndUserConfigs(base, variation); - if (property) { - merged = filterObjectByProperty(merged, property); + if (properties) { + merged = filterObjectByProperties(merged, properties); } return { user: variation, @@ -13670,7 +13232,7 @@ merged, setUserConfig: () => {} }; - }, [variation, base, property]); + }, [variation, base, properties]); const selectVariation = () => setUserConfig(variation); const selectOnEnter = event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { @@ -13678,47 +13240,49 @@ selectVariation(); } }; - const isActive = (0,external_wp_element_namespaceObject.useMemo)(() => areGlobalStyleConfigsEqual(user, variation), [user, variation]); + const isActive = (0,external_wp_element_namespaceObject.useMemo)(() => variation_areGlobalStyleConfigsEqual(user, variation), [user, variation]); let label = variation?.title; if (variation?.description) { - label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: variation title. %2$s variation description. */ - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), variation?.title, variation?.description); - } + label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: variation title. 2: variation description. */ + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'variation label'), variation?.title, variation?.description); + } + const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('edit-site-global-styles-variations_item', { + 'is-active': isActive + }), + role: "button", + onClick: selectVariation, + onKeyDown: selectOnEnter, + tabIndex: "0", + "aria-label": label, + "aria-current": isActive, + onFocus: () => setIsFocused(true), + onBlur: () => setIsFocused(false), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('edit-site-global-styles-variations_item-preview', { + 'is-pill': isPill + }), + children: children(isFocused) + }) + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(variation_GlobalStylesContext.Provider, { value: context, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('edit-site-global-styles-variations_item', { - 'is-active': isActive - }), - role: "button", - onClick: selectVariation, - onKeyDown: selectOnEnter, - tabIndex: "0", - "aria-label": label, - "aria-current": isActive, - onFocus: () => setIsFocused(true), - onBlur: () => setIsFocused(false), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('edit-site-global-styles-variations_item-preview', { - 'is-pill': isPill - }), - children: children(isFocused) - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-typography.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - + children: showTooltip ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { + text: variation?.title, + children: content + }) : content + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-typography.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ @@ -13728,7 +13292,8 @@ title, gap = 2 }) { - const typographyVariations = useTypographyVariations(); + const propertiesToFilter = ['typography']; + const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter); // Return null if there is only one variation (the default). if (typographyVariations?.length <= 1) { @@ -13743,38 +13308,66 @@ columns: 3, gap: gap, className: "edit-site-global-styles-style-variations-container", - children: typographyVariations && typographyVariations.length && typographyVariations.map((variation, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Variation, { - variation: variation, - property: "typography", - children: isFocused => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewIframe, { - label: variation?.title, - isFocused: isFocused, - children: ({ - ratio, - key - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 10 * ratio, - justify: "center", - style: { - height: '100%', - overflow: 'hidden' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewTypography, { - variation: variation, - fontSize: 85 * ratio - }) - }, key) - }) - }, index)) - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js -/** - * WordPress dependencies - */ - + children: typographyVariations.map((variation, index) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Variation, { + variation: variation, + properties: propertiesToFilter, + showTooltip: true, + children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_typography, { + variation: variation + }) + }, index); + }) + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-sizes-count.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + +function FontSizes() { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 2, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "space-between", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle, { + level: 3, + children: (0,external_wp_i18n_namespaceObject.__)('Font Sizes') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { + path: "/typography/font-sizes", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + direction: "row", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: (0,external_wp_i18n_namespaceObject.__)('Font size presets') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right + })] + }) + }) + })] + }); +} +/* harmony default export */ const font_sizes_count = (FontSizes); + +;// ./node_modules/@wordpress/icons/build-module/library/settings.js +/** + * WordPress dependencies + */ const settings_settings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { @@ -13788,10 +13381,7 @@ }); /* harmony default export */ const library_settings = (settings_settings); -;// CONCATENATED MODULE: external ["wp","apiFetch"] -const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; -var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/resolvers.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/resolvers.js /** * WordPress dependencies */ @@ -13861,7 +13451,7 @@ return await external_wp_apiFetch_default()(config); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/constants.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/constants.js /** * WordPress dependencies */ @@ -13883,7 +13473,7 @@ italic: (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style') }; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/index.js /** * WordPress dependencies */ @@ -13905,7 +13495,7 @@ } = window; const { kebabCase -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_components_namespaceObject.privateApis); function setUIValuesNeeded(font, extraValues = {}) { if (!font.name && (font.fontFamily || font.slug)) { font.name = font.fontFamily || font.slug; @@ -14177,7 +13767,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/toggleFont.js /** * Toggles the activation of a given font or font variant within a list of custom fonts. * @@ -14264,7 +13854,7 @@ return toggleFontVariant(activatedFont); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/context.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/context.js /** * WordPress dependencies */ @@ -14281,7 +13871,7 @@ const { useGlobalSetting: context_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); @@ -14306,7 +13896,6 @@ const globalStyles = (0,external_wp_coreData_namespaceObject.useEntityRecord)('root', 'globalStyles', globalStylesId); const [isInstalling, setIsInstalling] = (0,external_wp_element_namespaceObject.useState)(false); const [refreshKey, setRefreshKey] = (0,external_wp_element_namespaceObject.useState)(0); - const [notice, setNotice] = (0,external_wp_element_namespaceObject.useState)(null); const refreshLibrary = () => { setRefreshKey(Date.now()); }; @@ -14369,8 +13958,6 @@ } }, [modalTabOpen]); const handleSetLibraryFontSelected = font => { - setNotice(null); - // If font is null, reset the selected font if (!font) { setLibraryFontSelected(null); @@ -14584,9 +14171,9 @@ }); const isFaceActivated = isFontActivated(font.slug, face?.fontStyle, face?.fontWeight, font.source); if (isFaceActivated) { - loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face?.src), 'all'); + unloadFontFaceInBrowser(face, 'all'); } else { - unloadFontFaceInBrowser(face, 'all'); + loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face?.src), 'all'); } }; const loadFontFaceAsset = async fontFace => { @@ -14649,8 +14236,6 @@ modalTabOpen, setModalTabOpen, refreshLibrary, - notice, - setNotice, saveFontFamilies, isResolvingLibrary, isInstalling, @@ -14662,7 +14247,7 @@ } /* harmony default export */ const context = (FontLibraryProvider); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-demo.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-demo.js /** * WordPress dependencies */ @@ -14760,17 +14345,16 @@ } /* harmony default export */ const font_demo = (FontDemo); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-card.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-card.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ @@ -14784,8 +14368,9 @@ const style = { cursor: !!onClick ? 'pointer' : 'default' }; - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, onClick: () => { onClick(); if (navigatorPath) { @@ -14804,12 +14389,12 @@ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "font-library-modal__font-card__count", - children: variantsText || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of font variants. */ + children: variantsText || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of font variants. */ (0,external_wp_i18n_namespaceObject._n)('%d variant', '%d variants', variantsCount), variantsCount) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: chevron_right + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right }) })] })] @@ -14818,25 +14403,20 @@ } /* harmony default export */ const font_card = (FontCard); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/library-font-variant.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -const { - kebabCase: library_font_variant_kebabCase -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/library-font-variant.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + function LibraryFontVariant({ face, font @@ -14854,7 +14434,7 @@ toggleActivateFont(font); }; const displayName = font.name + ' ' + getFontFaceVariantName(face); - const checkboxId = library_font_variant_kebabCase(`${font.slug}-${getFontFaceVariantName(face)}`); + const checkboxId = (0,external_wp_element_namespaceObject.useId)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__font-card", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { @@ -14879,7 +14459,7 @@ } /* harmony default export */ const library_font_variant = (LibraryFontVariant); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js function getNumericFontWeight(value) { switch (value) { case 'normal': @@ -14914,23 +14494,21 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/installed-fonts.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/installed-fonts.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ @@ -14940,8 +14518,9 @@ const { useGlobalSetting: installed_fonts_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function InstalledFonts() { + var _libraryFontSelected$; const { baseCustomFonts, libraryFontSelected, @@ -14951,12 +14530,11 @@ isResolvingLibrary, isInstalling, saveFontFamilies, - getFontFacesActivated, - notice, - setNotice, - fontFamilies + getFontFacesActivated } = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext); + const [fontFamilies, setFontFamilies] = installed_fonts_useGlobalSetting('typography.fontFamilies'); const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const [notice, setNotice] = (0,external_wp_element_namespaceObject.useState)(false); const [baseFontFamilies] = installed_fonts_useGlobalSetting('typography.fontFamilies', undefined, 'base'); const globalStylesId = (0,external_wp_data_namespaceObject.useSelect)(select => { const { @@ -14978,12 +14556,32 @@ const { canUser } = select(external_wp_coreData_namespaceObject.store); - return customFontFamilyId && canUser('delete', 'font-families', customFontFamilyId); + return customFontFamilyId && canUser('delete', { + kind: 'postType', + name: 'wp_font_family', + id: customFontFamilyId + }); }, [customFontFamilyId]); const shouldDisplayDeleteButton = !!libraryFontSelected && libraryFontSelected?.source !== 'theme' && canUserDelete; const handleUninstallClick = () => { setIsConfirmDeleteOpen(true); }; + const handleUpdate = async () => { + setNotice(null); + try { + await saveFontFamilies(fontFamilies); + setNotice({ + type: 'success', + message: (0,external_wp_i18n_namespaceObject.__)('Font family updated successfully.') + }); + } catch (error) { + setNotice({ + type: 'error', + message: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message */ + (0,external_wp_i18n_namespaceObject.__)('There was an error updating the font family. %s'), error.message) + }); + } + }; const getFontFacesToDisplay = font => { if (!font) { return []; @@ -15000,22 +14598,53 @@ const getFontCardVariantsText = font => { const variantsInstalled = font?.fontFace?.length > 0 ? font.fontFace.length : 1; const variantsActive = getFontFacesActivated(font.slug, font.source).length; - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Active font variants, 2: Total font variants. */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Active font variants, 2: Total font variants. */ (0,external_wp_i18n_namespaceObject.__)('%1$s/%2$s variants active'), variantsActive, variantsInstalled); }; (0,external_wp_element_namespaceObject.useEffect)(() => { handleSetLibraryFontSelected(libraryFontSelected); refreshLibrary(); }, []); + + // Get activated fonts count. + const activeFontsCount = libraryFontSelected ? getFontFacesActivated(libraryFontSelected.slug, libraryFontSelected.source).length : 0; + const selectedFontsCount = (_libraryFontSelected$ = libraryFontSelected?.fontFace?.length) !== null && _libraryFontSelected$ !== void 0 ? _libraryFontSelected$ : libraryFontSelected?.fontFamily ? 1 : 0; + + // Check if any fonts are selected. + const isIndeterminate = activeFontsCount > 0 && activeFontsCount !== selectedFontsCount; + + // Check if all fonts are selected. + const isSelectAllChecked = activeFontsCount === selectedFontsCount; + + // Toggle select all fonts. + const toggleSelectAll = () => { + var _fontFamilies$library; + const initialFonts = (_fontFamilies$library = fontFamilies?.[libraryFontSelected.source]?.filter(f => f.slug !== libraryFontSelected.slug)) !== null && _fontFamilies$library !== void 0 ? _fontFamilies$library : []; + const newFonts = isSelectAllChecked ? initialFonts : [...initialFonts, libraryFontSelected]; + setFontFamilies({ + ...fontFamilies, + [libraryFontSelected.source]: newFonts + }); + if (libraryFontSelected.fontFace) { + libraryFontSelected.fontFace.forEach(face => { + if (isSelectAllChecked) { + unloadFontFaceInBrowser(face, 'all'); + } else { + loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face?.src), 'all'); + } + }); + } + }; + const hasFonts = baseThemeFonts.length > 0 || baseCustomFonts.length > 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "font-library-modal__tabpanel-layout", children: [isResolvingLibrary && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }), !isResolvingLibrary && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: libraryFontSelected ? '/fontFamily' : '/', - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "8", @@ -15023,10 +14652,35 @@ status: notice.type, onRemove: () => setNotice(null), children: notice.message + }), !hasFonts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + as: "p", + children: (0,external_wp_i18n_namespaceObject.__)('No fonts installed.') + }), baseThemeFonts.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { + className: "font-library-modal__fonts-title", + children: /* translators: Heading for a list of fonts provided by the theme. */ + (0,external_wp_i18n_namespaceObject._x)('Theme', 'font source') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + role: "list", + className: "font-library-modal__fonts-list", + children: baseThemeFonts.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { + className: "font-library-modal__fonts-list-item", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_card, { + font: font, + navigatorPath: "/fontFamily", + variantsText: getFontCardVariantsText(font), + onClick: () => { + setNotice(null); + handleSetLibraryFontSelected(font); + } + }) + }, font.slug)) + })] }), baseCustomFonts.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "font-library-modal__fonts-title", - children: (0,external_wp_i18n_namespaceObject.__)('Installed Fonts') + children: /* translators: Heading for a list of fonts installed by the user. */ + (0,external_wp_i18n_namespaceObject._x)('Custom', 'font source') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { role: "list", className: "font-library-modal__fonts-list", @@ -15037,25 +14691,7 @@ navigatorPath: "/fontFamily", variantsText: getFontCardVariantsText(font), onClick: () => { - handleSetLibraryFontSelected(font); - } - }) - }, font.slug)) - })] - }), baseThemeFonts.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { - className: "font-library-modal__fonts-title", - children: (0,external_wp_i18n_namespaceObject.__)('Theme Fonts') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { - role: "list", - className: "font-library-modal__fonts-list", - children: baseThemeFonts.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { - className: "font-library-modal__fonts-list-item", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_card, { - font: font, - navigatorPath: "/fontFamily", - variantsText: getFontCardVariantsText(font), - onClick: () => { + setNotice(null); handleSetLibraryFontSelected(font); } }) @@ -15063,7 +14699,7 @@ })] })] }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConfirmDeleteDialog, { font: libraryFontSelected, @@ -15074,11 +14710,12 @@ handleSetLibraryFontSelected: handleSetLibraryFontSelected }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, { - icon: chevron_left, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", onClick: () => { handleSetLibraryFontSelected(null); + setNotice(null); }, label: (0,external_wp_i18n_namespaceObject.__)('Back') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { @@ -15105,29 +14742,43 @@ margin: 4 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { + className: "font-library-modal__select-all", + label: (0,external_wp_i18n_namespaceObject.__)('Select all'), + checked: isSelectAllChecked, + onChange: toggleSelectAll, + indeterminate: isIndeterminate, + __nextHasNoMarginBottom: true + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 8 - }), getFontFacesToDisplay(libraryFontSelected).map((face, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(library_font_variant, { - font: libraryFontSelected, - face: face - }, `face${i}`))] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + role: "list", + className: "font-library-modal__fonts-list", + children: getFontFacesToDisplay(libraryFontSelected).map((face, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { + className: "font-library-modal__fonts-list-item", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(library_font_variant, { + font: libraryFontSelected, + face: face + }, `face${i}`) + }, `face${i}`)) + })] })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-end", - className: "font-library-modal__tabpanel-layout__footer", + className: "font-library-modal__footer", children: [isInstalling && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}), shouldDisplayDeleteButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, isDestructive: true, variant: "tertiary", onClick: handleUninstallClick, children: (0,external_wp_i18n_namespaceObject.__)('Delete') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", - onClick: () => { - saveFontFamilies(fontFamilies); - }, + onClick: handleUpdate, disabled: !fontFamiliesHasChanges, - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, children: (0,external_wp_i18n_namespaceObject.__)('Update') })] })] @@ -15142,7 +14793,7 @@ uninstallFontFamily, handleSetLibraryFontSelected }) { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const handleConfirmUninstall = async () => { setNotice(null); setIsOpen(false); @@ -15157,7 +14808,7 @@ } catch (error) { setNotice({ type: 'error', - message: (0,external_wp_i18n_namespaceObject.__)('There was an error uninstalling the font family. ') + error.message + message: (0,external_wp_i18n_namespaceObject.__)('There was an error uninstalling the font family.') + error.message }); } }; @@ -15171,13 +14822,43 @@ onCancel: handleCancelUninstall, onConfirm: handleConfirmUninstall, size: "medium", - children: font && (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the font. */ + children: font && (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the font. */ (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" font and all its variants and assets?'), font.name) }); } /* harmony default export */ const installed_fonts = (InstalledFonts); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +;// ./node_modules/@wordpress/icons/build-module/library/next.js +/** + * WordPress dependencies + */ + + +const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" + }) +}); +/* harmony default export */ const library_next = (next); + +;// ./node_modules/@wordpress/icons/build-module/library/previous.js +/** + * WordPress dependencies + */ + + +const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" + }) +}); +/* harmony default export */ const library_previous = (previous); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js /** * Filters a list of fonts based on the specified filters. * @@ -15208,7 +14889,7 @@ return filteredFonts; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js function getFontsOutline(fonts) { return fonts.reduce((acc, font) => ({ ...acc, @@ -15225,11 +14906,10 @@ return !!outline[slug]?.[`${face.fontStyle}-${face.fontWeight}`]; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +/** + * WordPress dependencies + */ @@ -15270,23 +14950,19 @@ } /* harmony default export */ const google_fonts_confirm_dialog = (GoogleFontsConfirmDialog); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/collection-font-variant.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -const { - kebabCase: collection_font_variant_kebabCase -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/collection-font-variant.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + function CollectionFontVariant({ face, font, @@ -15301,7 +14977,7 @@ handleToggleVariant(font); }; const displayName = font.name + ' ' + getFontFaceVariantName(face); - const checkboxId = collection_font_variant_kebabCase(`${font.slug}-${getFontFaceVariantName(face)}`); + const checkboxId = (0,external_wp_element_namespaceObject.useId)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__font-card", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { @@ -15326,21 +15002,19 @@ } /* harmony default export */ const collection_font_variant = (CollectionFontVariant); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-collection.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/font-collection.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -15366,6 +15040,7 @@ return window.localStorage.getItem(LOCAL_STORAGE_ITEM) === 'true'; }; const [selectedFont, setSelectedFont] = (0,external_wp_element_namespaceObject.useState)(null); + const [notice, setNotice] = (0,external_wp_element_namespaceObject.useState)(false); const [fontsToInstall, setFontsToInstall] = (0,external_wp_element_namespaceObject.useState)([]); const [page, setPage] = (0,external_wp_element_namespaceObject.useState)(1); const [filters, setFilters] = (0,external_wp_element_namespaceObject.useState)({}); @@ -15374,9 +15049,7 @@ collections, getFontCollection, installFonts, - isInstalling, - notice, - setNotice + isInstalling } = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext); const selectedCollection = collections.find(collection => collection.slug === slug); (0,external_wp_element_namespaceObject.useEffect)(() => { @@ -15409,8 +15082,7 @@ }, [slug, getFontCollection, setNotice, notice]); (0,external_wp_element_namespaceObject.useEffect)(() => { setSelectedFont(null); - setNotice(null); - }, [slug, setNotice]); + }, [slug]); (0,external_wp_element_namespaceObject.useEffect)(() => { // If the selected fonts change, reset the selected fonts to install setFontsToInstall([]); @@ -15459,6 +15131,19 @@ const resetFontsToInstall = () => { setFontsToInstall([]); }; + const selectFontCount = fontsToInstall.length > 0 ? fontsToInstall[0]?.fontFace?.length : 0; + + // Check if any fonts are selected. + const isIndeterminate = selectFontCount > 0 && selectFontCount !== selectedFont?.fontFace?.length; + + // Check if all fonts are selected. + const isSelectAllChecked = selectFontCount === selectedFont?.fontFace?.length; + + // Toggle select all fonts. + const toggleSelectAll = () => { + const newFonts = isSelectAllChecked ? [] : [selectedFont]; + setFontsToInstall(newFonts); + }; const handleInstall = async () => { setNotice(null); const fontFamily = fontsToInstall[0]; @@ -15531,10 +15216,10 @@ className: "font-library-modal__loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ProgressBar, {}) }), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: "/", className: "font-library-modal__tabpanel-layout", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", @@ -15562,6 +15247,8 @@ }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Category'), value: filters.category, onChange: handleCategoryFilter, @@ -15575,9 +15262,9 @@ margin: 4 }), !!selectedCollection?.font_families?.length && !fonts.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: (0,external_wp_i18n_namespaceObject.__)('No fonts found. Try with a different search term') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "font-library-modal__fonts-grid__main", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { role: "list", className: "font-library-modal__fonts-list", children: items.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { @@ -15590,14 +15277,14 @@ } }) }, font.font_family_settings.slug)) - }), ' '] + }) })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/fontFamily", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorToParentButton, { - icon: chevron_left, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", onClick: () => { setSelectedFont(null); @@ -15626,62 +15313,63 @@ children: (0,external_wp_i18n_namespaceObject.__)('Select font variants to install.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 4 - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { + className: "font-library-modal__select-all", + label: (0,external_wp_i18n_namespaceObject.__)('Select all'), + checked: isSelectAllChecked, + onChange: toggleSelectAll, + indeterminate: isIndeterminate, + __nextHasNoMarginBottom: true + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { - margin: 8 - }), getSortedFontFaces(selectedFont).map((face, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(collection_font_variant, { - font: selectedFont, - face: face, - handleToggleVariant: handleToggleVariant, - selected: isFontFontFaceInOutline(selectedFont.slug, selectedFont.fontFace ? face : null, - // If the font has no fontFace, we want to check if the font is in the outline - fontToInstallOutline) - }, `face${i}`))] + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { + role: "list", + className: "font-library-modal__fonts-list", + children: getSortedFontFaces(selectedFont).map((face, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { + className: "font-library-modal__fonts-list-item", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(collection_font_variant, { + font: selectedFont, + face: face, + handleToggleVariant: handleToggleVariant, + selected: isFontFontFaceInOutline(selectedFont.slug, selectedFont.fontFace ? face : null, + // If the font has no fontFace, we want to check if the font is in the outline + fontToInstallOutline) + }) + }, `face${i}`)) + }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { margin: 16 })] })] }), selectedFont && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { justify: "flex-end", - className: "font-library-modal__tabpanel-layout__footer", + className: "font-library-modal__footer", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", onClick: handleInstall, isBusy: isInstalling, disabled: fontsToInstall.length === 0 || isInstalling, - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, children: (0,external_wp_i18n_namespaceObject.__)('Install') }) - }), !selectedFont && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { - justify: "center", - className: "font-library-modal__tabpanel-layout__footer", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('First page'), - size: "compact", - onClick: () => setPage(1), - disabled: page === 1, - __experimentalIsFocusable: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: "\xAB" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), - size: "compact", - onClick: () => setPage(page - 1), - disabled: page === 1, - __experimentalIsFocusable: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: "\u2039" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + }), !selectedFont && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + className: "font-library-modal__footer", + justify: "end", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", expanded: false, - spacing: 2, + spacing: 1, + className: "font-library-modal__page-selection", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Total number of pages. - (0,external_wp_i18n_namespaceObject._x)('Page of %s', 'paging'), totalPages), { - CurrentPageControl: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + // translators: 1: Current page number, 2: Total number of pages. + (0,external_wp_i18n_namespaceObject._x)('
Page
%1$s
of %2$s
', 'paging'), '', totalPages), { + div: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + "aria-hidden": true + }), + CurrentPage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { "aria-label": (0,external_wp_i18n_namespaceObject.__)('Current page'), value: page, options: [...Array(totalPages)].map((e, i) => { @@ -15691,28 +15379,33 @@ }; }), onChange: newPage => setPage(parseInt(newPage)), - size: "compact", - __nextHasNoMarginBottom: true + size: "small", + __nextHasNoMarginBottom: true, + variant: "minimal" }) }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Next page'), - size: "compact", - onClick: () => setPage(page + 1), - disabled: page === totalPages, - __experimentalIsFocusable: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: "\u203A" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Last page'), - size: "compact", - onClick: () => setPage(totalPages), - disabled: page === totalPages, - __experimentalIsFocusable: true, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: "\xBB" - }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + spacing: 1, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => setPage(page - 1), + disabled: page === 1, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_next : library_previous, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => setPage(page + 1), + disabled: page === totalPages, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Next page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_previous : library_next, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + })] })] })] })] @@ -15726,7 +15419,37 @@ // EXTERNAL MODULE: ./node_modules/@wordpress/edit-site/lib/inflate.js var inflate = __webpack_require__(4660); var inflate_default = /*#__PURE__*/__webpack_require__.n(inflate); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/lib/lib-font.browser.js +;// ./node_modules/@wordpress/edit-site/lib/lib-font.browser.js +/** + * Credits: + * + * lib-font + * https://github.com/Pomax/lib-font + * https://github.com/Pomax/lib-font/blob/master/lib-font.browser.js + * + * The MIT License (MIT) + * + * Copyright (c) 2020 pomax@nihongoresources.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /* eslint eslint-comments/no-unlimited-disable: 0 */ /* eslint-disable */ // import pako from 'pako'; @@ -19559,7 +19282,7 @@ /* eslint-enable */ -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js /** * WordPress dependencies */ @@ -19571,7 +19294,7 @@ const { kebabCase: make_families_from_faces_kebabCase -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_components_namespaceObject.privateApis); function makeFamiliesFromFaces(fontFaces) { const fontFamiliesObject = fontFaces.reduce((acc, item) => { if (!acc[item.fontFamily]) { @@ -19588,18 +19311,17 @@ return Object.values(fontFamiliesObject); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/upload-fonts.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/upload-fonts.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -19608,11 +19330,10 @@ function UploadFonts() { const { - installFonts, - notice, - setNotice + installFonts } = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext); const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false); + const [notice, setNotice] = (0,external_wp_element_namespaceObject.useState)(false); const handleDropZone = files => { handleFilesUpload(files); }; @@ -19784,6 +19505,7 @@ render: ({ openFileDialog }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, className: "font-library-modal__upload-area", onClick: openFileDialog, children: (0,external_wp_i18n_namespaceObject.__)('Upload font') @@ -19799,20 +19521,19 @@ } /* harmony default export */ const upload_fonts = (UploadFonts); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-library-modal/index.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -19821,14 +19542,14 @@ const { Tabs -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_components_namespaceObject.privateApis); const DEFAULT_TAB = { id: 'installed-fonts', title: (0,external_wp_i18n_namespaceObject._x)('Library', 'Font library') }; const UPLOAD_TAB = { id: 'upload-fonts', - title: (0,external_wp_i18n_namespaceObject.__)('Upload') + title: (0,external_wp_i18n_namespaceObject._x)('Upload', 'noun') }; const tabsFromCollections = collections => collections.map(({ slug, @@ -19842,36 +19563,29 @@ defaultTabId = 'installed-fonts' }) { const { - collections, - setNotice + collections } = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext); const canUserCreate = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - canUser - } = select(external_wp_coreData_namespaceObject.store); - return canUser('create', 'font-families'); + return select(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'postType', + name: 'wp_font_family' + }); }, []); const tabs = [DEFAULT_TAB]; if (canUserCreate) { tabs.push(UPLOAD_TAB); tabs.push(...tabsFromCollections(collections || [])); } - - // Reset notice when new tab is selected. - const onSelect = () => { - setNotice(null); - }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Fonts'), onRequestClose: onRequestClose, isFullScreen: true, className: "font-library-modal", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "font-library-modal__tabs", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { - defaultTabId: defaultTabId, - onSelect: onSelect, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { + defaultTabId: defaultTabId, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "font-library-modal__tablist-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabList, { children: tabs.map(({ id, title @@ -19879,46 +19593,45 @@ tabId: id, children: title }, id)) - }), tabs.map(({ - id - }) => { - let contents; - switch (id) { - case 'upload-fonts': - contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(upload_fonts, {}); - break; - case 'installed-fonts': - contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(installed_fonts, {}); - break; - default: - contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_collection, { - slug: id - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { - tabId: id, - focusable: false, - children: contents - }, id); - })] - }) + }) + }), tabs.map(({ + id + }) => { + let contents; + switch (id) { + case 'upload-fonts': + contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(upload_fonts, {}); + break; + case 'installed-fonts': + contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(installed_fonts, {}); + break; + default: + contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_collection, { + slug: id + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { + tabId: id, + focusable: false, + children: contents + }, id); + })] }) }); } /* harmony default export */ const font_library_modal = (FontLibraryModal); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-family-item.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-family-item.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -19944,7 +19657,7 @@ children: font.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-global-styles-screen-typography__font-variants-count", - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of font variants. */ + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of font variants. */ (0,external_wp_i18n_namespaceObject._n)('%d variant', '%d variants', variantsCount), variantsCount) })] }) @@ -19952,21 +19665,19 @@ } /* harmony default export */ const font_family_item = (FontFamilyItem); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-families.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-families.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -19976,20 +19687,33 @@ const { useGlobalSetting: font_families_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +/** + * Maps the fonts with the source, if available. + * + * @param {Array} fonts The fonts to map. + * @param {string} source The source of the fonts. + * @return {Array} The mapped fonts. + */ +function mapFontsWithSource(fonts, source) { + return fonts ? fonts.map(f => setUIValuesNeeded(f, { + source + })) : []; +} function FontFamilies() { const { + baseCustomFonts, modalTabOpen, setModalTabOpen } = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext); const [fontFamilies] = font_families_useGlobalSetting('typography.fontFamilies'); - const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map(f => setUIValuesNeeded(f, { - source: 'theme' - })).sort((a, b) => a.name.localeCompare(b.name)) : []; - const customFonts = fontFamilies?.custom ? fontFamilies.custom.map(f => setUIValuesNeeded(f, { - source: 'custom' - })).sort((a, b) => a.name.localeCompare(b.name)) : []; - const hasFonts = 0 < customFonts.length || 0 < themeFonts.length; + const [baseFontFamilies] = font_families_useGlobalSetting('typography.fontFamilies', undefined, 'base'); + const themeFonts = mapFontsWithSource(fontFamilies?.theme, 'theme'); + const customFonts = mapFontsWithSource(fontFamilies?.custom, 'custom'); + const activeFonts = [...themeFonts, ...customFonts].sort((a, b) => a.name.localeCompare(b.name)); + const hasFonts = 0 < activeFonts.length; + const hasInstalledFonts = hasFonts || baseFontFamilies?.theme?.length > 0 || baseCustomFonts?.length > 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!!modalTabOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_library_modal, { onRequestClose: () => setModalTabOpen(null), @@ -20007,20 +19731,27 @@ icon: library_settings, size: "small" })] - }), hasFonts ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - isBordered: true, - isSeparated: true, - children: [customFonts.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_family_item, { - font: font - }, font.slug)), themeFonts.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_family_item, { - font: font - }, font.slug))] - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [(0,external_wp_i18n_namespaceObject.__)('No fonts installed.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "edit-site-global-styles-font-families__add-fonts", + }), activeFonts.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + size: "large", + isBordered: true, + isSeparated: true, + children: activeFonts.map(font => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_family_item, { + font: font + }, font.slug)) + }) + }), !hasFonts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + as: "p", + children: hasInstalledFonts ? (0,external_wp_i18n_namespaceObject.__)('No fonts activated.') : (0,external_wp_i18n_namespaceObject.__)('No fonts installed.') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "edit-site-global-styles-font-families__manage-fonts", variant: "secondary", - onClick: () => setModalTabOpen('upload-fonts'), - children: (0,external_wp_i18n_namespaceObject.__)('Add fonts') + __next40pxDefaultSize: true, + onClick: () => { + setModalTabOpen(hasInstalledFonts ? 'installed-fonts' : 'upload-fonts'); + }, + children: hasInstalledFonts ? (0,external_wp_i18n_namespaceObject.__)('Manage fonts') : (0,external_wp_i18n_namespaceObject.__)('Add fonts') })] })] })] @@ -20034,19 +19765,18 @@ }) })); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ @@ -20058,21 +19788,21 @@ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Typography'), - description: (0,external_wp_i18n_namespaceObject.__)('Typography styles and the application of those styles on site elements.') + description: (0,external_wp_i18n_namespaceObject.__)('Available fonts, typographic styles, and the application of those styles.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 7, - children: [!window.__experimentalDisableFontLibrary && fontLibraryEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_families, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(typography_elements, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { - title: (0,external_wp_i18n_namespaceObject.__)('Presets') - })] + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { + title: (0,external_wp_i18n_namespaceObject.__)('Typesets') + }), fontLibraryEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_families, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(typography_elements, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_count, {})] }) })] }); } /* harmony default export */ const screen_typography = (ScreenTypography); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-panel.js /** * WordPress dependencies */ @@ -20088,7 +19818,7 @@ useGlobalSetting: typography_panel_useGlobalSetting, useSettingsForBlockElement: typography_panel_useSettingsForBlockElement, TypographyPanel: typography_panel_StylesTypographyPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function TypographyPanel({ element, headingLevel @@ -20117,7 +19847,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-preview.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/typography-preview.js /** * WordPress dependencies */ @@ -20130,7 +19860,7 @@ const { useGlobalStyle: typography_preview_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function TypographyPreview({ name, element, @@ -20171,19 +19901,17 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography-element.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-typography-element.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -20237,24 +19965,38 @@ __nextHasNoMarginBottom: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "heading", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('All headings'), label: (0,external_wp_i18n_namespaceObject._x)('All', 'heading levels') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h1", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 1'), label: (0,external_wp_i18n_namespaceObject.__)('H1') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h2", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 2'), label: (0,external_wp_i18n_namespaceObject.__)('H2') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h3", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 3'), label: (0,external_wp_i18n_namespaceObject.__)('H3') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h4", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 4'), label: (0,external_wp_i18n_namespaceObject.__)('H4') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h5", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 5'), label: (0,external_wp_i18n_namespaceObject.__)('H5') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "h6", + showTooltip: true, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading 6'), label: (0,external_wp_i18n_namespaceObject.__)('H6') })] }) @@ -20266,39 +20008,638 @@ } /* harmony default export */ const screen_typography_element = (ScreenTypographyElement); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js -/** - * WordPress dependencies - */ - - -/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ - -/** - * Return an SVG icon. - * - * @param {IconProps} props icon is the SVG component to render - * size is a number specifiying the icon size in pixels - * Other props will be passed to wrapped SVG component - * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element. - * - * @return {JSX.Element} Icon component - */ -function Icon({ - icon, - size = 24, +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-size-preview.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +const { + useGlobalStyle: font_size_preview_useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function FontSizePreview({ + fontSize +}) { + var _font$fontFamily; + const [font] = font_size_preview_useGlobalStyle('typography'); + const input = fontSize?.fluid?.min && fontSize?.fluid?.max ? { + minimumFontSize: fontSize.fluid.min, + maximumFontSize: fontSize.fluid.max + } : { + fontSize: fontSize.size + }; + const computedFontSize = (0,external_wp_blockEditor_namespaceObject.getComputedFluidTypographyValue)(input); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-typography-preview", + style: { + fontSize: computedFontSize, + fontFamily: (_font$fontFamily = font?.fontFamily) !== null && _font$fontFamily !== void 0 ? _font$fontFamily : 'serif' + }, + children: (0,external_wp_i18n_namespaceObject.__)('Aa') + }); +} +/* harmony default export */ const font_size_preview = (FontSizePreview); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +/** + * WordPress dependencies + */ + + + +function ConfirmDeleteFontSizeDialog({ + fontSize, + isOpen, + toggleOpen, + handleRemoveFontSize +}) { + const handleConfirm = async () => { + toggleOpen(); + handleRemoveFontSize(fontSize); + }; + const handleCancel = () => { + toggleOpen(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: isOpen, + cancelButtonText: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), + onCancel: handleCancel, + onConfirm: handleConfirm, + size: "medium", + children: fontSize && (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the font size preset. */ + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" font size preset?'), fontSize.name) + }); +} +/* harmony default export */ const confirm_delete_font_size_dialog = (ConfirmDeleteFontSizeDialog); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +/** + * WordPress dependencies + */ + + + + +function RenameFontSizeDialog({ + fontSize, + toggleOpen, + handleRename +}) { + const [newName, setNewName] = (0,external_wp_element_namespaceObject.useState)(fontSize.name); + const handleConfirm = () => { + // If the new name is not empty, call the handleRename function + if (newName.trim()) { + handleRename(newName); + } + toggleOpen(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + onRequestClose: toggleOpen, + focusOnMount: "firstContentElement", + title: (0,external_wp_i18n_namespaceObject.__)('Rename'), + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + onSubmit: event => { + event.preventDefault(); + handleConfirm(); + toggleOpen(); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { + __next40pxDefaultSize: true, + autoComplete: "off", + value: newName, + onChange: setNewName, + label: (0,external_wp_i18n_namespaceObject.__)('Name'), + placeholder: (0,external_wp_i18n_namespaceObject.__)('Font size preset name') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: toggleOpen, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + type: "submit", + children: (0,external_wp_i18n_namespaceObject.__)('Save') + })] + })] + }) + }) + }); +} +/* harmony default export */ const rename_font_size_dialog = (RenameFontSizeDialog); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/size-control/index.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + +const DEFAULT_UNITS = ['px', 'em', 'rem', 'vw', 'vh']; +function SizeControl({ + // Do not allow manipulation of margin bottom + __nextHasNoMarginBottom, ...props -}, ref) { - return (0,external_wp_element_namespaceObject.cloneElement)(icon, { - width: size, - height: size, - ...props, - ref - }); -} -/* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shuffle.js +}) { + const { + baseControlProps + } = (0,external_wp_components_namespaceObject.useBaseControlProps)(props); + const { + value, + onChange, + fallbackValue, + disabled, + label + } = props; + const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ + availableUnits: DEFAULT_UNITS + }); + const [valueQuantity, valueUnit = 'px'] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value, units); + const isValueUnitRelative = !!valueUnit && ['em', 'rem', 'vw', 'vh'].includes(valueUnit); + + // Receives the new value from the UnitControl component as a string containing the value and unit. + const handleUnitControlChange = newValue => { + onChange(newValue); + }; + + // Receives the new value from the RangeControl component as a number. + const handleRangeControlChange = newValue => { + onChange?.(newValue + valueUnit); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { + ...baseControlProps, + __nextHasNoMarginBottom: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + label: label, + hideLabelFromVision: true, + value: value, + onChange: handleUnitControlChange, + units: units, + min: 0, + disabled: disabled + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + marginX: 2, + marginBottom: 0, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + label: label, + hideLabelFromVision: true, + value: valueQuantity, + initialPosition: fallbackValue, + withInputField: false, + onChange: handleRangeControlChange, + min: 0, + max: isValueUnitRelative ? 10 : 100, + step: isValueUnitRelative ? 0.1 : 1, + disabled: disabled + }) + }) + })] + }) + }); +} +/* harmony default export */ const size_control = (SizeControl); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-size.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + Menu +} = unlock(external_wp_components_namespaceObject.privateApis); +const { + useGlobalSetting: font_size_useGlobalSetting +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function FontSize() { + var _fontSizes$origin; + const [isDeleteConfirmOpen, setIsDeleteConfirmOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const [isRenameDialogOpen, setIsRenameDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const { + params: { + origin, + slug + }, + goBack + } = (0,external_wp_components_namespaceObject.useNavigator)(); + const [fontSizes, setFontSizes] = font_size_useGlobalSetting('typography.fontSizes'); + const [globalFluid] = font_size_useGlobalSetting('typography.fluid'); + + // Get the font sizes from the origin, default to empty array. + const sizes = (_fontSizes$origin = fontSizes[origin]) !== null && _fontSizes$origin !== void 0 ? _fontSizes$origin : []; + + // Get the font size by slug. + const fontSize = sizes.find(size => size.slug === slug); + + // Navigate to the font sizes list if the font size is not available. + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!!slug && !fontSize) { + goBack(); + } + }, [slug, fontSize, goBack]); + if (!origin || !slug || !fontSize) { + return null; + } + + // Whether the font size is fluid. If not defined, use the global fluid value of the theme. + const isFluid = fontSize?.fluid !== undefined ? !!fontSize.fluid : !!globalFluid; + + // Whether custom fluid values are used. + const isCustomFluid = typeof fontSize?.fluid === 'object'; + const handleNameChange = value => { + updateFontSize('name', value); + }; + const handleFontSizeChange = value => { + updateFontSize('size', value); + }; + const handleFluidChange = value => { + updateFontSize('fluid', value); + }; + const handleCustomFluidValues = value => { + if (value) { + // If custom values are used, init the values with the current ones. + updateFontSize('fluid', { + min: fontSize.size, + max: fontSize.size + }); + } else { + // If custom fluid values are disabled, set fluid to true. + updateFontSize('fluid', true); + } + }; + const handleMinChange = value => { + updateFontSize('fluid', { + ...fontSize.fluid, + min: value + }); + }; + const handleMaxChange = value => { + updateFontSize('fluid', { + ...fontSize.fluid, + max: value + }); + }; + const updateFontSize = (key, value) => { + const newFontSizes = sizes.map(size => { + if (size.slug === slug) { + return { + ...size, + [key]: value + }; // Create a new object with updated key + } + return size; + }); + setFontSizes({ + ...fontSizes, + [origin]: newFontSizes + }); + }; + const handleRemoveFontSize = () => { + const newFontSizes = sizes.filter(size => size.slug !== slug); + setFontSizes({ + ...fontSizes, + [origin]: newFontSizes + }); + }; + const toggleDeleteConfirm = () => { + setIsDeleteConfirmOpen(!isDeleteConfirmOpen); + }; + const toggleRenameDialog = () => { + setIsRenameDialogOpen(!isRenameDialogOpen); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(confirm_delete_font_size_dialog, { + fontSize: fontSize, + isOpen: isDeleteConfirmOpen, + toggleOpen: toggleDeleteConfirm, + handleRemoveFontSize: handleRemoveFontSize + }), isRenameDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rename_font_size_dialog, { + fontSize: fontSize, + toggleOpen: toggleRenameDialog, + handleRename: handleNameChange + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "space-between", + align: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { + title: fontSize.name, + description: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: font size preset name. */ + (0,external_wp_i18n_namespaceObject.__)('Manage the font size %s.'), fontSize.name) + }), origin === 'custom' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + marginTop: 3, + marginBottom: 0, + paddingX: 4, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Font size options') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu.Popover, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { + onClick: toggleRenameDialog, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Rename') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Item, { + onClick: toggleDeleteConfirm, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Delete') + }) + })] + })] + }) + }) + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + paddingX: 4, + marginBottom: 0, + paddingBottom: 6, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size_preview, { + fontSize: fontSize + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(size_control, { + label: (0,external_wp_i18n_namespaceObject.__)('Size'), + value: !isCustomFluid ? fontSize.size : '', + onChange: handleFontSizeChange, + disabled: isCustomFluid + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Fluid typography'), + help: (0,external_wp_i18n_namespaceObject.__)('Scale the font size dynamically to fit the screen or viewport.'), + checked: isFluid, + onChange: handleFluidChange, + __nextHasNoMarginBottom: true + }), isFluid && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Custom fluid values'), + help: (0,external_wp_i18n_namespaceObject.__)('Set custom min and max values for the fluid font size.'), + checked: isCustomFluid, + onChange: handleCustomFluidValues, + __nextHasNoMarginBottom: true + }), isCustomFluid && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(size_control, { + label: (0,external_wp_i18n_namespaceObject.__)('Minimum'), + value: fontSize.fluid?.min, + onChange: handleMinChange + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(size_control, { + label: (0,external_wp_i18n_namespaceObject.__)('Maximum'), + value: fontSize.fluid?.max, + onChange: handleMaxChange + })] + })] + }) + }) + })] + })] + }); +} +/* harmony default export */ const font_size = (FontSize); + +;// ./node_modules/@wordpress/icons/build-module/library/plus.js +/** + * WordPress dependencies + */ + + +const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" + }) +}); +/* harmony default export */ const library_plus = (plus); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +/** + * WordPress dependencies + */ + + + +function ConfirmResetFontSizesDialog({ + text, + confirmButtonText, + isOpen, + toggleOpen, + onConfirm +}) { + const handleConfirm = async () => { + toggleOpen(); + onConfirm(); + }; + const handleCancel = () => { + toggleOpen(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: isOpen, + cancelButtonText: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + confirmButtonText: confirmButtonText, + onCancel: handleCancel, + onConfirm: handleConfirm, + size: "medium", + children: text + }); +} +/* harmony default export */ const confirm_reset_font_sizes_dialog = (ConfirmResetFontSizesDialog); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/font-sizes/font-sizes.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + Menu: font_sizes_Menu +} = unlock(external_wp_components_namespaceObject.privateApis); +const { + useGlobalSetting: font_sizes_useGlobalSetting +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function FontSizeGroup({ + label, + origin, + sizes, + handleAddFontSize, + handleResetFontSizes +}) { + const [isResetDialogOpen, setIsResetDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen); + const resetDialogText = origin === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to remove all custom font size presets?') : (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to reset all font size presets to their default values?'); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [isResetDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(confirm_reset_font_sizes_dialog, { + text: resetDialogText, + confirmButtonText: origin === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Remove') : (0,external_wp_i18n_namespaceObject.__)('Reset'), + isOpen: isResetDialogOpen, + toggleOpen: toggleResetDialog, + onConfirm: handleResetFontSizes + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "space-between", + align: "center", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle, { + level: 3, + children: label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexItem, { + children: [origin === 'custom' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: (0,external_wp_i18n_namespaceObject.__)('Add font size'), + icon: library_plus, + size: "small", + onClick: handleAddFontSize + }), !!handleResetFontSizes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(font_sizes_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Font size presets options') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.Item, { + onClick: toggleResetDialog, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes_Menu.ItemLabel, { + children: origin === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Remove font size presets') : (0,external_wp_i18n_namespaceObject.__)('Reset font size presets') + }) + }) + })] + })] + })] + }), !!sizes.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + children: sizes.map(size => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { + path: `/typography/font-sizes/${origin}/${size.slug}`, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "edit-site-font-size__item", + children: size.name + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + display: "flex", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right + }) + })] + }) + }, size.slug)) + })] + })] + }); +} +function font_sizes_FontSizes() { + const [themeFontSizes, setThemeFontSizes] = font_sizes_useGlobalSetting('typography.fontSizes.theme'); + const [baseThemeFontSizes] = font_sizes_useGlobalSetting('typography.fontSizes.theme', null, 'base'); + const [defaultFontSizes, setDefaultFontSizes] = font_sizes_useGlobalSetting('typography.fontSizes.default'); + const [baseDefaultFontSizes] = font_sizes_useGlobalSetting('typography.fontSizes.default', null, 'base'); + const [customFontSizes = [], setCustomFontSizes] = font_sizes_useGlobalSetting('typography.fontSizes.custom'); + const [defaultFontSizesEnabled] = font_sizes_useGlobalSetting('typography.defaultFontSizes'); + const handleAddFontSize = () => { + const index = getNewIndexFromPresets(customFontSizes, 'custom-'); + const newFontSize = { + /* translators: %d: font size index */ + name: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('New Font Size %d'), index), + size: '16px', + slug: `custom-${index}` + }; + setCustomFontSizes([...customFontSizes, newFontSize]); + }; + const hasSameSizeValues = (arr1, arr2) => arr1.map(item => item.size).join('') === arr2.map(item => item.size).join(''); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 2, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { + title: (0,external_wp_i18n_namespaceObject.__)('Font size presets'), + description: (0,external_wp_i18n_namespaceObject.__)('Create and edit the presets used for font sizes across the site.') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + paddingX: 4, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 8, + children: [!!themeFontSizes?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FontSizeGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Theme'), + origin: "theme", + sizes: themeFontSizes, + baseSizes: baseThemeFontSizes, + handleAddFontSize: handleAddFontSize, + handleResetFontSizes: hasSameSizeValues(themeFontSizes, baseThemeFontSizes) ? null : () => setThemeFontSizes(baseThemeFontSizes) + }), defaultFontSizesEnabled && !!defaultFontSizes?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FontSizeGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Default'), + origin: "default", + sizes: defaultFontSizes, + baseSizes: baseDefaultFontSizes, + handleAddFontSize: handleAddFontSize, + handleResetFontSizes: hasSameSizeValues(defaultFontSizes, baseDefaultFontSizes) ? null : () => setDefaultFontSizes(baseDefaultFontSizes) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FontSizeGroup, { + label: (0,external_wp_i18n_namespaceObject.__)('Custom'), + origin: "custom", + sizes: customFontSizes, + handleAddFontSize: handleAddFontSize, + handleResetFontSizes: customFontSizes.length > 0 ? () => setCustomFontSizes([]) : null + })] + }) + }) + })] + }); +} +/* harmony default export */ const font_sizes = (font_sizes_FontSizes); + +;// ./node_modules/@wordpress/icons/build-module/library/shuffle.js /** * WordPress dependencies */ @@ -20313,7 +20654,7 @@ }); /* harmony default export */ const library_shuffle = (shuffle); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-indicator-wrapper.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-indicator-wrapper.js /** * External dependencies */ @@ -20335,20 +20676,19 @@ } /* harmony default export */ const color_indicator_wrapper = (ColorIndicatorWrapper); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/palette.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -20357,7 +20697,7 @@ const { useGlobalSetting: palette_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const EMPTY_COLORS = []; function Palette({ name @@ -20369,7 +20709,6 @@ const [randomizeThemeColors] = useColorRandomizer(); const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(customColors || EMPTY_COLORS), ...(themeColors || EMPTY_COLORS), ...(defaultColors && defaultPaletteEnabled ? defaultColors : EMPTY_COLORS)], [customColors, themeColors, defaultColors, defaultPaletteEnabled]); const screenPath = !name ? '/colors/palette' : '/blocks/' + encodeURIComponent(name) + '/colors/palette'; - const paletteButtonText = colors.length > 0 ? (0,external_wp_i18n_namespaceObject.__)('Edit palette') : (0,external_wp_i18n_namespaceObject.__)('Add colors'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle, { @@ -20380,27 +20719,32 @@ isSeparated: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: screenPath, - "aria-label": paletteButtonText, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { direction: "row", - children: [colors.length <= 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: [colors.length > 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { + isLayered: false, + offset: -8, + children: colors.slice(0, 5).map(({ + color + }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_wrapper, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { + colorValue: color + }) + }, `${color}-${index}`)) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + isBlock: true, + children: (0,external_wp_i18n_namespaceObject.__)('Edit palette') + })] + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)('Add colors') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { - isLayered: false, - offset: -8, - children: colors.slice(0, 5).map(({ - color - }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_indicator_wrapper, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { - colorValue: color - }) - }, `${color}-${index}`)) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right })] }) }) }), window.__experimentalEnableColorRandomizer && themeColors?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "secondary", icon: library_shuffle, onClick: randomizeThemeColors, @@ -20410,19 +20754,17 @@ } /* harmony default export */ const palette = (Palette); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-colors.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-colors.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -20432,7 +20774,7 @@ useGlobalSetting: screen_colors_useGlobalSetting, useSettingsForBlockElement: screen_colors_useSettingsForBlockElement, ColorPanel: screen_colors_StylesColorPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenColors() { const [style] = screen_colors_useGlobalStyle('', undefined, 'user', { shouldDecodeEncode: false @@ -20462,7 +20804,7 @@ } /* harmony default export */ const screen_colors = (ScreenColors); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preset-colors.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preset-colors.js /** * Internal dependencies */ @@ -20472,7 +20814,7 @@ const { paletteColors } = useStylesPreviewColors(); - return paletteColors.slice(0, 5).map(({ + return paletteColors.slice(0, 4).map(({ slug, color }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -20484,7 +20826,7 @@ }, `${slug}-${index}`)); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-colors.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview-colors.js /** * WordPress dependencies */ @@ -20511,7 +20853,7 @@ isFocused, withHoverView }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewIframe, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewWrapper, { label: label, isFocused: isFocused, withHoverView: withHoverView, @@ -20537,16 +20879,15 @@ }; /* harmony default export */ const preview_colors = (StylesPreviewColors); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-color.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/variations/variations-color.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ @@ -20556,7 +20897,8 @@ title, gap = 2 }) { - const colorVariations = useColorVariations(); + const propertiesToFilter = ['color']; + const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter); // Return null if there is only one variation (the default). if (colorVariations?.length <= 1) { @@ -20572,32 +20914,32 @@ children: colorVariations.map((variation, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Variation, { variation: variation, isPill: true, - property: "color", + properties: propertiesToFilter, + showTooltip: true, children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_colors, {}) }, index)) })] }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-palette-panel.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/color-palette-panel.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ const { useGlobalSetting: color_palette_panel_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const mobilePopoverProps = { placement: 'bottom-start', offset: 8 @@ -20645,25 +20987,24 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/gradients-palette-panel.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/gradients-palette-panel.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ const { useGlobalSetting: gradients_palette_panel_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const gradients_palette_panel_mobilePopoverProps = { placement: 'bottom-start', offset: 8 @@ -20728,18 +21069,16 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-color-palette.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-color-palette.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ @@ -20747,7 +21086,7 @@ const { Tabs: screen_color_palette_Tabs -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_components_namespaceObject.privateApis); function ScreenColorPalette({ name }) { @@ -20782,22 +21121,122 @@ } /* harmony default export */ const screen_color_palette = (ScreenColorPalette); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js -/** - * WordPress dependencies - */ - - -const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" - }) -}); -/* harmony default export */ const library_plus = (plus); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/background-panel.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +// Initial control values where no block style is set. + +const BACKGROUND_DEFAULT_VALUES = { + backgroundSize: 'auto' +}; +const { + useGlobalStyle: background_panel_useGlobalStyle, + useGlobalSetting: background_panel_useGlobalSetting, + BackgroundPanel: background_panel_StylesBackgroundPanel +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +/** + * Checks if there is a current value in the background image block support + * attributes. + * + * @param {Object} style Style attribute. + * @return {boolean} Whether the block has a background image value set. + */ +function hasBackgroundImageValue(style) { + return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === 'string'; +} +function BackgroundPanel() { + const [style] = background_panel_useGlobalStyle('', undefined, 'user', { + shouldDecodeEncode: false + }); + const [inheritedStyle, setStyle] = background_panel_useGlobalStyle('', undefined, 'all', { + shouldDecodeEncode: false + }); + const [settings] = background_panel_useGlobalSetting(''); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(background_panel_StylesBackgroundPanel, { + inheritedValue: inheritedStyle, + value: style, + onChange: setStyle, + settings: settings, + defaultValues: BACKGROUND_DEFAULT_VALUES + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-background.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +const { + useHasBackgroundPanel: screen_background_useHasBackgroundPanel, + useGlobalSetting: screen_background_useGlobalSetting +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function ScreenBackground() { + const [settings] = screen_background_useGlobalSetting(''); + const hasBackgroundPanel = screen_background_useHasBackgroundPanel(settings); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { + title: (0,external_wp_i18n_namespaceObject.__)('Background'), + description: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + children: (0,external_wp_i18n_namespaceObject.__)('Set styles for the site’s background.') + }) + }), hasBackgroundPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundPanel, {})] + }); +} +/* harmony default export */ const screen_background = (ScreenBackground); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/confirm-reset-shadow-dialog.js +/** + * WordPress dependencies + */ + + + +function ConfirmResetShadowDialog({ + text, + confirmButtonText, + isOpen, + toggleOpen, + onConfirm +}) { + const handleConfirm = async () => { + toggleOpen(); + onConfirm(); + }; + const handleCancel = () => { + toggleOpen(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: isOpen, + cancelButtonText: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + confirmButtonText: confirmButtonText, + onCancel: handleCancel, + onConfirm: handleConfirm, + size: "medium", + children: text + }); +} +/* harmony default export */ const confirm_reset_shadow_dialog = (ConfirmResetShadowDialog); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-panel.js /** * WordPress dependencies */ @@ -20819,7 +21258,10 @@ const { useGlobalSetting: shadows_panel_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + Menu: shadows_panel_Menu +} = unlock(external_wp_components_namespaceObject.privateApis); const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)'; function ShadowsPanel() { const [defaultShadows] = shadows_panel_useGlobalSetting('shadow.presets.default'); @@ -20829,8 +21271,19 @@ const onCreateShadow = shadow => { setCustomShadows([...(customShadows || []), shadow]); }; + const handleResetShadows = () => { + setCustomShadows([]); + }; + const [isResetDialogOpen, setIsResetDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { + children: [isResetDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(confirm_reset_shadow_dialog, { + text: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to remove all custom shadows?'), + confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Remove'), + isOpen: isResetDialogOpen, + toggleOpen: toggleResetDialog, + onConfirm: handleResetShadows + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Shadows'), description: (0,external_wp_i18n_namespaceObject.__)('Manage and create shadow styles for use across the site.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { @@ -20851,7 +21304,8 @@ shadows: customShadows || [], category: "custom", canCreate: true, - onCreate: onCreateShadow + onCreate: onCreateShadow, + onReset: toggleResetDialog })] }) })] @@ -20862,12 +21316,13 @@ shadows, category, canCreate, - onCreate + onCreate, + onReset }) { const handleAddShadow = () => { const newIndex = getNewIndexFromPresets(shadows, 'shadow-'); onCreate({ - name: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is an index for a preset */ + name: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: is an index for a preset */ (0,external_wp_i18n_namespaceObject.__)('Shadow %s'), newIndex), shadow: defaultShadow, slug: `shadow-${newIndex}` @@ -20894,6 +21349,21 @@ handleAddShadow(); } }) + }), !!shadows?.length && category === 'custom' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_panel_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Shadow options') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.Item, { + onClick: onReset, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_panel_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Remove all custom shadows') + }) + }) + })] })] }), shadows.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, @@ -20911,15 +21381,17 @@ }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationButtonAsItem, { path: `/shadows/edit/${category}/${shadow.slug}`, - "aria-label": - // translators: %s: name of the shadow - (0,external_wp_i18n_namespaceObject.sprintf)('Edit shadow %s', shadow.name), - icon: library_shadow, - children: shadow.name - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/reset.js + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: shadow.name + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right + })] + }) + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/reset.js /** * WordPress dependencies */ @@ -20934,7 +21406,7 @@ }); /* harmony default export */ const library_reset = (reset_reset); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-utils.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadow-utils.js const CUSTOM_VALUE_SETTINGS = { px: { max: 20, @@ -21156,7 +21628,7 @@ return `${shadowObj.inset ? 'inset' : ''} ${shadowString} ${shadowObj.color || ''}`.trim(); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-edit-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/shadows-edit-panel.js /** * External dependencies */ @@ -21180,16 +21652,12 @@ - - const { useGlobalSetting: shadows_edit_panel_useGlobalSetting -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - DropdownMenuV2: DropdownMenu, - DropdownMenuItemV2: DropdownMenuItem, - DropdownMenuItemLabelV2: DropdownMenuItemLabel -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + Menu: shadows_edit_panel_Menu +} = unlock(external_wp_components_namespaceObject.privateApis); const customShadowMenuItems = [{ label: (0,external_wp_i18n_namespaceObject.__)('Rename'), action: 'rename' @@ -21203,19 +21671,36 @@ }]; function ShadowsEditPanel() { const { + goBack, params: { category, slug - }, - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + } + } = (0,external_wp_components_namespaceObject.useNavigator)(); const [shadows, setShadows] = shadows_edit_panel_useGlobalSetting(`shadow.presets.${category}`); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const hasCurrentShadow = shadows?.some(shadow => shadow.slug === slug); + // If the shadow being edited doesn't exist anymore in the global styles setting, navigate back + // to prevent the user from editing a non-existent shadow entry. + // This can happen, for example: + // - when the user deletes the shadow + // - when the user resets the styles while editing a custom shadow + // + // The check on the slug is necessary to prevent a double back navigation when the user triggers + // a backward navigation by interacting with the screen's UI. + if (!!slug && !hasCurrentShadow) { + goBack(); + } + }, [shadows, slug, goBack]); const [baseShadows] = shadows_edit_panel_useGlobalSetting(`shadow.presets.${category}`, undefined, 'base'); const [selectedShadow, setSelectedShadow] = (0,external_wp_element_namespaceObject.useState)(() => (shadows || []).find(shadow => shadow.slug === slug)); const baseSelectedShadow = (0,external_wp_element_namespaceObject.useMemo)(() => (baseShadows || []).find(b => b.slug === slug), [baseShadows, slug]); const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0,external_wp_element_namespaceObject.useState)(false); const [isRenameModalVisible, setIsRenameModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); const [shadowName, setShadowName] = (0,external_wp_element_namespaceObject.useState)(selectedShadow.name); + if (!category || !slug) { + return null; + } const onShadowChange = shadow => { setSelectedShadow({ ...selectedShadow, @@ -21239,9 +21724,7 @@ } }; const handleShadowDelete = () => { - const updatedShadows = shadows.filter(s => s.slug !== slug); - setShadows(updatedShadows); - goTo(`/shadows`); + setShadows(shadows.filter(s => s.slug !== slug)); }; const handleShadowRename = newName => { if (!newName) { @@ -21269,19 +21752,22 @@ marginTop: 2, marginBottom: 0, paddingX: 4, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "small", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Menu') - }), - children: (category === 'custom' ? customShadowMenuItems : presetShadowMenuItems).map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItem, { - onClick: () => onMenuClick(item.action), - disabled: item.action === 'reset' && selectedShadow.shadow === baseSelectedShadow.shadow, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemLabel, { - children: item.label + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(shadows_edit_panel_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Menu') }) - }, item.action)) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.Popover, { + children: (category === 'custom' ? customShadowMenuItems : presetShadowMenuItems).map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.Item, { + onClick: () => onMenuClick(item.action), + disabled: item.action === 'reset' && selectedShadow.shadow === baseSelectedShadow.shadow, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(shadows_edit_panel_Menu.ItemLabel, { + children: item.label + }) + }, item.action)) + })] }) }) })] @@ -21304,9 +21790,8 @@ }, confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), size: "medium", - children: (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: name of the shadow - 'Are you sure you want to delete "%s"?', selectedShadow.name) + children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the shadow preset. */ + (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s" shadow preset?'), selectedShadow.name) }), isRenameModalVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: () => setIsRenameModalVisible(false), @@ -21318,6 +21803,7 @@ setIsRenameModalVisible(false); }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { + __next40pxDefaultSize: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Name'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Shadow name'), @@ -21331,12 +21817,14 @@ expanded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "tertiary", onClick: () => setIsRenameModalVisible(false), children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject.__)('Save') @@ -21371,18 +21859,19 @@ shadow, onChange }) { + const addShadowButtonRef = (0,external_wp_element_namespaceObject.useRef)(); const shadowParts = (0,external_wp_element_namespaceObject.useMemo)(() => getShadowParts(shadow), [shadow]); const onChangeShadowPart = (index, part) => { - shadowParts[index] = part; - onChange(shadowParts.join(', ')); + const newShadowParts = [...shadowParts]; + newShadowParts[index] = part; + onChange(newShadowParts.join(', ')); }; const onAddShadowPart = () => { - shadowParts.push(defaultShadow); - onChange(shadowParts.join(', ')); + onChange([...shadowParts, defaultShadow].join(', ')); }; const onRemoveShadowPart = index => { - shadowParts.splice(index, 1); - onChange(shadowParts.join(', ')); + onChange(shadowParts.filter((p, i) => i !== index).join(', ')); + addShadowButtonRef.current.focus(); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { @@ -21404,7 +21893,8 @@ label: (0,external_wp_i18n_namespaceObject.__)('Add shadow'), onClick: () => { onAddShadowPart(); - } + }, + ref: addShadowButtonRef }) })] }) @@ -21450,41 +21940,36 @@ 'aria-expanded': isOpen }; const removeButtonProps = { - onClick: onRemove, + onClick: () => { + if (isOpen) { + onToggle(); + } + onRemove(); + }, className: dist_clsx('edit-site-global-styles__shadow-editor__remove-button', { 'is-open': isOpen }), label: (0,external_wp_i18n_namespaceObject.__)('Remove shadow') }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - align: "center", - justify: "flex-start", - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - style: { - flexGrow: 1 - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - icon: library_shadow, - ...toggleProps, - children: shadowObj.inset ? (0,external_wp_i18n_namespaceObject.__)('Inner shadow') : (0,external_wp_i18n_namespaceObject.__)('Drop shadow') - }) - }), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - icon: library_reset, - ...removeButtonProps - }) + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + icon: library_shadow, + ...toggleProps, + children: shadowObj.inset ? (0,external_wp_i18n_namespaceObject.__)('Inner shadow') : (0,external_wp_i18n_namespaceObject.__)('Drop shadow') + }), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: library_reset, + ...removeButtonProps })] }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { - paddingSize: "none", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-global-styles__shadow-editor__dropdown-content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowPopover, { - shadowObj: shadowObj, - onChange: onShadowChange - }) + paddingSize: "medium", + className: "edit-site-global-styles__shadow-editor__dropdown-content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowPopover, { + shadowObj: shadowObj, + onChange: onShadowChange }) }) }); @@ -21502,114 +21987,71 @@ }; onChange(newShadow); }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, className: "edit-site-global-styles__shadow-editor-panel", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 2, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - level: 5, - children: (0,external_wp_i18n_namespaceObject.__)('Shadow') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-global-styles__shadow-editor-color-palette", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorPalette, { - clearable: false, - enableAlpha: enableAlpha, - __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, - value: shadowObj.color, - onChange: value => onShadowChange('color', value) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { - value: shadowObj.inset ? 'inset' : 'outset', - isBlock: true, - onChange: value => onShadowChange('inset', value === 'inset'), - hideLabelFromVision: true, - __next40pxDefaultSize: true, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { - value: "outset", - label: (0,external_wp_i18n_namespaceObject.__)('Outset') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { - value: "inset", - label: (0,external_wp_i18n_namespaceObject.__)('Inset') - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { - columns: 2, - gap: 4, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { - label: (0,external_wp_i18n_namespaceObject.__)('X Position'), - value: shadowObj.x, - hasNegativeRange: true, - onChange: value => onShadowChange('x', value) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Y Position'), - value: shadowObj.y, - hasNegativeRange: true, - onChange: value => onShadowChange('y', value) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Blur'), - value: shadowObj.blur, - onChange: value => onShadowChange('blur', value) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { - label: (0,external_wp_i18n_namespaceObject.__)('Spread'), - value: shadowObj.spread, - hasNegativeRange: true, - onChange: value => onShadowChange('spread', value) - })] - })] - }) + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorPalette, { + clearable: false, + enableAlpha: enableAlpha, + __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, + value: shadowObj.color, + onChange: value => onShadowChange('color', value) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + __nextHasNoMarginBottom: true, + value: shadowObj.inset ? 'inset' : 'outset', + isBlock: true, + onChange: value => onShadowChange('inset', value === 'inset'), + hideLabelFromVision: true, + __next40pxDefaultSize: true, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "outset", + label: (0,external_wp_i18n_namespaceObject.__)('Outset') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "inset", + label: (0,external_wp_i18n_namespaceObject.__)('Inset') + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { + columns: 2, + gap: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { + label: (0,external_wp_i18n_namespaceObject.__)('X Position'), + value: shadowObj.x, + onChange: value => onShadowChange('x', value) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Y Position'), + value: shadowObj.y, + onChange: value => onShadowChange('y', value) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Blur'), + value: shadowObj.blur, + onChange: value => onShadowChange('blur', value) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowInputControl, { + label: (0,external_wp_i18n_namespaceObject.__)('Spread'), + value: shadowObj.spread, + onChange: value => onShadowChange('spread', value) + })] + })] }); } function ShadowInputControl({ label, value, - onChange, - hasNegativeRange -}) { - var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2, _CUSTOM_VALUE_SETTING3; - const [isCustomInput, setIsCustomInput] = (0,external_wp_element_namespaceObject.useState)(false); - const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); - const sliderOnChange = next => { - onChange(next !== undefined ? [next, parsedUnit || 'px'].join('') : '0px'); - }; + onChange +}) { const onValueChange = next => { const isNumeric = next !== undefined && !isNaN(parseFloat(next)); const nextValue = isNumeric ? next : '0px'; onChange(nextValue); }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "space-between", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(subtitle, { - children: label - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Use custom size'), - icon: library_settings, - onClick: () => { - setIsCustomInput(!isCustomInput); - }, - isPressed: isCustomInput, - size: "small" - })] - }), isCustomInput ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { - label: label, - hideLabelFromVision: true, - __next40pxDefaultSize: true, - value: value, - onChange: onValueChange - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { - value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0, - onChange: sliderOnChange, - withInputField: false, - __next40pxDefaultSize: true, - __nextHasNoMarginBottom: true, - min: hasNegativeRange ? -((_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10) : 0, - max: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 10, - step: (_CUSTOM_VALUE_SETTING3 = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING3 !== void 0 ? _CUSTOM_VALUE_SETTING3 : 0.1 - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-shadows.js + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { + label: label, + __next40pxDefaultSize: true, + value: value, + onChange: onValueChange + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-shadows.js /** * Internal dependencies */ @@ -21623,7 +22065,7 @@ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowsEditPanel, {}); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/dimensions-panel.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/dimensions-panel.js /** * WordPress dependencies */ @@ -21640,7 +22082,7 @@ useGlobalSetting: dimensions_panel_useGlobalSetting, useSettingsForBlockElement: dimensions_panel_useSettingsForBlockElement, DimensionsPanel: dimensions_panel_StylesDimensionsPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const DEFAULT_CONTROLS = { contentSize: true, wideSize: true, @@ -21704,100 +22146,38 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/background-panel.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -// Initial control values where no block style is set. - -const BACKGROUND_DEFAULT_VALUES = { - backgroundSize: 'auto' -}; -const { - useGlobalStyle: background_panel_useGlobalStyle, - useGlobalSetting: background_panel_useGlobalSetting, - useGlobalStyleLinks, - BackgroundPanel: StylesBackgroundPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); - -/** - * Checks if there is a current value in the background image block support - * attributes. - * - * @param {Object} style Style attribute. - * @return {boolean} Whether the block has a background image value set. - */ -function hasBackgroundImageValue(style) { - return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === 'string'; -} -function BackgroundPanel() { - const [style] = background_panel_useGlobalStyle('', undefined, 'user', { - shouldDecodeEncode: false - }); - const [inheritedStyle, setStyle] = background_panel_useGlobalStyle('', undefined, 'all', { - shouldDecodeEncode: false - }); - const _links = useGlobalStyleLinks(); - const [settings] = background_panel_useGlobalSetting(''); - const defaultControls = { - backgroundImage: true, - backgroundSize: hasBackgroundImageValue(style) || hasBackgroundImageValue(inheritedStyle) - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StylesBackgroundPanel, { - inheritedValue: inheritedStyle, - value: style, - onChange: setStyle, - settings: settings, - defaultValues: BACKGROUND_DEFAULT_VALUES, - defaultControls: defaultControls, - themeFileURIs: _links?.['wp:theme-file'] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-layout.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - - -const { - useHasBackgroundPanel, +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-layout.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const { useHasDimensionsPanel: screen_layout_useHasDimensionsPanel, useGlobalSetting: screen_layout_useGlobalSetting, useSettingsForBlockElement: screen_layout_useSettingsForBlockElement -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenLayout() { const [rawSettings] = screen_layout_useGlobalSetting(''); const settings = screen_layout_useSettingsForBlockElement(rawSettings); const hasDimensionsPanel = screen_layout_useHasDimensionsPanel(settings); - const hasBackgroundPanel = useHasBackgroundPanel(settings); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Layout') - }), hasDimensionsPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsPanel, {}), hasBackgroundPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundPanel, {})] + }), hasDimensionsPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsPanel, {})] }); } /* harmony default export */ const screen_layout = (ScreenLayout); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/style-variations-container.js +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/style-variations-container.js /** * WordPress dependencies */ @@ -21818,32 +22198,28 @@ const { GlobalStylesContext: style_variations_container_GlobalStylesContext -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function StyleVariationsContainer({ gap = 2 }) { const { user } = (0,external_wp_element_namespaceObject.useContext)(style_variations_container_GlobalStylesContext); - const [currentUserStyles, setCurrentUserStyles] = (0,external_wp_element_namespaceObject.useState)(user); - const userStyles = currentUserStyles?.styles; - (0,external_wp_element_namespaceObject.useEffect)(() => { - setCurrentUserStyles(user); - }, [user]); + const userStyles = user?.styles; const variations = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); }, []); - // Filter out variations that are of single property type, i.e. color or typography variations. - const multiplePropertyVariations = variations?.filter(variation => { - return !isVariationWithSingleProperty(variation, 'color') && !isVariationWithSingleProperty(variation, 'typography'); + // Filter out variations that are color or typography variations. + const fullStyleVariations = variations?.filter(variation => { + return !isVariationWithProperties(variation, ['color']) && !isVariationWithProperties(variation, ['typography', 'spacing']); }); const themeVariations = (0,external_wp_element_namespaceObject.useMemo)(() => { const withEmptyVariation = [{ title: (0,external_wp_i18n_namespaceObject.__)('Default'), settings: {}, styles: {} - }, ...(multiplePropertyVariations !== null && multiplePropertyVariations !== void 0 ? multiplePropertyVariations : [])]; + }, ...(fullStyleVariations !== null && fullStyleVariations !== void 0 ? fullStyleVariations : [])]; return [...withEmptyVariation.map(variation => { var _variation$settings; const blockStyles = { @@ -21886,7 +22262,10 @@ styles }; })]; - }, [multiplePropertyVariations, userStyles?.blocks, userStyles?.css]); + }, [fullStyleVariations, userStyles?.blocks, userStyles?.css]); + if (!fullStyleVariations || fullStyleVariations?.length < 1) { + return null; + } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 2, className: "edit-site-global-styles-style-variations-container", @@ -21903,26 +22282,72 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-style-variations.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/content.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function SidebarNavigationScreenGlobalStylesContent() { + const gap = 3; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 10, + className: "edit-site-global-styles-variation-container", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, { + gap: gap + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { + title: (0,external_wp_i18n_namespaceObject.__)('Palettes'), + gap: gap + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { + title: (0,external_wp_i18n_namespaceObject.__)('Typography'), + gap: gap + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-style-variations.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useZoomOut +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenStyleVariations() { - // Move to zoom out mode when this component is mounted - // and back to the previous mode when unmounted. - (0,external_wp_blockEditor_namespaceObject.useZoomOut)(); + // Style Variations should only be previewed in with + // - a "zoomed out" editor (but not when in preview mode) + // - "Desktop" device preview + const isPreviewMode = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_blockEditor_namespaceObject.store).getSettings().isPreviewMode; + }, []); + const { + setDeviceType + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + useZoomOut(!isPreviewMode); + (0,external_wp_element_namespaceObject.useEffect)(() => { + setDeviceType('desktop'); + }, [setDeviceType]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('Browse styles'), @@ -21932,151 +22357,328 @@ isBorderless: true, className: "edit-site-global-styles-screen-style-variations", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CardBody, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, {}) + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStylesContent, {}) }) })] }); } /* harmony default export */ const screen_style_variations = (ScreenStyleVariations); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js -/** - * WordPress dependencies - */ - - -const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" - }) -}); -/* harmony default export */ const close_small = (closeSmall); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ - - - - -const { - EditorContentSlotFill, - ResizableEditor -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); - -/** - * Returns a translated string for the title of the editor canvas container. - * - * @param {string} view Editor canvas container view. - * - * @return {string} Translated string corresponding to value of view. Default is ''. - */ -function getEditorCanvasContainerTitle(view) { - switch (view) { - case 'style-book': - return (0,external_wp_i18n_namespaceObject.__)('Style Book'); - case 'global-styles-revisions': - case 'global-styles-revisions:style-book': - return (0,external_wp_i18n_namespaceObject.__)('Style Revisions'); - default: - return ''; - } -} -function EditorCanvasContainer({ - children, - closeButtonLabel, - onClose, - enableResizing = false -}) { - const { - editorCanvasContainerView, - showListViewByDefault - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const _editorCanvasContainerView = lock_unlock_unlock(select(store)).getEditorCanvasContainerView(); - const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); - return { - editorCanvasContainerView: _editorCanvasContainerView, - showListViewByDefault: _showListViewByDefault - }; - }, []); - const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false); - const { - setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - setIsListViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); - const sectionFocusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)(); - function onCloseContainer() { - setIsListViewOpened(showListViewByDefault); - setEditorCanvasContainerView(undefined); - setIsClosed(true); - if (typeof onClose === 'function') { - onClose(); - } - } - function closeOnEscape(event) { - if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { - event.preventDefault(); - onCloseContainer(); - } - } - const childrenWithProps = Array.isArray(children) ? external_wp_element_namespaceObject.Children.map(children, (child, index) => index === 0 ? (0,external_wp_element_namespaceObject.cloneElement)(child, { - ref: sectionFocusReturnRef - }) : child) : (0,external_wp_element_namespaceObject.cloneElement)(children, { - ref: sectionFocusReturnRef - }); - if (isClosed) { - return null; - } - const title = getEditorCanvasContainerTitle(editorCanvasContainerView); - const shouldShowCloseButton = onClose || closeButtonLabel; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorContentSlotFill.Fill, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-editor-canvas-container", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableEditor, { - enableResizing: enableResizing, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { - className: "edit-site-editor-canvas-container__section", - ref: shouldShowCloseButton ? focusOnMountRef : null, - onKeyDown: closeOnEscape, - "aria-label": title, - children: [shouldShowCloseButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "edit-site-editor-canvas-container__close-button", - icon: close_small, - label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)('Close'), - onClick: onCloseContainer - }), childrenWithProps] - }) - }) - }) - }); -} -function useHasEditorCanvasContainer() { - const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(EditorContentSlotFill.privateKey); - return !!fills?.length; -} -/* harmony default export */ const editor_canvas_container = (EditorCanvasContainer); - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js +;// external ["wp","mediaUtils"] +const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/constants.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const STYLE_BOOK_COLOR_GROUPS = [{ + slug: 'theme-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Theme Colors'), + origin: 'theme', + type: 'colors' +}, { + slug: 'theme-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Theme Gradients'), + origin: 'theme', + type: 'gradients' +}, { + slug: 'custom-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Custom Colors'), + origin: 'custom', + type: 'colors' +}, { + slug: 'custom-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Custom Gradients'), + origin: 'custom', + // User. + type: 'gradients' +}, { + slug: 'duotones', + title: (0,external_wp_i18n_namespaceObject.__)('Duotones'), + origin: 'theme', + type: 'duotones' +}, { + slug: 'default-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Default Colors'), + origin: 'default', + type: 'colors' +}, { + slug: 'default-gradients', + title: (0,external_wp_i18n_namespaceObject.__)('Default Gradients'), + origin: 'default', + type: 'gradients' +}]; +const STYLE_BOOK_THEME_SUBCATEGORIES = [{ + slug: 'site-identity', + title: (0,external_wp_i18n_namespaceObject.__)('Site Identity'), + blocks: ['core/site-logo', 'core/site-title', 'core/site-tagline'] +}, { + slug: 'design', + title: (0,external_wp_i18n_namespaceObject.__)('Design'), + blocks: ['core/navigation', 'core/avatar', 'core/post-time-to-read'], + exclude: ['core/home-link', 'core/navigation-link'] +}, { + slug: 'posts', + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + blocks: ['core/post-title', 'core/post-excerpt', 'core/post-author', 'core/post-author-name', 'core/post-author-biography', 'core/post-date', 'core/post-terms', 'core/term-description', 'core/query-title', 'core/query-no-results', 'core/query-pagination', 'core/query-numbers'] +}, { + slug: 'comments', + title: (0,external_wp_i18n_namespaceObject.__)('Comments'), + blocks: ['core/comments-title', 'core/comments-pagination', 'core/comments-pagination-numbers', 'core/comments', 'core/comments-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link', 'core/comment-template', 'core/post-comments-count', 'core/post-comments-link'] +}]; +const STYLE_BOOK_CATEGORIES = [{ + slug: 'overview', + title: (0,external_wp_i18n_namespaceObject.__)('Overview'), + blocks: [] +}, { + slug: 'text', + title: (0,external_wp_i18n_namespaceObject.__)('Text'), + blocks: ['core/post-content', 'core/home-link', 'core/navigation-link'] +}, { + slug: 'colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + blocks: [] +}, { + slug: 'theme', + title: (0,external_wp_i18n_namespaceObject.__)('Theme'), + subcategories: STYLE_BOOK_THEME_SUBCATEGORIES +}, { + slug: 'media', + title: (0,external_wp_i18n_namespaceObject.__)('Media'), + blocks: ['core/post-featured-image'] +}, { + slug: 'widgets', + title: (0,external_wp_i18n_namespaceObject.__)('Widgets'), + blocks: [] +}, { + slug: 'embed', + title: (0,external_wp_i18n_namespaceObject.__)('Embeds'), + include: [] +}]; + +// Style book preview subcategories for all blocks section. +const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES = [...STYLE_BOOK_THEME_SUBCATEGORIES, { + slug: 'media', + title: (0,external_wp_i18n_namespaceObject.__)('Media'), + blocks: ['core/post-featured-image'] +}, { + slug: 'widgets', + title: (0,external_wp_i18n_namespaceObject.__)('Widgets'), + blocks: [] +}, { + slug: 'embed', + title: (0,external_wp_i18n_namespaceObject.__)('Embeds'), + include: [] +}]; + +// Style book preview categories are organized slightly differently to the editor ones. +const STYLE_BOOK_PREVIEW_CATEGORIES = [{ + slug: 'overview', + title: (0,external_wp_i18n_namespaceObject.__)('Overview'), + blocks: [] +}, { + slug: 'text', + title: (0,external_wp_i18n_namespaceObject.__)('Text'), + blocks: ['core/post-content', 'core/home-link', 'core/navigation-link'] +}, { + slug: 'colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + blocks: [] +}, { + slug: 'blocks', + title: (0,external_wp_i18n_namespaceObject.__)('All Blocks'), + blocks: [], + subcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES +}]; + +// Forming a "block formatting context" to prevent margin collapsing. +// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context +const ROOT_CONTAINER = ` + .is-root-container { + display: flow-root; + } +`; +// The content area of the Style Book is rendered within an iframe so that global styles +// are applied to elements within the entire content area. To support elements that are +// not part of the block previews, such as headings and layout for the block previews, +// additional CSS rules need to be passed into the iframe. These are hard-coded below. +// Note that button styles are unset, and then focus rules from the `Button` component are +// applied to the `button` element, targeted via `.edit-site-style-book__example`. +// This is to ensure that browser default styles for buttons are not applied to the previews. +const STYLE_BOOK_IFRAME_STYLES = ` + body { + position: relative; + padding: 32px !important; + } + + ${ROOT_CONTAINER} + + .edit-site-style-book__examples { + max-width: 1200px; + margin: 0 auto; + } + + .edit-site-style-book__example { + max-width: 900px; + border-radius: 2px; + cursor: pointer; + display: flex; + flex-direction: column; + gap: 40px; + padding: 16px; + width: 100%; + box-sizing: border-box; + scroll-margin-top: 32px; + scroll-margin-bottom: 32px; + margin: 0 auto 40px auto; + } + + .edit-site-style-book__example.is-selected { + box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); + } + + .edit-site-style-book__example.is-disabled-example { + pointer-events: none; + } + + .edit-site-style-book__example:focus:not(:disabled) { + box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); + outline: 3px solid transparent; + } + + .edit-site-style-book__duotone-example > div:first-child { + display: flex; + aspect-ratio: 16 / 9; + grid-row: span 1; + grid-column: span 2; + } + .edit-site-style-book__duotone-example img { + width: 100%; + height: 100%; + object-fit: cover; + } + .edit-site-style-book__duotone-example > div:not(:first-child) { + height: 20px; + border: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + } + + .edit-site-style-book__color-example { + border: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + } + + .edit-site-style-book__subcategory-title, + .edit-site-style-book__example-title { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 13px; + font-weight: normal; + line-height: normal; + margin: 0; + text-align: left; + padding-top: 8px; + border-top: 1px solid color-mix( in srgb, currentColor 10%, transparent ); + color: color-mix( in srgb, currentColor 60%, transparent ); + } + + .edit-site-style-book__subcategory-title { + font-size: 16px; + margin-bottom: 40px; + padding-bottom: 8px; + } + + .edit-site-style-book__example-preview { + width: 100%; + } + + .edit-site-style-book__example-preview .block-editor-block-list__insertion-point, + .edit-site-style-book__example-preview .block-list-appender { + display: none; + } + :where(.is-root-container > .wp-block:first-child) { + margin-top: 0; + } + :where(.is-root-container > .wp-block:last-child) { + margin-bottom: 0; + } +`; + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/categories.js +/** + * WordPress dependencies + */ +// @wordpress/blocks imports are not typed. +// @ts-expect-error + + +/** + * Internal dependencies + */ + + + +/** + * Returns category examples for a given category definition and list of examples. + * @param {StyleBookCategory} categoryDefinition The category definition. + * @param {BlockExample[]} examples An array of block examples. + * @return {CategoryExamples|undefined} An object containing the category examples. + */ +function getExamplesByCategory(categoryDefinition, examples) { + var _categoryDefinition$s; + if (!categoryDefinition?.slug || !examples?.length) { + return; + } + const categories = (_categoryDefinition$s = categoryDefinition?.subcategories) !== null && _categoryDefinition$s !== void 0 ? _categoryDefinition$s : []; + if (categories.length) { + return categories.reduce((acc, subcategoryDefinition) => { + const subcategoryExamples = getExamplesByCategory(subcategoryDefinition, examples); + if (subcategoryExamples) { + if (!acc.subcategories) { + acc.subcategories = []; + } + acc.subcategories = [...acc.subcategories, subcategoryExamples]; + } + return acc; + }, { + title: categoryDefinition.title, + slug: categoryDefinition.slug + }); + } + const blocksToInclude = categoryDefinition?.blocks || []; + const blocksToExclude = categoryDefinition?.exclude || []; + const categoryExamples = examples.filter(example => { + return !blocksToExclude.includes(example.name) && (example.category === categoryDefinition.slug || blocksToInclude.includes(example.name)); + }); + if (!categoryExamples.length) { + return; + } + return { + title: categoryDefinition.title, + slug: categoryDefinition.slug, + examples: categoryExamples + }; +} + +/** + * Returns category examples for a given category definition and list of examples. + * + * @return {StyleBookCategory[]} An array of top-level category definitions. + */ +function getTopLevelStyleBookCategories() { + const reservedCategories = [...STYLE_BOOK_THEME_SUBCATEGORIES, ...STYLE_BOOK_CATEGORIES].map(({ + slug + }) => slug); + const extraCategories = (0,external_wp_blocks_namespaceObject.getCategories)(); + const extraCategoriesFiltered = extraCategories.filter(({ + slug + }) => !reservedCategories.includes(slug)); + return [...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered]; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/color-examples.js /** * External dependencies */ @@ -22089,15 +22691,494 @@ - - - - - - -/** - * Internal dependencies - */ +/** + * Internal dependencies + */ + +const ColorExamples = ({ + colors, + type, + templateColumns = '1fr 1fr', + itemHeight = '52px' +}) => { + if (!colors) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + templateColumns: templateColumns, + rowGap: 8, + columnGap: 16, + children: colors.map(color => { + const className = type === 'gradients' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(color.slug) : (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color.slug); + const classes = dist_clsx('edit-site-style-book__color-example', className); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + className: classes, + style: { + height: itemHeight + } + }, color.slug); + }) + }); +}; +/* harmony default export */ const color_examples = (ColorExamples); + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/duotone-examples.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const DuotoneExamples = ({ + duotones +}) => { + if (!duotones) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + columns: 2, + rowGap: 16, + columnGap: 16, + children: duotones.map(duotone => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { + className: "edit-site-style-book__duotone-example", + columns: 2, + rowGap: 8, + columnGap: 8, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + alt: `Duotone example: ${duotone.slug}`, + src: "https://s.w.org/images/core/5.3/MtBlanc1.jpg", + style: { + filter: `url(#wp-duotone-${duotone.slug})` + } + }) + }), duotone.colors.map(color => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { + className: "edit-site-style-book__color-example", + style: { + backgroundColor: color + } + }, color); + })] + }, duotone.slug); + }) + }); +}; +/* harmony default export */ const duotone_examples = (DuotoneExamples); + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/examples.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +/** + * Returns examples color examples for each origin + * e.g. Core (Default), Theme, and User. + * + * @param {MultiOriginPalettes} colors Global Styles color palettes per origin. + * @return {BlockExample[]} An array of color block examples. + */ + +function getColorExamples(colors) { + if (!colors) { + return []; + } + const examples = []; + STYLE_BOOK_COLOR_GROUPS.forEach(group => { + const palette = colors[group.type]; + const paletteFiltered = Array.isArray(palette) ? palette.find(origin => origin.slug === group.origin) : undefined; + if (paletteFiltered?.[group.type]) { + const example = { + name: group.slug, + title: group.title, + category: 'colors' + }; + if (group.type === 'duotones') { + example.content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(duotone_examples, { + duotones: paletteFiltered[group.type] + }); + examples.push(example); + } else { + example.content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_examples, { + colors: paletteFiltered[group.type], + type: group.type + }); + examples.push(example); + } + } + }); + return examples; +} + +/** + * Returns examples for the overview page. + * + * @param {MultiOriginPalettes} colors Global Styles color palettes per origin. + * @return {BlockExample[]} An array of block examples. + */ +function getOverviewBlockExamples(colors) { + const examples = []; + + // Get theme palette from colors if they exist. + const themePalette = Array.isArray(colors?.colors) ? colors.colors.find(origin => origin.slug === 'theme') : undefined; + if (themePalette) { + const themeColorexample = { + name: 'theme-colors', + title: (0,external_wp_i18n_namespaceObject.__)('Colors'), + category: 'overview', + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_examples, { + colors: themePalette.colors, + type: "colors", + templateColumns: "repeat(auto-fill, minmax( 200px, 1fr ))", + itemHeight: "32px" + }) + }; + examples.push(themeColorexample); + } + + // Get examples for typography blocks. + const typographyBlockExamples = []; + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/heading')) { + const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { + content: (0,external_wp_i18n_namespaceObject.__)(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`), + level: 1 + }); + typographyBlockExamples.push(headingBlock); + } + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/paragraph')) { + const firstParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content: (0,external_wp_i18n_namespaceObject.__)(`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`) + }); + const secondParagraphBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { + content: (0,external_wp_i18n_namespaceObject.__)(`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`) + }); + if ((0,external_wp_blocks_namespaceObject.getBlockType)('core/group')) { + const groupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { + layout: { + type: 'grid', + columnCount: 2, + minimumColumnWidth: '12rem' + }, + style: { + spacing: { + blockGap: '1.5rem' + } + } + }, [firstParagraphBlock, secondParagraphBlock]); + typographyBlockExamples.push(groupBlock); + } else { + typographyBlockExamples.push(firstParagraphBlock); + } + } + if (!!typographyBlockExamples.length) { + examples.push({ + name: 'typography', + title: (0,external_wp_i18n_namespaceObject.__)('Typography'), + category: 'overview', + blocks: typographyBlockExamples + }); + } + const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search']; + + // Get examples for other blocks and put them in order of above array. + otherBlockExamples.forEach(blockName => { + const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); + if (blockType && blockType.example) { + const blockExample = { + name: blockName, + title: blockType.title, + category: 'overview', + /* + * CSS generated from style attributes will take precedence over global styles CSS, + * so remove the style attribute from the example to ensure the example + * demonstrates changes to global styles. + */ + blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, { + ...blockType.example, + attributes: { + ...blockType.example.attributes, + style: undefined + } + }) + }; + examples.push(blockExample); + } + }); + return examples; +} + +/** + * Returns a list of examples for registered block types. + * + * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User. + * @return {BlockExample[]} An array of block examples. + */ +function getExamples(colors) { + const nonHeadingBlockExamples = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => { + const { + name, + example, + supports + } = blockType; + return name !== 'core/heading' && !!example && supports?.inserter !== false; + }).map(blockType => ({ + name: blockType.name, + title: blockType.title, + category: blockType.category, + /* + * CSS generated from style attributes will take precedence over global styles CSS, + * so remove the style attribute from the example to ensure the example + * demonstrates changes to global styles. + */ + blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, { + ...blockType.example, + attributes: { + ...blockType.example.attributes, + style: undefined + } + }) + })); + const isHeadingBlockRegistered = !!(0,external_wp_blocks_namespaceObject.getBlockType)('core/heading'); + if (!isHeadingBlockRegistered) { + return nonHeadingBlockExamples; + } + + // Use our own example for the Heading block so that we can show multiple + // heading levels. + const headingsExample = { + name: 'core/heading', + title: (0,external_wp_i18n_namespaceObject.__)('Headings'), + category: 'text', + blocks: [1, 2, 3, 4, 5, 6].map(level => { + return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { + content: (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %d: heading level e.g: "1", "2", "3" + (0,external_wp_i18n_namespaceObject.__)('Heading %d'), level), + level + }); + }) + }; + const colorExamples = getColorExamples(colors); + const overviewBlockExamples = getOverviewBlockExamples(colors); + return [headingsExample, ...colorExamples, ...nonHeadingBlockExamples, ...overviewBlockExamples]; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page/header.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +function Header({ + title, + subTitle, + actions +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "edit-site-page-header", + as: "header", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "edit-site-page-header__page-title", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + as: "h2", + level: 3, + weight: 500, + className: "edit-site-page-header__title", + truncate: true, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "edit-site-page-header__actions", + children: actions + })] + }), subTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + variant: "muted", + as: "p", + className: "edit-site-page-header__sub-title", + children: subTitle + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const { + NavigableRegion: page_NavigableRegion +} = unlock(external_wp_editor_namespaceObject.privateApis); +function Page({ + title, + subTitle, + actions, + children, + className, + hideTitleFromUI = false +}) { + const classes = dist_clsx('edit-site-page', className); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_NavigableRegion, { + className: classes, + ariaLabel: title, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "edit-site-page-content", + children: [!hideTitleFromUI && title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, { + title: title, + subTitle: subTitle, + actions: actions + }), children] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-global-styles-wrapper/index.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useLocation: sidebar_global_styles_wrapper_useLocation, + useHistory: sidebar_global_styles_wrapper_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const GlobalStylesPageActions = ({ + isStyleBookOpened, + setIsStyleBookOpened, + path +}) => { + const history = sidebar_global_styles_wrapper_useHistory(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + isPressed: isStyleBookOpened, + icon: library_seen, + label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), + onClick: () => { + setIsStyleBookOpened(!isStyleBookOpened); + const updatedPath = !isStyleBookOpened ? (0,external_wp_url_namespaceObject.addQueryArgs)(path, { + preview: 'stylebook' + }) : (0,external_wp_url_namespaceObject.removeQueryArgs)(path, 'preview'); + // Navigate to the updated path. + history.navigate(updatedPath); + }, + size: "compact" + }); +}; + +/** + * Hook to deal with navigation and location state. + * + * @return {Array} The current section and a function to update it. + */ +const useSection = () => { + const { + path, + query + } = sidebar_global_styles_wrapper_useLocation(); + const history = sidebar_global_styles_wrapper_useHistory(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + var _query$section; + return [(_query$section = query.section) !== null && _query$section !== void 0 ? _query$section : '/', updatedSection => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + section: updatedSection + })); + }]; + }, [path, query.section, history]); +}; +function GlobalStylesUIWrapper() { + const { + path + } = sidebar_global_styles_wrapper_useLocation(); + const [isStyleBookOpened, setIsStyleBookOpened] = (0,external_wp_element_namespaceObject.useState)(path.includes('preview=stylebook')); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const [section, onChangeSection] = useSection(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { + actions: !isMobileViewport ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesPageActions, { + isStyleBookOpened: isStyleBookOpened, + setIsStyleBookOpened: setIsStyleBookOpened, + path: path + }) : null, + className: "edit-site-styles", + title: (0,external_wp_i18n_namespaceObject.__)('Styles'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global_styles_ui, { + path: section, + onPathChange: onChangeSection + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + @@ -22107,129 +23188,116 @@ useGlobalStyle: style_book_useGlobalStyle, GlobalStylesContext: style_book_GlobalStylesContext, useGlobalStylesOutputWithConfig -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { mergeBaseAndUserConfigs: style_book_mergeBaseAndUserConfigs -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const { - CompositeV2: Composite, - CompositeItemV2: CompositeItem, - useCompositeStoreV2: useCompositeStore, +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { Tabs: style_book_Tabs -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); - -// The content area of the Style Book is rendered within an iframe so that global styles -// are applied to elements within the entire content area. To support elements that are -// not part of the block previews, such as headings and layout for the block previews, -// additional CSS rules need to be passed into the iframe. These are hard-coded below. -// Note that button styles are unset, and then focus rules from the `Button` component are -// applied to the `button` element, targeted via `.edit-site-style-book__example`. -// This is to ensure that browser default styles for buttons are not applied to the previews. -const STYLE_BOOK_IFRAME_STYLES = ` - .edit-site-style-book__examples { - max-width: 900px; - margin: 0 auto; - } - - .edit-site-style-book__example { - border-radius: 2px; - cursor: pointer; - display: flex; - flex-direction: column; - gap: 40px; - margin-bottom: 40px; - padding: 16px; - width: 100%; - box-sizing: border-box; - scroll-margin-top: 32px; - scroll-margin-bottom: 32px; - } - - .edit-site-style-book__example.is-selected { - box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); - } - - .edit-site-style-book__example:focus:not(:disabled) { - box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba)); - outline: 3px solid transparent; - } - - .edit-site-style-book__examples.is-wide .edit-site-style-book__example { - flex-direction: row; - } - - .edit-site-style-book__example-title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 11px; - font-weight: 500; - line-height: normal; - margin: 0; - text-align: left; - text-transform: uppercase; - } - - .edit-site-style-book__examples.is-wide .edit-site-style-book__example-title { - text-align: right; - width: 120px; - } - - .edit-site-style-book__example-preview { - width: 100%; - } - - .edit-site-style-book__example-preview .block-editor-block-list__insertion-point, - .edit-site-style-book__example-preview .block-list-appender { - display: none; - } - - .edit-site-style-book__example-preview .is-root-container > .wp-block:first-child { - margin-top: 0; - } - .edit-site-style-book__example-preview .is-root-container > .wp-block:last-child { - margin-bottom: 0; - } -`; +} = unlock(external_wp_components_namespaceObject.privateApis); function isObjectEmpty(object) { return !object || Object.keys(object).length === 0; } -function getExamples() { - // Use our own example for the Heading block so that we can show multiple - // heading levels. - const headingsExample = { - name: 'core/heading', - title: (0,external_wp_i18n_namespaceObject.__)('Headings'), - category: 'text', - blocks: [(0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { - content: (0,external_wp_i18n_namespaceObject.__)('Code Is Poetry'), - level: 1 - }), (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { - content: (0,external_wp_i18n_namespaceObject.__)('Code Is Poetry'), - level: 2 - }), (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { - content: (0,external_wp_i18n_namespaceObject.__)('Code Is Poetry'), - level: 3 - }), (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { - content: (0,external_wp_i18n_namespaceObject.__)('Code Is Poetry'), - level: 4 - }), (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { - content: (0,external_wp_i18n_namespaceObject.__)('Code Is Poetry'), - level: 5 - })] - }; - const otherExamples = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => { - const { - name, - example, - supports - } = blockType; - return name !== 'core/heading' && !!example && supports.inserter !== false; - }).map(blockType => ({ - name: blockType.name, - title: blockType.title, - category: blockType.category, - blocks: (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockType.name, blockType.example) - })); - return [headingsExample, ...otherExamples]; + +/** + * Scrolls to a section within an iframe. + * + * @param {string} anchorId The id of the element to scroll to. + * @param {HTMLIFrameElement} iframe The target iframe. + */ +const scrollToSection = (anchorId, iframe) => { + if (!anchorId || !iframe || !iframe?.contentDocument) { + return; + } + const element = anchorId === 'top' ? iframe.contentDocument.body : iframe.contentDocument.getElementById(anchorId); + if (element) { + element.scrollIntoView({ + behavior: 'smooth' + }); + } +}; + +/** + * Parses a Block Editor navigation path to build a style book navigation path. + * The object can be extended to include a category, representing a style book tab/section. + * + * @param {string} path An internal Block Editor navigation path. + * @return {null|{block: string}} An object containing the example to navigate to. + */ +const getStyleBookNavigationFromPath = path => { + if (path && typeof path === 'string') { + if (path === '/' || path.startsWith('/typography') || path.startsWith('/colors') || path.startsWith('/blocks')) { + return { + top: true + }; + } + } + return null; +}; + +/** + * Retrieves colors, gradients, and duotone filters from Global Styles. + * The inclusion of default (Core) palettes is controlled by the relevant + * theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone. + * + * @return {Object} Object containing properties for each type of palette. + */ +function useMultiOriginPalettes() { + const { + colors, + gradients + } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); + + // Add duotone filters to the palettes data. + const [shouldDisplayDefaultDuotones, customDuotones, themeDuotones, defaultDuotones] = (0,external_wp_blockEditor_namespaceObject.useSettings)('color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default'); + const palettes = (0,external_wp_element_namespaceObject.useMemo)(() => { + const result = { + colors, + gradients, + duotones: [] + }; + if (themeDuotones && themeDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates these duotone filters come from the theme.'), + slug: 'theme', + duotones: themeDuotones + }); + } + if (shouldDisplayDefaultDuotones && defaultDuotones && defaultDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates these duotone filters come from WordPress.'), + slug: 'default', + duotones: defaultDuotones + }); + } + if (customDuotones && customDuotones.length) { + result.duotones.push({ + name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates these doutone filters are created by the user.'), + slug: 'custom', + duotones: customDuotones + }); + } + return result; + }, [colors, gradients, customDuotones, themeDuotones, defaultDuotones, shouldDisplayDefaultDuotones]); + return palettes; +} + +/** + * Get deduped examples for single page stylebook. + * @param {Array} examples Array of examples. + * @return {Array} Deduped examples. + */ +function getExamplesForSinglePageUse(examples) { + const examplesForSinglePageUse = []; + const overviewCategoryExamples = getExamplesByCategory({ + slug: 'overview' + }, examples); + examplesForSinglePageUse.push(...overviewCategoryExamples.examples); + const otherExamples = examples.filter(example => { + return example.category !== 'overview' && !overviewCategoryExamples.examples.find(overviewExample => overviewExample.name === example.name); + }); + examplesForSinglePageUse.push(...otherExamples); + return examplesForSinglePageUse; } function StyleBook({ enableResizing = true, @@ -22239,20 +23307,19 @@ showCloseButton = true, onClose, showTabs = true, - userConfig = {} -}) { - const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); + userConfig = {}, + path = '' +}) { const [textColor] = style_book_useGlobalStyle('color.text'); const [backgroundColor] = style_book_useGlobalStyle('color.background'); - const [examples] = (0,external_wp_element_namespaceObject.useState)(getExamples); - const tabs = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_blocks_namespaceObject.getCategories)().filter(category => examples.some(example => example.category === category.slug)).map(category => ({ - name: category.slug, - title: category.title, - icon: category.icon - })), [examples]); + const colors = useMultiOriginPalettes(); + const examples = (0,external_wp_element_namespaceObject.useMemo)(() => getExamples(colors), [colors]); + const tabs = (0,external_wp_element_namespaceObject.useMemo)(() => getTopLevelStyleBookCategories().filter(category => examples.some(example => example.category === category.slug)), [examples]); + const examplesForSinglePageUse = getExamplesForSinglePageUse(examples); const { base: baseConfig } = (0,external_wp_element_namespaceObject.useContext)(style_book_GlobalStylesContext); + const goTo = getStyleBookNavigationFromPath(path); const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) { return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig); @@ -22263,70 +23330,186 @@ // Copied from packages/edit-site/src/components/revisions/index.js // could we create a shared hook? const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); + const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, - __unstableIsPreviewMode: true - }), [originalSettings]); - const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); - settings.styles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles; + styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : originalSettings.styles, + isPreviewMode: true + }), [globalStyles, originalSettings, userConfig]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_canvas_container, { onClose: onClose, enableResizing: enableResizing, closeButtonLabel: showCloseButton ? (0,external_wp_i18n_namespaceObject.__)('Close') : null, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('edit-site-style-book', { - 'is-wide': sizes.width > 600, 'is-button': !!onClick }), style: { color: textColor, background: backgroundColor }, - children: [resizeObserver, showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-style-book__tabs", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(style_book_Tabs, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabList, { + children: showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(style_book_Tabs, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-style-book__tablist-container", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabList, { children: tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.Tab, { - tabId: tab.name, + tabId: tab.slug, children: tab.title - }, tab.name)) - }), tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabPanel, { - tabId: tab.name, + }, tab.slug)) + }) + }), tabs.map(tab => { + const categoryDefinition = tab.slug ? getTopLevelStyleBookCategories().find(_category => _category.slug === tab.slug) : null; + const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : { + examples + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book_Tabs.TabPanel, { + tabId: tab.slug, focusable: false, + className: "edit-site-style-book__tabpanel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { - category: tab.name, - examples: examples, + category: tab.slug, + examples: filteredExamples, isSelected: isSelected, onSelect: onSelect, settings: settings, - sizes: sizes, - title: tab.title + title: tab.title, + goTo: goTo }) - }, tab.name))] - }) + }, tab.slug); + })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { - examples: examples, + examples: { + examples: examplesForSinglePageUse + }, isSelected: isSelected, onClick: onClick, onSelect: onSelect, settings: settings, - sizes: sizes - })] - }) - }); -} + goTo: goTo + }) + }) + }); +} + +/** + * Style Book Preview component renders the stylebook without the Editor dependency. + * + * @param {Object} props Component props. + * @param {Object} props.userConfig User configuration. + * @param {boolean} props.isStatic Whether the stylebook is static or clickable. + * @return {Object} Style Book Preview component. + */ +const StyleBookPreview = ({ + userConfig = {}, + isStatic = false +}) => { + const siteEditorSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); + const canUserUploadMedia = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('create', { + kind: 'root', + name: 'media' + }), []); + + // Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there. + (0,external_wp_element_namespaceObject.useEffect)(() => { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_blockEditor_namespaceObject.store).updateSettings({ + ...siteEditorSettings, + mediaUpload: canUserUploadMedia ? external_wp_mediaUtils_namespaceObject.uploadMedia : undefined + }); + }, [siteEditorSettings, canUserUploadMedia]); + const [section, onChangeSection] = useSection(); + const isSelected = blockName => { + // Match '/blocks/core%2Fbutton' and + // '/blocks/core%2Fbutton/typography', but not + // '/blocks/core%2Fbuttons'. + return section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`); + }; + const onSelect = blockName => { + if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) { + // Go to color palettes Global Styles. + onChangeSection('/colors/palette'); + return; + } + if (blockName === 'typography') { + // Go to typography Global Styles. + onChangeSection('/typography'); + return; + } + + // Now go to the selected block. + onChangeSection(`/blocks/${encodeURIComponent(blockName)}`); + }; + const colors = useMultiOriginPalettes(); + const examples = getExamples(colors); + const examplesForSinglePageUse = getExamplesForSinglePageUse(examples); + let previewCategory = null; + if (section.includes('/colors')) { + previewCategory = 'colors'; + } else if (section.includes('/typography')) { + previewCategory = 'text'; + } else if (section.includes('/blocks')) { + previewCategory = 'blocks'; + const blockName = decodeURIComponent(section).split('/blocks/')[1]; + if (blockName && examples.find(example => example.name === blockName)) { + previewCategory = blockName; + } + } else if (!isStatic) { + previewCategory = 'overview'; + } + const categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(category => category.slug === previewCategory); + + // If there's no category definition there may be a single block. + const filteredExamples = categoryDefinition ? getExamplesByCategory(categoryDefinition, examples) : { + examples: [examples.find(example => example.name === previewCategory)] + }; + + // If there's no preview category, show all examples. + const displayedExamples = previewCategory ? filteredExamples : { + examples: examplesForSinglePageUse + }; + const { + base: baseConfig + } = (0,external_wp_element_namespaceObject.useContext)(style_book_GlobalStylesContext); + const goTo = getStyleBookNavigationFromPath(section); + const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) { + return style_book_mergeBaseAndUserConfigs(baseConfig, userConfig); + } + return {}; + }, [baseConfig, userConfig]); + const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); + const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + ...siteEditorSettings, + styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles, + isPreviewMode: true + }), [globalStyles, siteEditorSettings, userConfig]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-style-book", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { + settings: settings, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, { + disableRootPadding: true + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookBody, { + examples: displayedExamples, + settings: settings, + goTo: goTo, + isSelected: !isStatic ? isSelected : null, + onSelect: !isStatic ? onSelect : null + })] + }) + }); +}; const StyleBookBody = ({ - category, examples, isSelected, onClick, onSelect, settings, - sizes, - title + title, + goTo }) => { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); - + const [hasIframeLoaded, setHasIframeLoaded] = (0,external_wp_element_namespaceObject.useState)(false); + const iframeRef = (0,external_wp_element_namespaceObject.useRef)(null); // The presence of an `onClick` prop indicates that the Style Book is being used as a button. // In this case, add additional props to the iframe to make it behave like a button. const buttonModeProps = { @@ -22356,8 +23539,17 @@ }, readonly: true }; - const buttonModeStyles = onClick ? 'body { cursor: pointer; } body * { pointer-events: none; }' : ''; + const handleLoad = () => setHasIframeLoaded(true); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (hasIframeLoaded && iframeRef?.current) { + if (goTo?.top) { + scrollToSection('top', iframeRef?.current); + } + } + }, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.__unstableIframe, { + onLoad: handleLoad, + ref: iframeRef, className: dist_clsx('edit-site-style-book__iframe', { 'is-focused': isFocused && !!onClick, 'is-button': !!onClick @@ -22367,85 +23559,107 @@ ...(onClick ? buttonModeProps : {}), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: settings.styles - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { - children: - // Forming a "block formatting context" to prevent margin collapsing. - // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context - `.is-root-container { display: flow-root; } - body { position: relative; padding: 32px !important; }` + STYLE_BOOK_IFRAME_STYLES + buttonModeStyles + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("style", { + children: [STYLE_BOOK_IFRAME_STYLES, !!onClick && 'body { cursor: pointer; } body * { pointer-events: none; }'] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Examples, { - className: dist_clsx('edit-site-style-book__examples', { - 'is-wide': sizes.width > 600 - }), - examples: examples, - category: category, + className: "edit-site-style-book__examples", + filteredExamples: examples, label: title ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Category of blocks, e.g. Text. (0,external_wp_i18n_namespaceObject.__)('Examples of blocks in the %s category'), title) : (0,external_wp_i18n_namespaceObject.__)('Examples of blocks'), isSelected: isSelected, onSelect: onSelect - }, category)] + }, title)] }); }; const Examples = (0,external_wp_element_namespaceObject.memo)(({ className, - examples, - category, + filteredExamples, label, isSelected, onSelect }) => { - const compositeStore = useCompositeStore({ - orientation: 'vertical' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Composite, { - store: compositeStore, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite, { + orientation: "vertical", className: className, "aria-label": label, role: "grid", - children: examples.filter(example => category ? example.category === category : true).map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { + children: [!!filteredExamples?.examples?.length && filteredExamples.examples.map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { id: `example-${example.name}`, title: example.title, + content: example.content, blocks: example.blocks, - isSelected: isSelected(example.name), - onClick: () => { - onSelect?.(example.name); - } - }, example.name)) - }); -}); + isSelected: isSelected?.(example.name), + onClick: !!onSelect ? () => onSelect(example.name) : null + }, example.name)), !!filteredExamples?.subcategories?.length && filteredExamples.subcategories.map(subcategory => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Group, { + className: "edit-site-style-book__subcategory", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.GroupLabel, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { + className: "edit-site-style-book__subcategory-title", + children: subcategory.title + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Subcategory, { + examples: subcategory.examples, + isSelected: isSelected, + onSelect: onSelect + })] + }, `subcategory-${subcategory.slug}`))] + }); +}); +const Subcategory = ({ + examples, + isSelected, + onSelect +}) => { + return !!examples?.length && examples.map(example => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Example, { + id: `example-${example.name}`, + title: example.title, + content: example.content, + blocks: example.blocks, + isSelected: isSelected?.(example.name), + onClick: !!onSelect ? () => onSelect(example.name) : null + }, example.name)); +}; +const disabledExamples = ['example-duotones']; const Example = ({ id, title, blocks, isSelected, - onClick + onClick, + content }) => { const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, focusMode: false, // Disable "Spotlight mode". - __unstableIsPreviewMode: true + isPreviewMode: true }), [originalSettings]); // Cache the list of blocks to avoid additional processing when the component is re-rendered. const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]); + const disabledProps = disabledExamples.includes(id) || !onClick ? { + disabled: true, + accessibleWhenDisabled: !!onClick + } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "row", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(CompositeItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { className: dist_clsx('edit-site-style-book__example', { - 'is-selected': isSelected + 'is-selected': isSelected, + 'is-disabled-example': !!disabledProps?.disabled }), id: id, - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( + "aria-label": !!onClick ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of a block, e.g. Heading. - (0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title), + (0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title) : undefined, render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), - role: "button", + role: !!onClick ? 'button' : null, onClick: onClick, + ...disabledProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-site-style-book__example-title", children: title @@ -22454,12 +23668,12 @@ "aria-hidden": true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { className: "edit-site-style-book__example-preview__content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { + children: content ? content : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, { value: renderedBlocks, settings: settings, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { renderAppender: false - }) + })] }) }) })] @@ -22469,18 +23683,18 @@ }; /* harmony default export */ const style_book = (StyleBook); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-css.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-css.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ @@ -22488,7 +23702,7 @@ const { useGlobalStyle: screen_css_useGlobalStyle, AdvancedPanel: screen_css_StylesAdvancedPanel -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ScreenCSS() { const description = (0,external_wp_i18n_namespaceObject.__)('Add your own CSS to customize the appearance and layout of your site.'); const [style] = screen_css_useGlobalStyle('', undefined, 'user', { @@ -22497,16 +23711,22 @@ const [inheritedStyle, setStyle] = screen_css_useGlobalStyle('', undefined, 'all', { shouldDecodeEncode: false }); + const { + setEditorCanvasContainerView + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, { title: (0,external_wp_i18n_namespaceObject.__)('CSS'), description: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [description, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { - href: "https://developer.wordpress.org/advanced-administration/wordpress/css/", + children: [description, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { + href: (0,external_wp_i18n_namespaceObject.__)('https://developer.wordpress.org/advanced-administration/wordpress/css/'), className: "edit-site-global-styles-screen-css-help-link", children: (0,external_wp_i18n_namespaceObject.__)('Learn more about CSS') })] - }) + }), + onBack: () => { + setEditorCanvasContainerView(undefined); + } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-site-global-styles-screen-css", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_css_StylesAdvancedPanel, { @@ -22519,21 +23739,20 @@ } /* harmony default export */ const screen_css = (ScreenCSS); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/revisions/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/revisions/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ @@ -22543,10 +23762,10 @@ GlobalStylesContext: revisions_GlobalStylesContext, useGlobalStylesOutputWithConfig: revisions_useGlobalStylesOutputWithConfig, __unstableBlockStyleVariationOverridesWithConfig -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { mergeBaseAndUserConfigs: revisions_mergeBaseAndUserConfigs -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); function revisions_isObjectEmpty(object) { return !object || Object.keys(object).length === 0; } @@ -22567,7 +23786,7 @@ const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, - __unstableIsPreviewMode: true + isPreviewMode: true }), [originalSettings]); const [globalStyles] = revisions_useGlobalStylesOutputWithConfig(mergedConfig); const editorStyles = !revisions_isObjectEmpty(globalStyles) && !revisions_isObjectEmpty(userConfig) ? globalStyles : settings.styles; @@ -22603,164 +23822,28 @@ } /* harmony default export */ const components_revisions = (Revisions); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -const SITE_EDITOR_AUTHORS_QUERY = { - per_page: -1, - _fields: 'id,name,avatar_urls', - context: 'view', - capabilities: ['edit_theme_options'] -}; -const DEFAULT_QUERY = { - per_page: 100, - page: 1 -}; -const EMPTY_ARRAY = []; -const { - GlobalStylesContext: use_global_styles_revisions_GlobalStylesContext -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -function useGlobalStylesRevisions({ - query -} = {}) { - const { - user: userConfig - } = (0,external_wp_element_namespaceObject.useContext)(use_global_styles_revisions_GlobalStylesContext); - const _query = { - ...DEFAULT_QUERY, - ...query - }; - const { - authors, - currentUser, - isDirty, - revisions, - isLoadingGlobalStylesRevisions, - revisionsCount - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _globalStyles$_links$; - const { - __experimentalGetDirtyEntityRecords, - getCurrentUser, - getUsers, - getRevisions, - __experimentalGetCurrentGlobalStylesId, - getEntityRecord, - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); - const _currentUser = getCurrentUser(); - const _isDirty = dirtyEntityRecords.length > 0; - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - const _revisionsCount = (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0; - const globalStylesRevisions = getRevisions('root', 'globalStyles', globalStylesId, _query) || EMPTY_ARRAY; - const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || EMPTY_ARRAY; - const _isResolving = isResolving('getRevisions', ['root', 'globalStyles', globalStylesId, _query]); - return { - authors: _authors, - currentUser: _currentUser, - isDirty: _isDirty, - revisions: globalStylesRevisions, - isLoadingGlobalStylesRevisions: _isResolving, - revisionsCount: _revisionsCount - }; - }, [query]); - return (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!authors.length || isLoadingGlobalStylesRevisions) { - return { - revisions: EMPTY_ARRAY, - hasUnsavedChanges: isDirty, - isLoading: true, - revisionsCount - }; - } - - // Adds author details to each revision. - const _modifiedRevisions = revisions.map(revision => { - return { - ...revision, - author: authors.find(author => author.id === revision.author) - }; - }); - const fetchedRevisionsCount = revisions.length; - if (fetchedRevisionsCount) { - // Flags the most current saved revision. - if (_modifiedRevisions[0].id !== 'unsaved' && _query.page === 1) { - _modifiedRevisions[0].isLatest = true; - } - - // Adds an item for unsaved changes. - if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) { - const unsavedRevision = { - id: 'unsaved', - styles: userConfig?.styles, - settings: userConfig?.settings, - _links: userConfig?._links, - author: { - name: currentUser?.name, - avatar_urls: currentUser?.avatar_urls - }, - modified: new Date() - }; - _modifiedRevisions.unshift(unsavedRevision); - } - if (_query.page === Math.ceil(revisionsCount / _query.per_page)) { - // Adds an item for the default theme styles. - _modifiedRevisions.push({ - id: 'parent', - styles: {}, - settings: {} - }); - } - } - return { - revisions: _modifiedRevisions, - hasUnsavedChanges: isDirty, - isLoading: false, - revisionsCount - }; - }, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]); -} - -;// CONCATENATED MODULE: external ["wp","date"] +;// external ["wp","date"] const external_wp_date_namespaceObject = window["wp"]["date"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/revisions-buttons.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/revisions-buttons.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ const DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24; const { getGlobalStylesChanges -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ChangesSummary({ revision, previousRevision @@ -22794,13 +23877,13 @@ return (0,external_wp_i18n_namespaceObject.__)('Reset the styles to the theme defaults'); } if ('unsaved' === id) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: author display name */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: author display name */ (0,external_wp_i18n_namespaceObject.__)('Unsaved changes by %s'), authorDisplayName); } return areStylesEqual ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1$s: author display name, %2$s: revision creation date. + // translators: 1: author display name. 2: revision creation date. (0,external_wp_i18n_namespaceObject.__)('Changes saved by %1$s on %2$s. This revision matches current editor styles.'), authorDisplayName, formattedModifiedDate) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1$s: author display name, %2$s: revision creation date. + // translators: 1: author display name. 2: revision creation date. (0,external_wp_i18n_namespaceObject.__)('Changes saved by %1$s on %2$s'), authorDisplayName, formattedModifiedDate); } @@ -22840,10 +23923,11 @@ const { datetimeAbbreviated } = (0,external_wp_date_namespaceObject.getSettings)().formats; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { + orientation: "vertical", className: "edit-site-global-styles-screen-revisions__revisions-list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Global styles revisions list'), - role: "group", + role: "listbox", children: userRevisions.map((revision, index) => { const { id, @@ -22862,21 +23946,27 @@ const modifiedDate = (0,external_wp_date_namespaceObject.getDate)(modified); const displayDate = modified && dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS ? (0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate) : (0,external_wp_date_namespaceObject.humanTimeDiff)(modified); const revisionLabel = getRevisionLabel(id, authorDisplayName, (0,external_wp_date_namespaceObject.dateI18n)(datetimeAbbreviated, modifiedDate), areStylesEqual); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { - className: dist_clsx('edit-site-global-styles-screen-revisions__revision-item', { - 'is-selected': isSelected, - 'is-active': areStylesEqual, - 'is-reset': isReset - }), + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { + className: "edit-site-global-styles-screen-revisions__revision-item", "aria-current": isSelected, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "edit-site-global-styles-screen-revisions__revision-button", - __experimentalIsFocusable: true, - disabled: isSelected, - onClick: () => { + role: "option", + onKeyDown: event => { + const { + keyCode + } = event; + if (keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) { onChange(revision); - }, - "aria-label": revisionLabel, + } + }, + onClick: event => { + event.preventDefault(); + onChange(revision); + }, + "aria-selected": isSelected, + "aria-label": revisionLabel, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "edit-site-global-styles-screen-revisions__revision-item-wrapper", children: isReset ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "edit-site-global-styles-screen-revisions__description", children: [(0,external_wp_i18n_namespaceObject.__)('Default styles'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { @@ -22911,6 +24001,7 @@ variant: "primary", className: "edit-site-global-styles-screen-revisions__apply-button", onClick: onApplyRevision, + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Apply the selected revision to your site.'), children: isReset ? (0,external_wp_i18n_namespaceObject.__)('Reset to defaults') : (0,external_wp_i18n_namespaceObject.__)('Apply') }))] }, id); @@ -22919,37 +24010,7 @@ } /* harmony default export */ const revisions_buttons = (RevisionsButtons); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js -/** - * WordPress dependencies - */ - - -const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" - }) -}); -/* harmony default export */ const library_previous = (previous); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js -/** - * WordPress dependencies - */ - - -const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" - }) -}); -/* harmony default export */ const library_next = (next); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/pagination/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/pagination/index.js /** * External dependencies */ @@ -22962,7 +24023,6 @@ - function Pagination({ currentPage, numPages, @@ -22971,7 +24031,7 @@ className, disabled = false, buttonVariant = 'tertiary', - label = (0,external_wp_i18n_namespaceObject.__)('Pagination Navigation') + label = (0,external_wp_i18n_namespaceObject.__)('Pagination') }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, @@ -22994,24 +24054,24 @@ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: buttonVariant, onClick: () => changePage(1), - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, disabled: disabled || currentPage === 1, label: (0,external_wp_i18n_namespaceObject.__)('First page'), - icon: library_previous, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_next : library_previous, size: "compact" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: buttonVariant, onClick: () => changePage(currentPage - 1), - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, disabled: disabled || currentPage === 1, label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), - icon: chevron_left, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "compact" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1$s: Current page number, %2$s: Total number of pages. + // translators: 1: Current page number. 2: Total number of pages. (0,external_wp_i18n_namespaceObject._x)('%1$s of %2$s', 'paging'), currentPage, numPages) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, @@ -23019,39 +24079,37 @@ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: buttonVariant, onClick: () => changePage(currentPage + 1), - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, disabled: disabled || currentPage === numPages, label: (0,external_wp_i18n_namespaceObject.__)('Next page'), - icon: chevron_right, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right, size: "compact" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: buttonVariant, onClick: () => changePage(numPages), - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, disabled: disabled || currentPage === numPages, label: (0,external_wp_i18n_namespaceObject.__)('Last page'), - icon: library_next, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_previous : library_next, size: "compact" })] })] }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/screen-revisions/index.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -23064,13 +24122,10 @@ const { GlobalStylesContext: screen_revisions_GlobalStylesContext, areGlobalStyleConfigsEqual: screen_revisions_areGlobalStyleConfigsEqual -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const PAGE_SIZE = 10; function ScreenRevisions() { const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); - const { user: currentEditorGlobalStyles, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(screen_revisions_GlobalStylesContext); @@ -23078,7 +24133,7 @@ blocks, editorCanvasContainerView } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ - editorCanvasContainerView: lock_unlock_unlock(select(store)).getEditorCanvasContainerView(), + editorCanvasContainerView: unlock(select(store)).getEditorCanvasContainerView(), blocks: select(external_wp_blockEditor_namespaceObject.store).getBlocks() }), []); const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(1); @@ -23099,10 +24154,12 @@ const [isLoadingRevisionWithUnsavedChanges, setIsLoadingRevisionWithUnsavedChanges] = (0,external_wp_element_namespaceObject.useState)(false); const { setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const selectedRevisionMatchesEditorStyles = screen_revisions_areGlobalStyleConfigsEqual(currentlySelectedRevision, currentEditorGlobalStyles); + + // The actual code that triggers the revisions screen to navigate back + // to the home screen in in `packages/edit-site/src/components/global-styles/ui.js`. const onCloseRevisions = () => { - goTo('/'); // Return to global styles main panel. const canvasContainerView = editorCanvasContainerView === 'global-styles-revisions:style-book' ? 'style-book' : undefined; setEditorCanvasContainerView(canvasContainerView); }; @@ -23112,11 +24169,6 @@ onCloseRevisions(); }; (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!editorCanvasContainerView || !editorCanvasContainerView.startsWith('global-styles-revisions')) { - goTo('/'); // Return to global styles main panel. - } - }, [editorCanvasContainerView]); - (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isLoading && revisions.length) { setCurrentRevisions(revisions); } @@ -23175,7 +24227,7 @@ changePage: setCurrentPage, totalItems: revisionsCount, disabled: isLoading, - label: (0,external_wp_i18n_namespaceObject.__)('Global Styles pagination navigation') + label: (0,external_wp_i18n_namespaceObject.__)('Global Styles pagination') }) }), isLoadingRevisionWithUnsavedChanges && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: isLoadingRevisionWithUnsavedChanges, @@ -23189,23 +24241,26 @@ } /* harmony default export */ const screen_revisions = (ScreenRevisions); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js -/** - * WordPress dependencies - */ - - - - - - - - - - -/** - * Internal dependencies - */ +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/ui.js +/** + * WordPress dependencies + */ + + + + + + + + + + + +/** + * Internal dependencies + */ + + @@ -23227,7 +24282,7 @@ const SLOT_FILL_NAME = 'GlobalStylesMenu'; const { useGlobalStylesReset: ui_useGlobalStylesReset -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill @@ -23252,13 +24307,9 @@ }, []); const { setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const loadCustomCSS = () => { setEditorCanvasContainerView('global-styles-css'); - goTo('/css'); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuFill, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { @@ -23299,7 +24350,7 @@ className, ...props }) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' '), ...props }); @@ -23341,7 +24392,7 @@ }); } function GlobalStylesStyleBook() { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const { path } = navigator.location; @@ -23352,13 +24403,24 @@ // '/blocks/core%2Fbuttons'. path === `/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/blocks/${encodeURIComponent(blockName)}/`), onSelect: blockName => { + if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) { + // Go to color palettes Global Styles. + navigator.goTo('/colors/palette'); + return; + } + if (blockName === 'typography') { + // Go to typography Global Styles. + navigator.goTo('/typography'); + return; + } + // Now go to the selected block. navigator.goTo('/blocks/' + encodeURIComponent(blockName)); } }); } function GlobalStylesBlockLink() { - const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); const { selectedBlockName, selectedBlockClientId @@ -23397,8 +24459,8 @@ const { goTo, location - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); - const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => lock_unlock_unlock(select(store)).getEditorCanvasContainerView(), []); + } = (0,external_wp_components_namespaceObject.useNavigator)(); + const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getEditorCanvasContainerView(), []); const path = location?.path; const isRevisionsOpen = path === '/revisions'; @@ -23409,46 +24471,77 @@ switch (editorCanvasContainerView) { case 'global-styles-revisions': case 'global-styles-revisions:style-book': - goTo('/revisions'); + if (!isRevisionsOpen) { + goTo('/revisions'); + } break; case 'global-styles-css': goTo('/css'); break; + // The stand-alone style book is open + // and the revisions panel is open, + // close the revisions panel. + // Otherwise keep the style book open while + // browsing global styles panel. + // + // Falling through as it matches the default scenario. case 'style-book': - /* - * The stand-alone style book is open - * and the revisions panel is open, - * close the revisions panel. - * Otherwise keep the style book open while - * browsing global styles panel. - */ + default: + // In general, if the revision screen is in view but the + // `editorCanvasContainerView` is not a revision view, close it. + // This also includes the scenario when the stand-alone style + // book is open, in which case we want the user to close the + // revisions screen and browse global styles. if (isRevisionsOpen) { - goTo('/'); - } - break; - default: - /* - * Example: the user has navigated to "Browse styles" or elsewhere - * and changes the editorCanvasContainerView, e.g., closes the style book. - * The panel should not be affected. - * Exclude revisions panel from this behavior, - * as it should close when the editorCanvasContainerView doesn't correspond. - */ - if (path !== '/' && !isRevisionsOpen) { - return; - } - goTo('/'); + goTo('/', { + isBack: true + }); + } break; } }, [editorCanvasContainerView, isRevisionsOpen, goTo]); } -function GlobalStylesUI() { +function useNavigatorSync(parentPath, onPathChange) { + const navigator = (0,external_wp_components_namespaceObject.useNavigator)(); + const { + path: childPath + } = navigator.location; + const previousParentPath = (0,external_wp_compose_namespaceObject.usePrevious)(parentPath); + const previousChildPath = (0,external_wp_compose_namespaceObject.usePrevious)(childPath); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (parentPath !== childPath) { + if (parentPath !== previousParentPath) { + navigator.goTo(parentPath); + } else if (childPath !== previousChildPath) { + onPathChange(childPath); + } + } + }, [onPathChange, parentPath, previousChildPath, previousParentPath, childPath, navigator]); +} + +// This component is used to wrap the hook in order to conditionally execute it +// when the parent component is used on controlled mode. +function NavigationSync({ + path: parentPath, + onPathChange, + children +}) { + useNavigatorSync(parentPath, onPathChange); + return children; +} +function GlobalStylesUI({ + path, + onPathChange +}) { const blocks = (0,external_wp_blocks_namespaceObject.getBlockTypes)(); - const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => lock_unlock_unlock(select(store)).getEditorCanvasContainerView(), []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { + const editorCanvasContainerView = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getEditorCanvasContainerView(), []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { className: "edit-site-global-styles-sidebar__navigator-provider", initialPath: "/", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { + children: [path && onPathChange && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationSync, { + path: path, + onPathChange: onPathChange + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_root, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { @@ -23461,6 +24554,12 @@ path: "/typography", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { + path: "/typography/font-sizes", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_sizes, {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { + path: "/typography/font-sizes/:origin/:slug", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(font_size, {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/typography/text", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_typography_element, { element: "text" @@ -23503,6 +24602,9 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: "/revisions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_revisions, {}) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { + path: "/background", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_background, {}) }), blocks.map(block => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesNavigationScreen, { path: '/blocks/' + encodeURIComponent(block.name), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(screen_block, { @@ -23515,28 +24617,26 @@ }); } -/* harmony default export */ const ui = (GlobalStylesUI); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/index.js - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/default-sidebar.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - +/* harmony default export */ const global_styles_ui = (GlobalStylesUI); + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles/index.js + + +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/default-sidebar.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ const { ComplementaryArea, ComplementaryAreaMoreMenuItem -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); function DefaultSidebar({ className, identifier, @@ -23555,7 +24655,6 @@ scope: "core", identifier: identifier, title: title, - smallScreenTitle: title, icon: icon, closeLabel: closeLabel, header: header, @@ -23572,22 +24671,23 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/index.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/global-styles-sidebar/index.js +/** + * WordPress dependencies + */ + + + + + + + + + + +/** + * Internal dependencies + */ @@ -23597,9 +24697,19 @@ const { interfaceStore: global_styles_sidebar_interfaceStore -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: global_styles_sidebar_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); function GlobalStylesSidebar() { const { + query + } = global_styles_sidebar_useLocation(); + const { + canvas = 'view', + name + } = query; + const { shouldClearCanvasContainerView, isStyleBookOpened, showListViewByDefault, @@ -23611,12 +24721,11 @@ getActiveComplementaryArea } = select(global_styles_sidebar_interfaceStore); const { - getEditorCanvasContainerView, - getCanvasMode - } = lock_unlock_unlock(select(store)); + getEditorCanvasContainerView + } = unlock(select(store)); const canvasContainerView = getEditorCanvasContainerView(); const _isVisualEditorMode = 'visual' === select(external_wp_editor_namespaceObject.store).getEditorMode(); - const _isEditCanvasMode = 'edit' === getCanvasMode(); + const _isEditCanvasMode = 'edit' === canvas; const _showListViewByDefault = select(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault'); const { getEntityRecord, @@ -23632,34 +24741,29 @@ isRevisionsStyleBookOpened: 'global-styles-revisions:style-book' === canvasContainerView, isRevisionsOpened: 'global-styles-revisions' === canvasContainerView }; - }, []); + }, [canvas]); const { setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); (0,external_wp_element_namespaceObject.useEffect)(() => { if (shouldClearCanvasContainerView) { setEditorCanvasContainerView(undefined); } - }, [shouldClearCanvasContainerView]); + }, [shouldClearCanvasContainerView, setEditorCanvasContainerView]); const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const { - goTo - } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const toggleRevisions = () => { setIsListViewOpened(false); if (isRevisionsStyleBookOpened) { - goTo('/'); setEditorCanvasContainerView('style-book'); return; } if (isRevisionsOpened) { - goTo('/'); setEditorCanvasContainerView(undefined); return; } - goTo('/revisions'); if (isStyleBookOpened) { setEditorCanvasContainerView('global-styles-revisions:style-book'); } else { @@ -23678,6 +24782,21 @@ setIsListViewOpened(isStyleBookOpened && showListViewByDefault); setEditorCanvasContainerView(isStyleBookOpened ? undefined : 'style-book'); }; + const { + getActiveComplementaryArea + } = (0,external_wp_data_namespaceObject.useSelect)(global_styles_sidebar_interfaceStore); + const { + enableComplementaryArea + } = (0,external_wp_data_namespaceObject.useDispatch)(global_styles_sidebar_interfaceStore); + const previousActiveAreaRef = (0,external_wp_element_namespaceObject.useRef)(null); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (name === 'styles' && canvas === 'edit') { + previousActiveAreaRef.current = getActiveComplementaryArea('core'); + enableComplementaryArea('core', 'edit-site/global-styles'); + } else if (previousActiveAreaRef.current) { + enableComplementaryArea('core', previousActiveAreaRef.current); + } + }, [name, enableComplementaryArea, canvas, getActiveComplementaryArea]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultSidebar, { className: "edit-site-global-styles-sidebar", identifier: "edit-site/global-styles", @@ -23688,393 +24807,43 @@ header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { className: "edit-site-global-styles-sidebar__header", gap: 1, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { - style: { - minWidth: 'min-content' - }, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-site-global-styles-sidebar__header-title", children: (0,external_wp_i18n_namespaceObject.__)('Styles') }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - icon: library_seen, - label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), - isPressed: isStyleBookOpened || isRevisionsStyleBookOpened, - __experimentalIsFocusable: true, - disabled: shouldClearCanvasContainerView, - onClick: toggleStyleBook, - size: "compact" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Revisions'), - icon: library_backup, - onClick: toggleRevisions, - __experimentalIsFocusable: true, - disabled: !hasRevisions, - isPressed: isRevisionsOpened || isRevisionsStyleBookOpened, - size: "compact" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuSlot, {})] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { + justify: "flex-end", + gap: 1, + className: "edit-site-global-styles-sidebar__header-actions", + children: [!isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + icon: library_seen, + label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), + isPressed: isStyleBookOpened || isRevisionsStyleBookOpened, + accessibleWhenDisabled: true, + disabled: shouldClearCanvasContainerView, + onClick: toggleStyleBook, + size: "compact" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: (0,external_wp_i18n_namespaceObject.__)('Revisions'), + icon: library_backup, + onClick: toggleRevisions, + accessibleWhenDisabled: true, + disabled: !hasRevisions, + isPressed: isRevisionsOpened || isRevisionsStyleBookOpened, + size: "compact" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesMenuSlot, {})] + })] }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ui, {}) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - -const { - useLocation: save_button_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function SaveButton({ - className = 'edit-site-save-button__button', - variant = 'primary', - showTooltip = true, - showReviewMessage, - icon, - size, - __next40pxDefaultSize = false -}) { - const { - params - } = save_button_useLocation(); - const { - setIsSaveViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - saveDirtyEntities - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store)); - const { - dirtyEntityRecords - } = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)(); - const { - isSaving, - isSaveViewOpen, - previewingThemeName - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isSavingEntityRecord, - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const { - isSaveViewOpened - } = select(store); - const isActivatingTheme = isResolving('activateTheme'); - const currentlyPreviewingThemeId = currentlyPreviewingTheme(); - return { - isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme, - isSaveViewOpen: isSaveViewOpened(), - // Do not call `getTheme` with null, it will cause a request to - // the server. - previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined - }; - }, [dirtyEntityRecords]); - const hasDirtyEntities = !!dirtyEntityRecords.length; - let isOnlyCurrentEntityDirty; - // Check if the current entity is the only entity with changes. - // We have some extra logic for `wp_global_styles` for now, that - // is used in navigation sidebar. - if (dirtyEntityRecords.length === 1) { - if (params.postId) { - isOnlyCurrentEntityDirty = `${dirtyEntityRecords[0].key}` === params.postId && dirtyEntityRecords[0].name === params.postType; - } else if (params.path?.includes('wp_global_styles')) { - isOnlyCurrentEntityDirty = dirtyEntityRecords[0].name === 'globalStyles'; - } - } - const disabled = isSaving || !hasDirtyEntities && !isPreviewingTheme(); - const getLabel = () => { - if (isPreviewingTheme()) { - if (isSaving) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ - (0,external_wp_i18n_namespaceObject.__)('Activating %s'), previewingThemeName); - } else if (disabled) { - return (0,external_wp_i18n_namespaceObject.__)('Saved'); - } else if (hasDirtyEntities) { - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ - (0,external_wp_i18n_namespaceObject.__)('Activate %s & Save'), previewingThemeName); - } - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: The name of theme to be activated. */ - (0,external_wp_i18n_namespaceObject.__)('Activate %s'), previewingThemeName); - } - if (isSaving) { - return (0,external_wp_i18n_namespaceObject.__)('Saving'); - } - if (disabled) { - return (0,external_wp_i18n_namespaceObject.__)('Saved'); - } - if (!isOnlyCurrentEntityDirty && showReviewMessage) { - return (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %d: number of unsaved changes (number). - (0,external_wp_i18n_namespaceObject._n)('Review %d change…', 'Review %d changes…', dirtyEntityRecords.length), dirtyEntityRecords.length); - } - return (0,external_wp_i18n_namespaceObject.__)('Save'); - }; - const label = getLabel(); - const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({ - dirtyEntityRecords - }) : () => setIsSaveViewOpened(true); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: variant, - className: className, - "aria-disabled": disabled, - "aria-expanded": isSaveViewOpen, - isBusy: isSaving, - onClick: disabled ? undefined : onClick, - label: label - /* - * We want the tooltip to show the keyboard shortcut only when the - * button does something, i.e. when it's not disabled. - */, - shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s') - /* - * Displaying the keyboard shortcut conditionally makes the tooltip - * itself show conditionally. This would trigger a full-rerendering - * of the button that we want to avoid. By setting `showTooltip`, - * the tooltip is always rendered even when there's no keyboard shortcut. - */, - showTooltip: showTooltip, - icon: icon, - __next40pxDefaultSize: __next40pxDefaultSize, - size: size, - children: label - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/use-activate-theme.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -const { - useHistory: use_activate_theme_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); - -/** - * This should be refactored to use the REST API, once the REST API can activate themes. - * - * @return {Function} A function that activates the theme. - */ -function useActivateTheme() { - const history = use_activate_theme_useHistory(); - const { - startResolution, - finishResolution - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - return async () => { - if (isPreviewingTheme()) { - const activationURL = 'themes.php?action=activate&stylesheet=' + currentlyPreviewingTheme() + '&_wpnonce=' + window.WP_BLOCK_THEME_ACTIVATE_NONCE; - startResolution('activateTheme'); - await window.fetch(activationURL); - finishResolution('activateTheme'); - // Remove the wp_theme_preview query param: we've finished activating - // the queue and are switching to normal Site Editor. - const { - params - } = history.getLocationWithParams(); - history.replace({ - ...params, - wp_theme_preview: undefined - }); - } - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/use-actual-current-theme.js -/** - * WordPress dependencies - */ - - - -const ACTIVE_THEMES_URL = '/wp/v2/themes?status=active'; -function useActualCurrentTheme() { - const [currentTheme, setCurrentTheme] = (0,external_wp_element_namespaceObject.useState)(); - (0,external_wp_element_namespaceObject.useEffect)(() => { - // Set the `wp_theme_preview` to empty string to bypass the createThemePreviewMiddleware. - const path = (0,external_wp_url_namespaceObject.addQueryArgs)(ACTIVE_THEMES_URL, { - context: 'edit', - wp_theme_preview: '' - }); - external_wp_apiFetch_default()({ - path - }).then(activeThemes => setCurrentTheme(activeThemes[0])) - // Do nothing - .catch(() => {}); - }, []); - return currentTheme; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const { - EntitiesSavedStatesExtensible, - NavigableRegion -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const EntitiesSavedStatesForPreview = ({ - onClose -}) => { - var _currentTheme$name$re, _previewingTheme$name; - const isDirtyProps = (0,external_wp_editor_namespaceObject.useEntitiesSavedStatesIsDirty)(); - let activateSaveLabel; - if (isDirtyProps.isDirty) { - activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)('Activate & Save'); - } else { - activateSaveLabel = (0,external_wp_i18n_namespaceObject.__)('Activate'); - } - const currentTheme = useActualCurrentTheme(); - const previewingTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme(), []); - const additionalPrompt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */ - (0,external_wp_i18n_namespaceObject.__)('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...') - }); - const activateTheme = useActivateTheme(); - const onSave = async values => { - await activateTheme(); - return values; - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesExtensible, { - ...isDirtyProps, - additionalPrompt, - close: onClose, - onSave, - saveEnabled: true, - saveLabel: activateSaveLabel - }); -}; -const _EntitiesSavedStates = ({ - onClose, - renderDialog = undefined -}) => { - if (isPreviewingTheme()) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntitiesSavedStatesForPreview, { - onClose: onClose - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EntitiesSavedStates, { - close: onClose, - renderDialog: renderDialog - }); -}; -function SavePanel() { - const { - isSaveViewOpen, - canvasMode, - isDirty, - isSaving - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - __experimentalGetDirtyEntityRecords, - isSavingEntityRecord, - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); - const isActivatingTheme = isResolving('activateTheme'); - const { - isSaveViewOpened, - getCanvasMode - } = lock_unlock_unlock(select(store)); - - // The currently selected entity to display. - // Typically template or template part in the site editor. - return { - isSaveViewOpen: isSaveViewOpened(), - canvasMode: getCanvasMode(), - isDirty: dirtyEntityRecords.length > 0, - isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme - }; - }, []); - const { - setIsSaveViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const onClose = () => setIsSaveViewOpened(false); - if (canvasMode === 'view') { - return isSaveViewOpen ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - className: "edit-site-save-panel__modal", - onRequestClose: onClose, - __experimentalHideHeader: true, - contentLabel: (0,external_wp_i18n_namespaceObject.__)('Save site, content, and template changes'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { - onClose: onClose - }) - }) : null; - } - const activateSaveEnabled = isPreviewingTheme() || isDirty; - const disabled = isSaving || !activateSaveEnabled; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(NavigableRegion, { - className: dist_clsx('edit-site-layout__actions', { - 'is-entity-save-view-open': isSaveViewOpen - }), - ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Save panel'), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('edit-site-editor__toggle-save-panel', { - 'screen-reader-text': isSaveViewOpen - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "secondary", - className: "edit-site-editor__toggle-save-panel-button", - onClick: () => setIsSaveViewOpened(true), - "aria-haspopup": "dialog", - disabled: disabled, - __experimentalIsFocusable: true, - children: (0,external_wp_i18n_namespaceObject.__)('Open save panel') - }) - }), isSaveViewOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_EntitiesSavedStates, { - onClose: onClose, - renderDialog: true - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/download.js + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global_styles_ui, {}) + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/download.js /** * WordPress dependencies */ @@ -24089,9 +24858,9 @@ }); /* harmony default export */ const library_download = (download); -;// CONCATENATED MODULE: external ["wp","blob"] +;// external ["wp","blob"] const external_wp_blob_namespaceObject = window["wp"]["blob"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/more-menu/site-export.js +;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/site-export.js /** * WordPress dependencies */ @@ -24141,7 +24910,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/more-menu/welcome-guide-menu-item.js +;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/welcome-guide-menu-item.js /** * WordPress dependencies */ @@ -24160,19 +24929,17 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/more-menu/index.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/more-menu/index.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -24180,7 +24947,7 @@ const { ToolsMoreMenuGroup, PreferencesModal -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); function MoreMenu() { const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; @@ -24192,7 +24959,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-editor-iframe-props.js +;// ./node_modules/@wordpress/edit-site/build-module/components/block-editor/use-editor-iframe-props.js /** * External dependencies */ @@ -24207,33 +24974,34 @@ -/** - * Internal dependencies - */ - - + + +/** + * Internal dependencies + */ + +const { + useLocation: use_editor_iframe_props_useLocation, + useHistory: use_editor_iframe_props_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); function useEditorIframeProps() { const { - canvasMode, - currentPostIsTrashed - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getCanvasMode - } = lock_unlock_unlock(select(store)); - return { - canvasMode: getCanvasMode(), - currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash' - }; - }, []); - const { - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + query, + path + } = use_editor_iframe_props_useLocation(); + const history = use_editor_iframe_props_useHistory(); + const { + canvas = 'view' + } = query; + const currentPostIsTrashed = (0,external_wp_data_namespaceObject.useSelect)(select => { + return select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash'; + }, []); const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { - if (canvasMode === 'edit') { + if (canvas === 'edit') { setIsFocused(false); } - }, [canvasMode]); + }, [canvas]); // In view mode, make the canvas iframe be perceived and behave as a button // to switch to edit mode, with a meaningful label and no title attribute. @@ -24251,12 +25019,18 @@ } = event; if ((keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE) && !currentPostIsTrashed) { event.preventDefault(); - setCanvasMode('edit'); - } - }, - onClick: () => { - setCanvasMode('edit'); - }, + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }); + } + }, + onClick: () => history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: 'edit' + }), { + transition: 'canvas-mode-edit-transition' + }), onClickCapture: event => { if (currentPostIsTrashed) { event.preventDefault(); @@ -24267,13 +25041,13 @@ }; return { className: dist_clsx('edit-site-visual-editor__editor-canvas', { - 'is-focused': isFocused && canvasMode === 'view' + 'is-focused': isFocused && canvas === 'view' }), - ...(canvasMode === 'view' ? viewModeIframeProps : {}) - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/routes/use-title.js + ...(canvas === 'view' ? viewModeIframeProps : {}) + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/routes/use-title.js /** * WordPress dependencies */ @@ -24291,7 +25065,7 @@ const { useLocation: use_title_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); function useTitle(title) { const location = use_title_useLocation(); const siteTitle = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site')?.title, []); @@ -24306,7 +25080,7 @@ } if (title && siteTitle) { // @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68 - const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */ + const formattedTitle = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */ (0,external_wp_i18n_namespaceObject.__)('%1$s ‹ %2$s ‹ Editor — WordPress'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)); document.title = formattedTitle; @@ -24316,39 +25090,299 @@ }, [title, siteTitle, location]); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/use-editor-title.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - -function useEditorTitle() { - const { - record: editedPost, - getTitle, - isLoaded: hasLoadedPost - } = useEditedEntityRecord(); - let title; - if (hasLoadedPost) { - var _POST_TYPE_LABELS$edi; - title = (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part). - (0,external_wp_i18n_namespaceObject.__)('%1$s ‹ %2$s'), getTitle(), (_POST_TYPE_LABELS$edi = POST_TYPE_LABELS[editedPost.type]) !== null && _POST_TYPE_LABELS$edi !== void 0 ? _POST_TYPE_LABELS$edi : POST_TYPE_LABELS[TEMPLATE_POST_TYPE]); +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-editor-title.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + getTemplateInfo +} = unlock(external_wp_editor_namespaceObject.privateApis); +function useEditorTitle(postType, postId) { + const { + title, + isLoaded + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getCurrentTheme; + const { + getEditedEntityRecord, + getCurrentTheme, + hasFinishedResolution + } = select(external_wp_coreData_namespaceObject.store); + if (!postId) { + return { + isLoaded: false + }; + } + const _record = getEditedEntityRecord('postType', postType, postId); + const { + default_template_types: templateTypes = [] + } = (_getCurrentTheme = getCurrentTheme()) !== null && _getCurrentTheme !== void 0 ? _getCurrentTheme : {}; + const templateInfo = getTemplateInfo({ + template: _record, + templateTypes + }); + const _isLoaded = hasFinishedResolution('getEditedEntityRecord', ['postType', postType, postId]); + return { + title: templateInfo.title, + isLoaded: _isLoaded + }; + }, [postType, postId]); + let editorTitle; + if (isLoaded) { + var _POST_TYPE_LABELS$pos; + editorTitle = (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part). + (0,external_wp_i18n_namespaceObject._x)('%1$s ‹ %2$s', 'breadcrumb trail'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), (_POST_TYPE_LABELS$pos = POST_TYPE_LABELS[postType]) !== null && _POST_TYPE_LABELS$pos !== void 0 ? _POST_TYPE_LABELS$pos : POST_TYPE_LABELS[TEMPLATE_POST_TYPE]); } // Only announce the title once the editor is ready to prevent "Replace" // action in from double-announcing. - useTitle(hasLoadedPost && title); + useTitle(isLoaded && editorTitle); } /* harmony default export */ const use_editor_title = (useEditorTitle); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-adapt-editor-to-canvas.js +/** + * WordPress dependencies + */ + + + + + +function useAdaptEditorToCanvas(canvas) { + const { + clearSelectedBlock + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const { + setDeviceType, + closePublishSidebar, + setIsListViewOpened, + setIsInserterOpened + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); + const { + get: getPreference + } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store); + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; + registry.batch(() => { + clearSelectedBlock(); + setDeviceType('Desktop'); + closePublishSidebar(); + setIsInserterOpened(false); + + // Check if the block list view should be open by default. + // If `distractionFree` mode is enabled, the block list view should not be open. + // This behavior is disabled for small viewports. + if (isMediumOrBigger && canvas === 'edit' && getPreference('core', 'showListViewByDefault') && !getPreference('core', 'distractionFree')) { + setIsListViewOpened(true); + } else { + setIsListViewOpened(false); + } + }); + }, [canvas, registry, clearSelectedBlock, setDeviceType, closePublishSidebar, setIsInserterOpened, setIsListViewOpened, getPreference]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/use-resolve-edited-entity.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +const { + useLocation: use_resolve_edited_entity_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const postTypesWithoutParentTemplate = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user]; +const authorizedPostTypes = ['page', 'post']; +function useResolveEditedEntity() { + const { + name, + params = {}, + query + } = use_resolve_edited_entity_useLocation(); + const { + postId = query?.postId + } = params; // Fallback to query param for postId for list view routes. + let postType; + if (name === 'navigation-item') { + postType = NAVIGATION_POST_TYPE; + } else if (name === 'pattern-item') { + postType = PATTERN_TYPES.user; + } else if (name === 'template-part-item') { + postType = TEMPLATE_PART_POST_TYPE; + } else if (name === 'template-item' || name === 'templates') { + postType = TEMPLATE_POST_TYPE; + } else if (name === 'page-item' || name === 'pages') { + postType = 'page'; + } else if (name === 'post-item' || name === 'posts') { + postType = 'post'; + } + const homePage = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getHomePage + } = unlock(select(external_wp_coreData_namespaceObject.store)); + return getHomePage(); + }, []); + + /** + * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId + * in order to match the frontend as closely as possible in the site editor. + * + * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution. + */ + const resolvedTemplateId = (0,external_wp_data_namespaceObject.useSelect)(select => { + // If we're rendering a post type that doesn't have a template + // no need to resolve its template. + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return; + } + + // Don't trigger resolution for multi-selected posts. + if (postId && postId.includes(',')) { + return; + } + const { + getTemplateId + } = unlock(select(external_wp_coreData_namespaceObject.store)); + + // If we're rendering a specific page, we need to resolve its template. + // The site editor only supports pages for now, not other CPTs. + if (postType && postId && authorizedPostTypes.includes(postType)) { + return getTemplateId(postType, postId); + } + + // If we're rendering the home page, and we have a static home page, resolve its template. + if (homePage?.postType === 'page') { + return getTemplateId('page', homePage?.postId); + } + if (homePage?.postType === 'wp_template') { + return homePage?.postId; + } + }, [homePage, postId, postType]); + const context = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return {}; + } + if (postType && postId && authorizedPostTypes.includes(postType)) { + return { + postType, + postId + }; + } + // TODO: for post types lists we should probably not render the front page, but maybe a placeholder + // with a message like "Select a page" or something similar. + if (homePage?.postType === 'page') { + return { + postType: 'page', + postId: homePage?.postId + }; + } + return {}; + }, [homePage, postType, postId]); + if (postTypesWithoutParentTemplate.includes(postType) && postId) { + return { + isReady: true, + postType, + postId, + context + }; + } + if (!!homePage) { + return { + isReady: resolvedTemplateId !== undefined, + postType: TEMPLATE_POST_TYPE, + postId: resolvedTemplateId, + context + }; + } + return { + isReady: false + }; +} +function useSyncDeprecatedEntityIntoState({ + postType, + postId, + context, + isReady +}) { + const { + setEditedEntity + } = (0,external_wp_data_namespaceObject.useDispatch)(store); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isReady) { + setEditedEntity(postType, postId, context); + } + }, [isReady, postType, postId, context, setEditedEntity]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/site-preview.js +/** + * WordPress dependencies + */ + + + + + + +function SitePreview() { + const siteUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + const siteData = getEntityRecord('root', '__unstableBase'); + return siteData?.home; + }, []); + + // If theme is block based, return the Editor, otherwise return the site preview. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { + src: (0,external_wp_url_namespaceObject.addQueryArgs)(siteUrl, { + // Parameter for hiding the admin bar. + wp_site_preview: 1 + }), + title: (0,external_wp_i18n_namespaceObject.__)('Site Preview'), + style: { + display: 'block', + width: '100%', + height: '100%', + backgroundColor: '#fff' + }, + onLoad: event => { + // Make interactive elements unclickable. + const document = event.target.contentDocument; + const focusableElements = external_wp_dom_namespaceObject.focus.focusable.find(document); + focusableElements.forEach(element => { + element.style.pointerEvents = 'none'; + element.tabIndex = -1; + element.setAttribute('aria-hidden', 'true'); + }); + } + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/editor/index.js /** * External dependencies */ @@ -24370,9 +25404,13 @@ -/** - * Internal dependencies - */ + + +/** + * Internal dependencies + */ + + @@ -24396,82 +25434,121 @@ const { Editor, BackButton -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const { - useHistory: editor_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useHistory: editor_useHistory, + useLocation: editor_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); const { BlockKeyboardShortcuts -} = lock_unlock_unlock(external_wp_blockLibrary_namespaceObject.privateApis); +} = unlock(external_wp_blockLibrary_namespaceObject.privateApis); +const toggleHomeIconVariants = { + edit: { + opacity: 0, + scale: 0.2 + }, + hover: { + opacity: 1, + scale: 1, + clipPath: 'inset( 22% round 2px )' + } +}; +const siteIconVariants = { + edit: { + clipPath: 'inset(0% round 0px)' + }, + hover: { + clipPath: 'inset( 22% round 2px )' + }, + tap: { + clipPath: 'inset(0% round 0px)' + } +}; +function getListPathForPostType(postType) { + switch (postType) { + case 'navigation': + return '/navigation'; + case 'wp_block': + return '/pattern?postType=wp_block'; + case 'wp_template_part': + return '/pattern?postType=wp_template_part'; + case 'wp_template': + return '/template'; + case 'page': + return '/page'; + case 'post': + return '/'; + } + throw 'Unknown post type'; +} +function getNavigationPath(location, postType) { + const { + path, + name + } = location; + if (['pattern-item', 'template-part-item', 'page-item', 'template-item', 'post-item'].includes(name)) { + return getListPathForPostType(postType); + } + return (0,external_wp_url_namespaceObject.addQueryArgs)(path, { + canvas: undefined + }); +} function EditSiteEditor({ - isLoading -}) { - const { - editedPostType, - editedPostId, - contextPostType, - contextPostId, - editorMode, - canvasMode, - isEditingPage, - supportsGlobalStyles, - showIconLabels, + isHomeRoute = false, + isPostsList = false +}) { + const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); + const location = editor_useLocation(); + const { + canvas = 'view' + } = location.query; + const isLoading = useIsSiteEditorLoading(); + useAdaptEditorToCanvas(canvas); + const entity = useResolveEditedEntity(); + // deprecated sync state with url + useSyncDeprecatedEntityIntoState(entity); + const { + postType, + postId, + context + } = entity; + const { + isBlockBasedTheme, editorCanvasView, - currentPostIsTrashed + currentPostIsTrashed, + hasSiteIcon } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { - getEditedPostContext, - getCanvasMode, - isPage, - getEditedPostType, - getEditedPostId - } = lock_unlock_unlock(select(store)); - const { - get - } = select(external_wp_preferences_namespaceObject.store); - const { - getCurrentTheme + getEditorCanvasContainerView + } = unlock(select(store)); + const { + getCurrentTheme, + getEntityRecord } = select(external_wp_coreData_namespaceObject.store); - const { - getEditorMode - } = select(external_wp_editor_namespaceObject.store); - const _context = getEditedPostContext(); - - // The currently selected entity to display. - // Typically template or template part in the site editor. - return { - editedPostType: getEditedPostType(), - editedPostId: getEditedPostId(), - contextPostType: _context?.postId ? _context.postType : undefined, - contextPostId: _context?.postId ? _context.postId : undefined, - editorMode: getEditorMode(), - canvasMode: getCanvasMode(), - isEditingPage: isPage(), - supportsGlobalStyles: getCurrentTheme()?.is_block_theme, - showIconLabels: get('core', 'showIconLabels'), - editorCanvasView: lock_unlock_unlock(select(store)).getEditorCanvasContainerView(), - currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash' - }; - }, []); - use_editor_title(); + const siteData = getEntityRecord('root', '__unstableBase', undefined); + return { + isBlockBasedTheme: getCurrentTheme()?.is_block_theme, + editorCanvasView: getEditorCanvasContainerView(), + currentPostIsTrashed: select(external_wp_editor_namespaceObject.store).getCurrentPostAttribute('status') === 'trash', + hasSiteIcon: !!siteData?.site_icon_url + }; + }, []); + const postWithTemplate = !!context?.postId; + use_editor_title(postWithTemplate ? context.postType : postType, postWithTemplate ? context.postId : postId); const _isPreviewingTheme = isPreviewingTheme(); const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer(); const iframeProps = useEditorIframeProps(); - const isViewMode = canvasMode === 'view'; - const isEditMode = canvasMode === 'edit'; - const showVisualEditor = isViewMode || editorMode === 'visual'; - const postWithTemplate = !!contextPostId; + const isEditMode = canvas === 'edit'; const loadingProgressId = (0,external_wp_compose_namespaceObject.useInstanceId)(CanvasLoader, 'edit-site-editor__loading-progress'); const settings = useSpecificEditorSettings(); const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [...settings.styles, { // Forming a "block formatting context" to prevent margin collapsing. // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context - - css: `body{${canvasMode === 'view' ? `min-height: 100vh; ${currentPostIsTrashed ? '' : 'cursor: pointer;'}` : ''}}}` - }], [settings.styles, canvasMode, currentPostIsTrashed]); - const { - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + css: canvas === 'view' ? `body{min-height: 100vh; ${currentPostIsTrashed ? '' : 'cursor: pointer;'}}` : undefined + }], [settings.styles, canvas, currentPostIsTrashed]); + const { + resetZoomLevel + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store)); const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); @@ -24481,9 +25558,7 @@ case 'move-to-trash': case 'delete-post': { - history.push({ - postType: items[0].type - }); + history.navigate(getListPathForPostType(postWithTemplate ? context.postType : postType)); } break; case 'duplicate-post': @@ -24491,171 +25566,1984 @@ const newItem = items[0]; const _title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered; createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Title of the created post e.g: "Post 1". + // translators: %s: Title of the created post or template, e.g: "Hello world". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(_title)), { type: 'snackbar', id: 'duplicate-post-action', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: () => { - history.push({ - postId: newItem.id, - postType: newItem.type, - canvas: 'edit' - }); + history.navigate(`/${newItem.type}/${newItem.id}?canvas=edit`); } }] }); } break; } - }, [history, createSuccessNotice]); + }, [postType, context?.postType, postWithTemplate, history, createSuccessNotice]); + + // Replace the title and icon displayed in the DocumentBar when there's an overlay visible. + const title = getEditorCanvasContainerTitle(editorCanvasView); const isReady = !isLoading; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), showVisualEditor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartConverter, {}), !isReady ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CanvasLoader, { + const transition = { + duration: disableMotion ? 0 : 0.2 + }; + return !isBlockBasedTheme && isHomeRoute ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SitePreview, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesRenderer, { + disableRootPadding: postType !== TEMPLATE_POST_TYPE + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), !isReady ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CanvasLoader, { id: loadingProgressId - }) : null, isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { - postType: postWithTemplate ? contextPostType : editedPostType, - postId: postWithTemplate ? contextPostId : editedPostId, - templateId: postWithTemplate ? editedPostId : undefined, + }) : null, isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { + postType: postWithTemplate ? context.postType : postType + }), isReady && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { + postType: postWithTemplate ? context.postType : postType, + postId: postWithTemplate ? context.postId : postId, + templateId: postWithTemplate ? postId : undefined, settings: settings, - className: dist_clsx('edit-site-editor__editor-interface', { - 'show-icon-labels': showIconLabels - }), + className: "edit-site-editor__editor-interface", styles: styles, - enableRegionNavigation: false, customSaveButton: _isPreviewingTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveButton, { size: "compact" }), customSavePanel: _isPreviewingTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {}), forceDisableBlockTools: !hasDefaultEditorCanvasView, - title: !hasDefaultEditorCanvasView ? getEditorCanvasContainerTitle(editorCanvasView) : undefined, + title: title, iframeProps: iframeProps, onActionPerformed: onActionPerformed, - extraSidebarPanels: !isEditingPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_template_setting_panel.Slot, {}), + extraSidebarPanels: !postWithTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_template_setting_panel.Slot, {}), children: [isEditMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButton, { children: ({ length - }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: (0,external_wp_i18n_namespaceObject.__)('Open Navigation'), - className: "edit-site-layout__view-mode-toggle", - onClick: () => setCanvasMode('view'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, { - className: "edit-site-layout__view-mode-toggle-icon" - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {}), supportsGlobalStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesSidebar, {})] - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/pagination.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const pagination_Pagination = (0,external_wp_element_namespaceObject.memo)(function Pagination({ - view, - onChangeView, - paginationInfo: { - totalItems = 0, - totalPages - } -}) { - var _view$page; - if (!totalItems || !totalPages) { - return null; - } - const currentPage = (_view$page = view.page) !== null && _view$page !== void 0 ? _view$page : 1; - return !!totalItems && totalPages !== 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - expanded: false, - spacing: 6, - justify: "end", - className: "dataviews-pagination", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "flex-start", - expanded: false, - spacing: 2, - className: "dataviews-pagination__page-selection", - children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Total number of pages. - (0,external_wp_i18n_namespaceObject._x)('Page of %s', 'paging'), totalPages), { - CurrentPageControl: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Current page'), - value: view.page?.toString(), - options: Array.from(Array(totalPages)).map((_, i) => { - const page = i + 1; - return { - value: page.toString(), - label: page.toString() - }; - }), - onChange: newValue => { - onChangeView({ - ...view, - page: +newValue - }); + }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { + className: "edit-site-editor__view-mode-toggle", + transition: transition, + animate: "edit", + initial: "edit", + whileHover: "hover", + whileTap: "tap", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Open Navigation'), + showTooltip: true, + tooltipPosition: "middle right", + onClick: () => { + resetZoomLevel(); + + // TODO: this is a temporary solution to navigate to the posts list if we are + // come here through `posts list` and are in focus mode editing a template, template part etc.. + if (isPostsList && location.query?.focusMode) { + history.navigate('/', { + transition: 'canvas-mode-view-transition' + }); + } else { + history.navigate(getNavigationPath(location, postWithTemplate ? context.postType : postType), { + transition: 'canvas-mode-view-transition' + }); + } + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { + variants: siteIconVariants, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, { + className: "edit-site-editor__view-mode-toggle-icon" + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { + className: dist_clsx('edit-site-editor__back-icon', { + 'has-site-icon': hasSiteIcon + }), + variants: toggleHomeIconVariants, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { + icon: arrow_up_left + }) + })] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {}), isBlockBasedTheme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesSidebar, {})] + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/utils.js +/** + * Check if the classic theme supports the stylebook. + * + * @param {Object} siteData - The site data provided by the site editor route area resolvers. + * @return {boolean} True if the stylebook is supported, false otherwise. + */ +function isClassicThemeWithStyleBookSupport(siteData) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + const supportsEditorStyles = siteData.currentTheme?.theme_supports['editor-styles']; + // This is a temp solution until the has_theme_json value is available for the current theme. + const hasThemeJson = siteData.editorSettings?.supportsLayout; + return !isBlockTheme && (supportsEditorStyles || hasThemeJson); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/home.js +/** + * Internal dependencies + */ + + + + + +const homeRoute = { + name: 'home', + path: '/', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isHomeRoute: true + }) : undefined; + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/styles.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + + +const { + useLocation: styles_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileGlobalStylesUI() { + const { + query = {} + } = styles_useLocation(); + const { + canvas + } = query; + if (canvas === 'edit') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {}); +} +const stylesRoute = { + name: 'styles', + path: '/styles', + areas: { + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GlobalStylesUIWrapper, {}), + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStyles, { + backPath: "/" + }), + preview({ + query + }) { + const isStylebook = query.preview === 'stylebook'; + return isStylebook ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}); + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileGlobalStylesUI, {}) + }, + widths: { + content: 380 + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +// This requested is preloaded in `gutenberg_preload_navigation_posts`. +// As unbounded queries are limited to 100 by `fetchAllMiddleware` +// on apiFetch this query is limited to 100. +// These parameters must be kept aligned with those in +// lib/compat/wordpress-6.3/navigation-block-preloading.php +// and +// block-library/src/navigation/constants.js +const PRELOADED_NAVIGATION_MENUS_QUERY = { + per_page: 100, + status: ['publish', 'draft'], + order: 'desc', + orderby: 'date' +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +/** + * WordPress dependencies + */ + + + + +const notEmptyString = testString => testString?.trim()?.length > 0; +function RenameModal({ + menuTitle, + onClose, + onSave +}) { + const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_namespaceObject.useState)(menuTitle); + const titleHasChanged = editedMenuTitle !== menuTitle; + const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: (0,external_wp_i18n_namespaceObject.__)('Rename'), + onRequestClose: onClose, + focusOnMount: "firstContentElement", + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + className: "sidebar-navigation__rename-modal-form", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: "3", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + value: editedMenuTitle, + placeholder: (0,external_wp_i18n_namespaceObject.__)('Navigation title'), + onChange: setEditedMenuTitle, + label: (0,external_wp_i18n_namespaceObject.__)('Name') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "right", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + accessibleWhenDisabled: true, + disabled: !isEditedMenuTitleValid, + variant: "primary", + type: "submit", + onClick: e => { + e.preventDefault(); + if (!isEditedMenuTitleValid) { + return; + } + onSave({ + title: editedMenuTitle + }); + + // Immediate close avoids ability to hit save multiple times. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Save') + })] + })] + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +/** + * WordPress dependencies + */ + + + +function DeleteConfirmDialog({ + onClose, + onConfirm +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { + isOpen: true, + onConfirm: () => { + onConfirm(); + + // Immediate close avoids ability to hit delete multiple times. + onClose(); + }, + onCancel: onClose, + confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), + size: "medium", + children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useHistory: more_menu_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const POPOVER_PROPS = { + position: 'bottom right' +}; +function ScreenNavigationMoreMenu(props) { + const { + onDelete, + onSave, + onDuplicate, + menuTitle, + menuId + } = props; + const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const history = more_menu_useHistory(); + const closeModals = () => { + setRenameModalOpen(false); + setDeleteConfirmDialogOpen(false); + }; + const openRenameModal = () => setRenameModalOpen(true); + const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { + className: "sidebar-navigation__more-menu", + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + icon: more_vertical, + popoverProps: POPOVER_PROPS, + children: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + openRenameModal(); + // Close the dropdown after opening the modal. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Rename') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + history.navigate(`/wp_navigation/${menuId}?canvas=edit`); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Edit') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onDuplicate(); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Duplicate') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + isDestructive: true, + onClick: () => { + openDeleteConfirmDialog(); + + // Close the dropdown after opening the modal. + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Delete') + })] + }) + }) + }), deleteConfirmDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DeleteConfirmDialog, { + onClose: closeModals, + onConfirm: onDelete + }), renameModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenameModal, { + onClose: closeModals, + menuTitle: menuTitle, + onSave: onSave + })] + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js +/** + * WordPress dependencies + */ + + +const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" + }) +}); +/* harmony default export */ const chevron_up = (chevronUp); + +;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js +/** + * WordPress dependencies + */ + + +const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" + }) +}); +/* harmony default export */ const chevron_down = (chevronDown); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +/** + * WordPress dependencies + */ + + + + + + + + +const leaf_more_menu_POPOVER_PROPS = { + className: 'block-editor-block-settings-menu__popover', + placement: 'bottom-start' +}; + +/** + * Internal dependencies + */ + + +const { + useHistory: leaf_more_menu_useHistory, + useLocation: leaf_more_menu_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function LeafMoreMenu(props) { + const history = leaf_more_menu_useHistory(); + const { + path + } = leaf_more_menu_useLocation(); + const { + block + } = props; + const { + clientId + } = block; + const { + moveBlocksDown, + moveBlocksUp, + removeBlocks + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ + (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ + clientId, + maximumLength: 25 + })); + const goToLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ + (0,external_wp_i18n_namespaceObject.__)('Go to %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ + clientId, + maximumLength: 25 + })); + const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getBlockRootClientId + } = select(external_wp_blockEditor_namespaceObject.store); + return getBlockRootClientId(clientId); + }, [clientId]); + const onGoToPage = (0,external_wp_element_namespaceObject.useCallback)(selectedBlock => { + const { + attributes, + name + } = selectedBlock; + if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) { + history.navigate(`/${attributes.type}/${attributes.id}?canvas=edit`, { + state: { + backPath: path + } + }); + } + if (name === 'core/page-list-item' && attributes.id && history) { + history.navigate(`/page/${attributes.id}?canvas=edit`, { + state: { + backPath: path + } + }); + } + }, [path, history]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Options'), + className: "block-editor-block-settings-menu", + popoverProps: leaf_more_menu_POPOVER_PROPS, + noIcons: true, + ...props, + children: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: chevron_up, + onClick: () => { + moveBlocksUp([clientId], rootClientId); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Move up') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + icon: chevron_down, + onClick: () => { + moveBlocksDown([clientId], rootClientId); + onClose(); + }, + children: (0,external_wp_i18n_namespaceObject.__)('Move down') + }), block.attributes?.type === 'page' && block.attributes?.id && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + onGoToPage(block); + onClose(); + }, + children: goToLabel + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { + onClick: () => { + removeBlocks([clientId], false); + onClose(); }, - size: "compact", - __nextHasNoMarginBottom: true - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - expanded: false, - spacing: 1, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - onClick: () => onChangeView({ - ...view, - page: currentPage - 1 - }), - disabled: currentPage === 1, - __experimentalIsFocusable: true, - label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), - icon: chevron_left, - showTooltip: true, - size: "compact", - tooltipPosition: "top" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - onClick: () => onChangeView({ - ...view, - page: currentPage + 1 - }), - disabled: currentPage >= totalPages, - __experimentalIsFocusable: true, - label: (0,external_wp_i18n_namespaceObject.__)('Next page'), - icon: chevron_right, - showTooltip: true, - size: "compact", - tooltipPosition: "top" - })] - })] - }); -}); -/* harmony default export */ const pagination = (pagination_Pagination); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/lock-unlock.js -/** - * WordPress dependencies - */ - -const { - lock: lock_unlock_lock, - unlock: build_module_lock_unlock_unlock -} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/dataviews'); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/constants.js -/** - * WordPress dependencies - */ + children: removeLabel + }) + })] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + PrivateListView +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js. +const MAX_PAGE_COUNT = 100; +const PAGES_QUERY = ['postType', 'page', { + per_page: MAX_PAGE_COUNT, + _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], + // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby + // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent + // sort. + orderby: 'menu_order', + order: 'asc' +}]; +function NavigationMenuContent({ + rootClientId +}) { + const { + listViewRootClientId, + isLoading + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + areInnerBlocksControlled, + getBlockName, + getBlockCount, + getBlockOrder + } = select(external_wp_blockEditor_namespaceObject.store); + const { + isResolving + } = select(external_wp_coreData_namespaceObject.store); + const blockClientIds = getBlockOrder(rootClientId); + const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === 'core/page-list'; + const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0; + const isLoadingPages = isResolving('getEntityRecords', PAGES_QUERY); + return { + listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId, + // This is a small hack to wait for the navigation block + // to actually load its inner blocks. + isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages + }; + }, [rootClientId]); + const { + replaceBlock, + __unstableMarkNextChangeAsNotPersistent + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); + const offCanvasOnselect = (0,external_wp_element_namespaceObject.useCallback)(block => { + if (block.name === 'core/navigation-link' && !block.attributes.url) { + __unstableMarkNextChangeAsNotPersistent(); + replaceBlock(block.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', block.attributes)); + } + }, [__unstableMarkNextChangeAsNotPersistent, replaceBlock]); + + // The hidden block is needed because it makes block edit side effects trigger. + // For example a navigation page list load its items has an effect on edit to load its items. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { + rootClientId: listViewRootClientId, + onSelect: offCanvasOnselect, + blockSettingsMenu: LeafMoreMenu, + showAppender: false + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {}) + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const navigation_menu_editor_noop = () => {}; +function NavigationMenuEditor({ + navigationMenuId +}) { + const { + storedSettings + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getSettings + } = unlock(select(store)); + return { + storedSettings: getSettings() + }; + }, []); + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!navigationMenuId) { + return []; + } + return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { + ref: navigationMenuId + })]; + }, [navigationMenuId]); + if (!navigationMenuId || !blocks?.length) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { + settings: storedSettings, + value: blocks, + onChange: navigation_menu_editor_noop, + onInput: navigation_menu_editor_noop, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-navigation-menus__content", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContent, { + rootClientId: blocks[0].clientId + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +/** + * WordPress dependencies + */ + + + +// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. +function buildNavigationLabel(title, id, status) { + if (!title?.rendered) { + /* translators: %s: the index of the menu in the list of menus. */ + return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); + } + if (status === 'publish') { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered); + } + return (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered), status); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +function SingleNavigationMenu({ + navigationMenu, + backPath, + handleDelete, + handleDuplicate, + handleSave +}) { + const menuTitle = navigationMenu?.title?.rendered; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { + menuId: navigationMenu?.id, + menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), + onDelete: handleDelete, + onSave: handleSave, + onDuplicate: handleDuplicate + }) + }), + backPath: backPath, + title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuEditor, { + navigationMenuId: navigationMenu?.id + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + useLocation: sidebar_navigation_screen_navigation_menu_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const postType = `wp_navigation`; +function SidebarNavigationScreenNavigationMenu({ + backPath +}) { + const { + params: { + postId + } + } = sidebar_navigation_screen_navigation_menu_useLocation(); + const { + record: navigationMenu, + isResolving + } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId); + const { + isSaving, + isDeleting + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + isSavingEntityRecord, + isDeletingEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return { + isSaving: isSavingEntityRecord('postType', postType, postId), + isDeleting: isDeletingEntityRecord('postType', postType, postId) + }; + }, [postId]); + const isLoading = isResolving || isSaving || isDeleting; + const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; + const { + handleSave, + handleDelete, + handleDuplicate + } = useNavigationMenuHandlers(); + const _handleDelete = () => handleDelete(navigationMenu); + const _handleSave = edits => handleSave(navigationMenu, edits); + const _handleDuplicate = () => handleDuplicate(navigationMenu); + if (isLoading) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { + className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" + }) + }); + } + if (!isLoading && !navigationMenu) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menu missing.'), + backPath: backPath + }); + } + if (!navigationMenu?.content?.raw) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { + menuId: navigationMenu?.id, + menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), + onDelete: _handleDelete, + onSave: _handleSave, + onDuplicate: _handleDuplicate + }), + backPath: backPath, + title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), + description: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { + navigationMenu: navigationMenu, + backPath: backPath, + handleDelete: _handleDelete, + handleSave: _handleSave, + handleDuplicate: _handleDuplicate + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +const { + useHistory: use_navigation_menu_handlers_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +function useDeleteNavigationMenu() { + const { + deleteEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const history = use_navigation_menu_handlers_useHistory(); + const handleDelete = async navigationMenu => { + const postId = navigationMenu?.id; + try { + await deleteEntityRecord('postType', postType, postId, { + force: true + }, { + throwOnError: true + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.'), { + type: 'snackbar' + }); + history.navigate('/navigation'); + } catch (error) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to delete Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleDelete; +} +function useSaveNavigationMenu() { + const { + getEditedEntityRecord + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEditedEntityRecord: getEditedEntityRecordSelector + } = select(external_wp_coreData_namespaceObject.store); + return { + getEditedEntityRecord: getEditedEntityRecordSelector + }; + }, []); + const { + editEntityRecord, + __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const handleSave = async (navigationMenu, edits) => { + if (!edits) { + return; + } + const postId = navigationMenu?.id; + // Prepare for revert in case of error. + const originalRecord = getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, postId); + + // Apply the edits. + editEntityRecord('postType', postType, postId, edits); + const recordPropertiesToSave = Object.keys(edits); + + // Attempt to persist. + try { + await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, { + throwOnError: true + }); + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Renamed Navigation Menu'), { + type: 'snackbar' + }); + } catch (error) { + // Revert to original in case of error. + editEntityRecord('postType', postType, postId, originalRecord); + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be renamed. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to rename Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleSave; +} +function useDuplicateNavigationMenu() { + const history = use_navigation_menu_handlers_useHistory(); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createSuccessNotice, + createErrorNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const handleDuplicate = async navigationMenu => { + const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; + try { + const savedRecord = await saveEntityRecord('postType', postType, { + title: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Navigation menu title */ + (0,external_wp_i18n_namespaceObject._x)('%s (Copy)', 'navigation menu'), menuTitle), + content: navigationMenu?.content?.raw, + status: 'publish' + }, { + throwOnError: true + }); + if (savedRecord) { + createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Duplicated Navigation Menu'), { + type: 'snackbar' + }); + history.navigate(`/wp_navigation/${savedRecord.id}`); + } + } catch (error) { + createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: error message describing why the navigation menu could not be deleted. */ + (0,external_wp_i18n_namespaceObject.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message), { + type: 'snackbar' + }); + } + }; + return handleDuplicate; +} +function useNavigationMenuHandlers() { + return { + handleDelete: useDeleteNavigationMenu(), + handleSave: useSaveNavigationMenu(), + handleDuplicate: useDuplicateNavigationMenu() + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. + +function buildMenuLabel(title, id, status) { + if (!title) { + /* translators: %s: the index of the menu in the list of menus. */ + return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); + } + if (status === 'publish') { + return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); + } + return (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'menu label'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); +} +function SidebarNavigationScreenNavigationMenus({ + backPath +}) { + const { + records: navigationMenus, + isResolving: isResolvingNavigationMenus, + hasResolved: hasResolvedNavigationMenus + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY); + const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus; + const { + getNavigationFallbackId + } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); + const isCreatingNavigationFallback = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).isResolving('getNavigationFallbackId'), []); + const firstNavigationMenu = navigationMenus?.[0]; + + // If there is no navigation menu found + // then trigger fallback algorithm to create one. + if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && + // Ensure a fallback navigation is created only once + !isCreatingNavigationFallback) { + getNavigationFallbackId(); + } + const { + handleSave, + handleDelete, + handleDuplicate + } = useNavigationMenuHandlers(); + const hasNavigationMenus = !!navigationMenus?.length; + if (isLoading) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { + className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" + }) + }); + } + if (!isLoading && !hasNavigationMenus) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + description: (0,external_wp_i18n_namespaceObject.__)('No Navigation Menus found.'), + backPath: backPath + }); + } + + // if single menu then render it + if (navigationMenus?.length === 1) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { + navigationMenu: firstNavigationMenu, + backPath: backPath, + handleDelete: () => handleDelete(firstNavigationMenu), + handleDuplicate: () => handleDuplicate(firstNavigationMenu), + handleSave: edits => handleSave(firstNavigationMenu, edits) + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { + backPath: backPath, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-navigation-menus", + children: navigationMenus?.map(({ + id, + title, + status + }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavMenuItem, { + postId: id, + withChevron: true, + icon: library_navigation, + children: buildMenuLabel(title?.rendered, index + 1, status) + }, id)) + }) + }); +} +function SidebarNavigationScreenWrapper({ + children, + actions, + title, + description, + backPath +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: title || (0,external_wp_i18n_namespaceObject.__)('Navigation'), + actions: actions, + description: description || (0,external_wp_i18n_namespaceObject.__)('Manage your Navigation Menus.'), + backPath: backPath, + content: children + }); +} +const NavMenuItem = ({ + postId, + ...props +}) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: `/wp_navigation/${postId}`, + ...props + }); +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const { + useLocation: navigation_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileNavigationView() { + const { + query = {} + } = navigation_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { + backPath: "/" + }); +} +const navigationRoute = { + name: 'navigation', + path: '/navigation', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { + backPath: "/" + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : undefined; + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationView, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/navigation-item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const { + useLocation: navigation_item_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobileNavigationItemView() { + const { + query = {} + } = navigation_item_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { + backPath: "/navigation" + }); +} +const navigationItemRoute = { + name: 'navigation-item', + path: '/wp_navigation/:postId', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { + backPath: "/navigation" + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileNavigationItemView, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + } +}; + +;// ./node_modules/@wordpress/icons/build-module/library/file.js +/** + * WordPress dependencies + */ + + +const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" + }) +}); +/* harmony default export */ const library_file = (file); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.js +/** + * Internal dependencies + */ + + +function CategoryItem({ + count, + icon, + id, + isActive, + label, + type +}) { + if (!count) { + return; + } + const queryArgs = [`postType=${type}`]; + if (id) { + queryArgs.push(`categoryId=${id}`); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + icon: icon, + suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: count + }), + "aria-current": isActive ? 'true' : undefined, + to: `/pattern?${queryArgs.join('&')}`, + children: label + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + +function useDefaultPatternCategories() { + const blockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _settings$__experimen; + const { + getSettings + } = unlock(select(store)); + const settings = getSettings(); + return (_settings$__experimen = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatternCategories; + }); + const restBlockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()); + return [...(blockPatternCategories || []), ...(restBlockPatternCategories || [])]; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/utils.js +const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + +function useThemePatterns() { + const blockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => { + var _getSettings$__experi; + const { + getSettings + } = unlock(select(store)); + return (_getSettings$__experi = getSettings().__experimentalAdditionalBlockPatterns) !== null && _getSettings$__experi !== void 0 ? _getSettings$__experi : getSettings().__experimentalBlockPatterns; + }); + const restBlockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatterns()); + const patterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false), [blockPatterns, restBlockPatterns]); + return patterns; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/search-items.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const { + extractWords, + getNormalizedSearchTerms, + normalizeString +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); + +/** + * Internal dependencies + */ + + +// Default search helpers. +const defaultGetName = item => { + if (item.type === PATTERN_TYPES.user) { + return item.slug; + } + if (item.type === TEMPLATE_PART_POST_TYPE) { + return ''; + } + return item.name || ''; +}; +const defaultGetTitle = item => { + if (typeof item.title === 'string') { + return item.title; + } + if (item.title && item.title.rendered) { + return item.title.rendered; + } + if (item.title && item.title.raw) { + return item.title.raw; + } + return ''; +}; +const defaultGetDescription = item => { + if (item.type === PATTERN_TYPES.user) { + return item.excerpt.raw; + } + return item.description || ''; +}; +const defaultGetKeywords = item => item.keywords || []; +const defaultHasCategory = () => false; +const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { + return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term))); +}; + +/** + * Filters an item list given a search term. + * + * @param {Array} items Item list + * @param {string} searchInput Search input. + * @param {Object} config Search Config. + * + * @return {Array} Filtered item list. + */ +const searchItems = (items = [], searchInput = '', config = {}) => { + const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); + + // Filter patterns by category: the default category indicates that all patterns will be shown. + const onlyFilterByCategory = config.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length; + const searchRankConfig = { + ...config, + onlyFilterByCategory + }; + + // If we aren't filtering on search terms, matching on category is satisfactory. + // If we are, then we need more than a category match. + const threshold = onlyFilterByCategory ? 0 : 1; + const rankedItems = items.map(item => { + return [item, getItemSearchRank(item, searchInput, searchRankConfig)]; + }).filter(([, rank]) => rank > threshold); + + // If we didn't have terms to search on, there's no point sorting. + if (normalizedSearchTerms.length === 0) { + return rankedItems.map(([item]) => item); + } + rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); + return rankedItems.map(([item]) => item); +}; + +/** + * Get the search rank for a given item and a specific search term. + * The better the match, the higher the rank. + * If the rank equals 0, it should be excluded from the results. + * + * @param {Object} item Item to filter. + * @param {string} searchTerm Search term. + * @param {Object} config Search Config. + * + * @return {number} Search Rank. + */ +function getItemSearchRank(item, searchTerm, config) { + const { + categoryId, + getName = defaultGetName, + getTitle = defaultGetTitle, + getDescription = defaultGetDescription, + getKeywords = defaultGetKeywords, + hasCategory = defaultHasCategory, + onlyFilterByCategory + } = config; + let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0; + + // If an item doesn't belong to the current category or we don't have + // search terms to filter by, return the initial rank value. + if (!rank || onlyFilterByCategory) { + return rank; + } + const name = getName(item); + const title = getTitle(item); + const description = getDescription(item); + const keywords = getKeywords(item); + const normalizedSearchInput = normalizeString(searchTerm); + const normalizedTitle = normalizeString(title); + + // Prefers exact matches + // Then prefers if the beginning of the title matches the search term + // name, keywords, description matches come later. + if (normalizedSearchInput === normalizedTitle) { + rank += 30; + } else if (normalizedTitle.startsWith(normalizedSearchInput)) { + rank += 20; + } else { + const terms = [name, title, description, ...keywords].join(' '); + const normalizedSearchTerms = extractWords(normalizedSearchInput); + const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); + if (unmatchedTerms.length === 0) { + rank += 10; + } + } + return rank; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-patterns.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + +const EMPTY_PATTERN_LIST = []; +const selectTemplateParts = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, search = '') => { + var _getEntityRecords; + const { + getEntityRecords, + getCurrentTheme, + isResolving: isResolvingSelector + } = select(external_wp_coreData_namespaceObject.store); + const query = { + per_page: -1 + }; + const templateParts = (_getEntityRecords = getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, query)) !== null && _getEntityRecords !== void 0 ? _getEntityRecords : EMPTY_PATTERN_LIST; + + // In the case where a custom template part area has been removed we need + // the current list of areas to cross check against so orphaned template + // parts can be treated as uncategorized. + const knownAreas = getCurrentTheme()?.default_template_part_areas || []; + const templatePartAreas = knownAreas.map(area => area.area); + const templatePartHasCategory = (item, category) => { + if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) { + return item.area === category; + } + return item.area === category || !templatePartAreas.includes(item.area); + }; + const isResolving = isResolvingSelector('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, query]); + const patterns = searchItems(templateParts, search, { + categoryId, + hasCategory: templatePartHasCategory + }); + return { + patterns, + isResolving + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 +}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 +}]), select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas]); +const selectThemePatterns = (0,external_wp_data_namespaceObject.createSelector)(select => { + var _settings$__experimen; + const { + getSettings + } = unlock(select(store)); + const { + isResolving: isResolvingSelector + } = select(external_wp_coreData_namespaceObject.store); + const settings = getSettings(); + const blockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns; + const restBlockPatterns = select(external_wp_coreData_namespaceObject.store).getBlockPatterns(); + const patterns = [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false).map(pattern => ({ + ...pattern, + keywords: pattern.keywords || [], + type: PATTERN_TYPES.theme, + blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { + __unstableSkipMigrationLogs: true + }) + })); + return { + patterns, + isResolving: isResolvingSelector('getBlockPatterns') + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), select(external_wp_coreData_namespaceObject.store).isResolving('getBlockPatterns'), unlock(select(store)).getSettings()]); +const selectPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, syncStatus, search = '') => { + const { + patterns: themePatterns, + isResolving: isResolvingThemePatterns + } = selectThemePatterns(select); + const { + patterns: userPatterns, + isResolving: isResolvingUserPatterns, + categories: userPatternCategories + } = selectUserPatterns(select); + let patterns = [...(themePatterns || []), ...(userPatterns || [])]; + if (syncStatus) { + // User patterns can have their sync statuses checked directly + // Non-user patterns are all unsynced for the time being. + patterns = patterns.filter(pattern => { + return pattern.type === PATTERN_TYPES.user ? (pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full) === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced; + }); + } + if (categoryId) { + patterns = searchItems(patterns, search, { + categoryId, + hasCategory: (item, currentCategory) => { + if (item.type === PATTERN_TYPES.user) { + return item.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId)?.slug === currentCategory); + } + return item.categories?.includes(currentCategory); + } + }); + } else { + patterns = searchItems(patterns, search, { + hasCategory: item => { + if (item.type === PATTERN_TYPES.user) { + return userPatternCategories?.length && (!item.wp_pattern_category?.length || !item.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId))); + } + return !item.hasOwnProperty('categories'); + } + }); + } + return { + patterns, + isResolving: isResolvingThemePatterns || isResolvingUserPatterns + }; +}, select => [selectThemePatterns(select), selectUserPatterns(select)]); +const selectUserPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, syncStatus, search = '') => { + const { + getEntityRecords, + isResolving: isResolvingSelector, + getUserPatternCategories + } = select(external_wp_coreData_namespaceObject.store); + const query = { + per_page: -1 + }; + const patternPosts = getEntityRecords('postType', PATTERN_TYPES.user, query); + const userPatternCategories = getUserPatternCategories(); + const categories = new Map(); + userPatternCategories.forEach(userCategory => categories.set(userCategory.id, userCategory)); + let patterns = patternPosts !== null && patternPosts !== void 0 ? patternPosts : EMPTY_PATTERN_LIST; + const isResolving = isResolvingSelector('getEntityRecords', ['postType', PATTERN_TYPES.user, query]); + if (syncStatus) { + patterns = patterns.filter(pattern => pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full === syncStatus); + } + patterns = searchItems(patterns, search, { + // We exit user pattern retrieval early if we aren't in the + // catch-all category for user created patterns, so it has + // to be in the category. + hasCategory: () => true + }); + return { + patterns, + isResolving, + categories: userPatternCategories + }; +}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', PATTERN_TYPES.user, { + per_page: -1 +}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', PATTERN_TYPES.user, { + per_page: -1 +}]), select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()]); +function useAugmentPatternsWithPermissions(patterns) { + const idsAndTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { + var _patterns$filter$map; + return (_patterns$filter$map = patterns?.filter(record => record.type !== PATTERN_TYPES.theme).map(record => [record.type, record.id])) !== null && _patterns$filter$map !== void 0 ? _patterns$filter$map : []; + }, [patterns]); + const permissions = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getEntityRecordPermissions + } = unlock(select(external_wp_coreData_namespaceObject.store)); + return idsAndTypes.reduce((acc, [type, id]) => { + acc[id] = getEntityRecordPermissions('postType', type, id); + return acc; + }, {}); + }, [idsAndTypes]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + var _patterns$map; + return (_patterns$map = patterns?.map(record => { + var _permissions$record$i; + return { + ...record, + permissions: (_permissions$record$i = permissions?.[record.id]) !== null && _permissions$record$i !== void 0 ? _permissions$record$i : {} + }; + })) !== null && _patterns$map !== void 0 ? _patterns$map : []; + }, [patterns, permissions]); +} +const usePatterns = (postType, categoryId, { + search = '', + syncStatus +} = {}) => { + return (0,external_wp_data_namespaceObject.useSelect)(select => { + if (postType === TEMPLATE_PART_POST_TYPE) { + return selectTemplateParts(select, categoryId, search); + } else if (postType === PATTERN_TYPES.user && !!categoryId) { + const appliedCategory = categoryId === 'uncategorized' ? '' : categoryId; + return selectPatterns(select, appliedCategory, syncStatus, search); + } else if (postType === PATTERN_TYPES.user) { + return selectUserPatterns(select, syncStatus, search); + } + return { + patterns: EMPTY_PATTERN_LIST, + isResolving: false + }; + }, [categoryId, postType, search, syncStatus]); +}; +/* harmony default export */ const use_patterns = (usePatterns); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function usePatternCategories() { + const defaultCategories = useDefaultPatternCategories(); + defaultCategories.push({ + name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') + }); + const themePatterns = useThemePatterns(); + const { + patterns: userPatterns, + categories: userPatternCategories + } = use_patterns(PATTERN_TYPES.user); + const patternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { + const categoryMap = {}; + const categoriesWithCounts = []; + + // Create a map for easier counting of patterns in categories. + defaultCategories.forEach(category => { + if (!categoryMap[category.name]) { + categoryMap[category.name] = { + ...category, + count: 0 + }; + } + }); + userPatternCategories.forEach(category => { + if (!categoryMap[category.name]) { + categoryMap[category.name] = { + ...category, + count: 0 + }; + } + }); + + // Update the category counts to reflect theme registered patterns. + themePatterns.forEach(pattern => { + pattern.categories?.forEach(category => { + if (categoryMap[category]) { + categoryMap[category].count += 1; + } + }); + // If the pattern has no categories, add it to uncategorized. + if (!pattern.categories?.length) { + categoryMap.uncategorized.count += 1; + } + }); + + // Update the category counts to reflect user registered patterns. + userPatterns.forEach(pattern => { + pattern.wp_pattern_category?.forEach(catId => { + const category = userPatternCategories.find(cat => cat.id === catId)?.name; + if (categoryMap[category]) { + categoryMap[category].count += 1; + } + }); + // If the pattern has no categories, add it to uncategorized. + if (!pattern.wp_pattern_category?.length || !pattern.wp_pattern_category?.some(catId => userPatternCategories.find(cat => cat.id === catId))) { + categoryMap.uncategorized.count += 1; + } + }); + + // Filter categories so we only have those containing patterns. + [...defaultCategories, ...userPatternCategories].forEach(category => { + if (categoryMap[category.name].count && !categoriesWithCounts.find(cat => cat.name === category.name)) { + categoriesWithCounts.push(categoryMap[category.name]); + } + }); + const sortedCategories = categoriesWithCounts.sort((a, b) => a.label.localeCompare(b.label)); + sortedCategories.unshift({ + name: PATTERN_USER_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('My patterns'), + count: userPatterns.length + }); + sortedCategories.unshift({ + name: PATTERN_DEFAULT_CATEGORY, + label: (0,external_wp_i18n_namespaceObject.__)('All patterns'), + description: (0,external_wp_i18n_namespaceObject.__)('A list of all patterns from all sources.'), + count: themePatterns.length + userPatterns.length + }); + return sortedCategories; + }, [defaultCategories, themePatterns, userPatternCategories, userPatterns]); + return { + patternCategories, + hasPatterns: !!patternCategories.length + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +const useTemplatePartsGroupedByArea = items => { + const allItems = items || []; + const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [], []); + + // Create map of template areas ensuring that default areas are displayed before + // any custom registered template part areas. + const knownAreas = { + header: {}, + footer: {}, + sidebar: {}, + uncategorized: {} + }; + templatePartAreas.forEach(templatePartArea => knownAreas[templatePartArea.area] = { + ...templatePartArea, + templateParts: [] + }); + const groupedByArea = allItems.reduce((accumulator, item) => { + const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY; + accumulator[key]?.templateParts?.push(item); + return accumulator; + }, knownAreas); + return groupedByArea; +}; +function useTemplatePartAreas() { + const { + records: templateParts, + isResolving: isLoading + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_PART_POST_TYPE, { + per_page: -1 + }); + return { + hasTemplateParts: templateParts ? !!templateParts.length : false, + isLoading, + templatePartAreas: useTemplatePartsGroupedByArea(templateParts) + }; +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + useLocation: sidebar_navigation_screen_patterns_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function CategoriesGroup({ + templatePartAreas, + patternCategories, + currentCategory, + currentType +}) { + const [allPatterns, ...otherPatterns] = patternCategories; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-patterns__group", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: Object.values(templatePartAreas).map(({ + templateParts + }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0), + icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)() /* no name, so it provides the fallback icon */, + label: (0,external_wp_i18n_namespaceObject.__)('All template parts'), + id: TEMPLATE_PART_ALL_AREAS_CATEGORY, + type: TEMPLATE_PART_POST_TYPE, + isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE + }, "all"), Object.entries(templatePartAreas).map(([area, { + label, + templateParts + }]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: templateParts?.length, + icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area), + label: label, + id: area, + type: TEMPLATE_PART_POST_TYPE, + isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE + }, area)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "edit-site-sidebar-navigation-screen-patterns__divider" + }), allPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: allPatterns.count, + label: allPatterns.label, + icon: library_file, + id: allPatterns.name, + type: PATTERN_TYPES.user, + isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user + }, allPatterns.name), otherPatterns.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { + count: category.count, + label: category.label, + icon: library_file, + id: category.name, + type: PATTERN_TYPES.user, + isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user + }, category.name))] + }); +} +function SidebarNavigationScreenPatterns({ + backPath +}) { + const { + query: { + postType = 'wp_block', + categoryId + } + } = sidebar_navigation_screen_patterns_useLocation(); + const currentCategory = categoryId || (postType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY); + const { + templatePartAreas, + hasTemplateParts, + isLoading + } = useTemplatePartAreas(); + const { + patternCategories, + hasPatterns + } = usePatternCategories(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), + description: (0,external_wp_i18n_namespaceObject.__)('Manage what patterns are available when editing the site.'), + isRoot: !backPath, + backPath: backPath, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading items…'), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!hasTemplateParts && !hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-patterns__group", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { + children: (0,external_wp_i18n_namespaceObject.__)('No items found') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoriesGroup, { + templatePartAreas: templatePartAreas, + patternCategories: patternCategories, + currentCategory: currentCategory, + currentType: postType + })] + })] + }) + }); +} + +// EXTERNAL MODULE: ./node_modules/remove-accents/index.js +var remove_accents = __webpack_require__(9681); +var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); +;// ./node_modules/@wordpress/icons/build-module/library/arrow-up.js +/** + * WordPress dependencies + */ + + +const arrowUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" + }) +}); +/* harmony default export */ const arrow_up = (arrowUp); + +;// ./node_modules/@wordpress/icons/build-module/library/arrow-down.js +/** + * WordPress dependencies + */ + + +const arrowDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" + }) +}); +/* harmony default export */ const arrow_down = (arrowDown); + +;// ./node_modules/@wordpress/dataviews/build-module/constants.js +/** + * WordPress dependencies + */ + /** @@ -24709,75 +27597,639 @@ asc: (0,external_wp_i18n_namespaceObject.__)('Sort ascending'), desc: (0,external_wp_i18n_namespaceObject.__)('Sort descending') }; +const sortIcons = { + asc: arrow_up, + desc: arrow_down +}; // View layouts. const constants_LAYOUT_TABLE = 'table'; const constants_LAYOUT_GRID = 'grid'; const constants_LAYOUT_LIST = 'list'; -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js -/** - * WordPress dependencies - */ - - -const blockTable = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" - }) -}); -/* harmony default export */ const block_table = (blockTable); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js -/** - * WordPress dependencies - */ - - -const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", - fillRule: "evenodd", - clipRule: "evenodd" - }) -}); -/* harmony default export */ const library_category = (category); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js -/** - * WordPress dependencies - */ - - -const formatListBulletsRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" - }) -}); -/* harmony default export */ const format_list_bullets_rtl = (formatListBulletsRTL); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js -/** - * WordPress dependencies - */ - - -const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" - }) -}); -/* harmony default export */ const format_list_bullets = (formatListBullets); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/funnel.js +;// ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js +/** + * Internal dependencies + */ + +function sort(a, b, direction) { + return direction === 'asc' ? a - b : b - a; +} +function isValid(value, context) { + // TODO: this implicitly means the value is required. + if (value === '') { + return false; + } + if (!Number.isInteger(Number(value))) { + return false; + } + if (context?.elements) { + const validValues = context?.elements.map(f => f.value); + if (!validValues.includes(Number(value))) { + return false; + } + } + return true; +} +/* harmony default export */ const integer = ({ + sort, + isValid, + Edit: 'integer' +}); + +;// ./node_modules/@wordpress/dataviews/build-module/field-types/text.js +/** + * Internal dependencies + */ + +function text_sort(valueA, valueB, direction) { + return direction === 'asc' ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA); +} +function text_isValid(value, context) { + if (context?.elements) { + const validValues = context?.elements?.map(f => f.value); + if (!validValues.includes(value)) { + return false; + } + } + return true; +} +/* harmony default export */ const field_types_text = ({ + sort: text_sort, + isValid: text_isValid, + Edit: 'text' +}); + +;// ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js +/** + * Internal dependencies + */ + +function datetime_sort(a, b, direction) { + const timeA = new Date(a).getTime(); + const timeB = new Date(b).getTime(); + return direction === 'asc' ? timeA - timeB : timeB - timeA; +} +function datetime_isValid(value, context) { + if (context?.elements) { + const validValues = context?.elements.map(f => f.value); + if (!validValues.includes(value)) { + return false; + } + } + return true; +} +/* harmony default export */ const datetime = ({ + sort: datetime_sort, + isValid: datetime_isValid, + Edit: 'datetime' +}); + +;// ./node_modules/@wordpress/dataviews/build-module/field-types/index.js +/** + * Internal dependencies + */ + + + + + +/** + * + * @param {FieldType} type The field type definition to get. + * + * @return A field type definition. + */ +function getFieldTypeDefinition(type) { + if ('integer' === type) { + return integer; + } + if ('text' === type) { + return field_types_text; + } + if ('datetime' === type) { + return datetime; + } + return { + sort: (a, b, direction) => { + if (typeof a === 'number' && typeof b === 'number') { + return direction === 'asc' ? a - b : b - a; + } + return direction === 'asc' ? a.localeCompare(b) : b.localeCompare(a); + }, + isValid: (value, context) => { + if (context?.elements) { + const validValues = context?.elements?.map(f => f.value); + if (!validValues.includes(value)) { + return false; + } + } + return true; + }, + Edit: () => null + }; +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function DateTime({ + data, + field, + onChange, + hideLabelFromVision +}) { + const { + id, + label + } = field; + const value = field.getValue({ + item: data + }); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { + className: "dataviews-controls__datetime", + children: [!hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { + as: "legend", + children: label + }), hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "legend", + children: label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TimePicker, { + currentTime: value, + onChange: onChangeControl, + hideLabelFromVision: true + })] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function Integer({ + data, + field, + onChange, + hideLabelFromVision +}) { + var _field$getValue; + const { + id, + label, + description + } = field; + const value = (_field$getValue = field.getValue({ + item: data + })) !== null && _field$getValue !== void 0 ? _field$getValue : ''; + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: Number(newValue) + }), [id, onChange]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { + label: label, + help: description, + value: value, + onChange: onChangeControl, + __next40pxDefaultSize: true, + hideLabelFromVision: hideLabelFromVision + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function Radio({ + data, + field, + onChange, + hideLabelFromVision +}) { + const { + id, + label + } = field; + const value = field.getValue({ + item: data + }); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + if (field.elements) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { + label: label, + onChange: onChangeControl, + options: field.elements, + selected: value, + hideLabelFromVision: hideLabelFromVision + }); + } + return null; +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + +function Select({ + data, + field, + onChange, + hideLabelFromVision +}) { + var _field$getValue, _field$elements; + const { + id, + label + } = field; + const value = (_field$getValue = field.getValue({ + item: data + })) !== null && _field$getValue !== void 0 ? _field$getValue : ''; + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + const elements = [ + /* + * Value can be undefined when: + * + * - the field is not required + * - in bulk editing + * + */ + { + label: (0,external_wp_i18n_namespaceObject.__)('Select item'), + value: '' + }, ...((_field$elements = field?.elements) !== null && _field$elements !== void 0 ? _field$elements : [])]; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + label: label, + value: value, + options: elements, + onChange: onChangeControl, + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + hideLabelFromVision: hideLabelFromVision + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function Text({ + data, + field, + onChange, + hideLabelFromVision +}) { + const { + id, + label, + placeholder + } = field; + const value = field.getValue({ + item: data + }); + const onChangeControl = (0,external_wp_element_namespaceObject.useCallback)(newValue => onChange({ + [id]: newValue + }), [id, onChange]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + label: label, + placeholder: placeholder, + value: value !== null && value !== void 0 ? value : '', + onChange: onChangeControl, + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + hideLabelFromVision: hideLabelFromVision + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + + + +const FORM_CONTROLS = { + datetime: DateTime, + integer: Integer, + radio: Radio, + select: Select, + text: Text +}; +function getControl(field, fieldTypeDefinition) { + if (typeof field.Edit === 'function') { + return field.Edit; + } + if (typeof field.Edit === 'string') { + return getControlByType(field.Edit); + } + if (field.elements) { + return getControlByType('select'); + } + if (typeof fieldTypeDefinition.Edit === 'string') { + return getControlByType(fieldTypeDefinition.Edit); + } + return fieldTypeDefinition.Edit; +} +function getControlByType(type) { + if (Object.keys(FORM_CONTROLS).includes(type)) { + return FORM_CONTROLS[type]; + } + throw 'Control ' + type + ' not found'; +} + +;// ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js +/** + * Internal dependencies + */ + + +const getValueFromId = id => ({ + item +}) => { + const path = id.split('.'); + let value = item; + for (const segment of path) { + if (value.hasOwnProperty(segment)) { + value = value[segment]; + } else { + value = undefined; + } + } + return value; +}; + +/** + * Apply default values and normalize the fields config. + * + * @param fields Fields config. + * @return Normalized fields config. + */ +function normalizeFields(fields) { + return fields.map(field => { + var _field$sort, _field$isValid, _field$enableHiding, _field$enableSorting; + const fieldTypeDefinition = getFieldTypeDefinition(field.type); + const getValue = field.getValue || getValueFromId(field.id); + const sort = (_field$sort = field.sort) !== null && _field$sort !== void 0 ? _field$sort : function sort(a, b, direction) { + return fieldTypeDefinition.sort(getValue({ + item: a + }), getValue({ + item: b + }), direction); + }; + const isValid = (_field$isValid = field.isValid) !== null && _field$isValid !== void 0 ? _field$isValid : function isValid(item, context) { + return fieldTypeDefinition.isValid(getValue({ + item + }), context); + }; + const Edit = getControl(field, fieldTypeDefinition); + const renderFromElements = ({ + item + }) => { + const value = getValue({ + item + }); + return field?.elements?.find(element => element.value === value)?.label || getValue({ + item + }); + }; + const render = field.render || (field.elements ? renderFromElements : getValue); + return { + ...field, + label: field.label || field.id, + header: field.header || field.label || field.id, + getValue, + render, + sort, + isValid, + Edit, + enableHiding: (_field$enableHiding = field.enableHiding) !== null && _field$enableHiding !== void 0 ? _field$enableHiding : true, + enableSorting: (_field$enableSorting = field.enableSorting) !== null && _field$enableSorting !== void 0 ? _field$enableSorting : true + }; + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/filter-and-sort-data-view.js +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + +function normalizeSearchInput(input = '') { + return remove_accents_default()(input.trim().toLowerCase()); +} +const filter_and_sort_data_view_EMPTY_ARRAY = []; + +/** + * Applies the filtering, sorting and pagination to the raw data based on the view configuration. + * + * @param data Raw data. + * @param view View config. + * @param fields Fields config. + * + * @return Filtered, sorted and paginated data. + */ +function filterSortAndPaginate(data, view, fields) { + if (!data) { + return { + data: filter_and_sort_data_view_EMPTY_ARRAY, + paginationInfo: { + totalItems: 0, + totalPages: 0 + } + }; + } + const _fields = normalizeFields(fields); + let filteredData = [...data]; + // Handle global search. + if (view.search) { + const normalizedSearch = normalizeSearchInput(view.search); + filteredData = filteredData.filter(item => { + return _fields.filter(field => field.enableGlobalSearch).map(field => { + return normalizeSearchInput(field.getValue({ + item + })); + }).some(field => field.includes(normalizedSearch)); + }); + } + if (view.filters && view.filters?.length > 0) { + view.filters.forEach(filter => { + const field = _fields.find(_field => _field.id === filter.field); + if (field) { + if (filter.operator === constants_OPERATOR_IS_ANY && filter?.value?.length > 0) { + filteredData = filteredData.filter(item => { + const fieldValue = field.getValue({ + item + }); + if (Array.isArray(fieldValue)) { + return filter.value.some(filterValue => fieldValue.includes(filterValue)); + } else if (typeof fieldValue === 'string') { + return filter.value.includes(fieldValue); + } + return false; + }); + } else if (filter.operator === constants_OPERATOR_IS_NONE && filter?.value?.length > 0) { + filteredData = filteredData.filter(item => { + const fieldValue = field.getValue({ + item + }); + if (Array.isArray(fieldValue)) { + return !filter.value.some(filterValue => fieldValue.includes(filterValue)); + } else if (typeof fieldValue === 'string') { + return !filter.value.includes(fieldValue); + } + return false; + }); + } else if (filter.operator === OPERATOR_IS_ALL && filter?.value?.length > 0) { + filteredData = filteredData.filter(item => { + return filter.value.every(value => { + return field.getValue({ + item + })?.includes(value); + }); + }); + } else if (filter.operator === OPERATOR_IS_NOT_ALL && filter?.value?.length > 0) { + filteredData = filteredData.filter(item => { + return filter.value.every(value => { + return !field.getValue({ + item + })?.includes(value); + }); + }); + } else if (filter.operator === constants_OPERATOR_IS) { + filteredData = filteredData.filter(item => { + return filter.value === field.getValue({ + item + }); + }); + } else if (filter.operator === constants_OPERATOR_IS_NOT) { + filteredData = filteredData.filter(item => { + return filter.value !== field.getValue({ + item + }); + }); + } + } + }); + } + + // Handle sorting. + if (view.sort) { + const fieldId = view.sort.field; + const fieldToSort = _fields.find(field => { + return field.id === fieldId; + }); + if (fieldToSort) { + filteredData.sort((a, b) => { + var _view$sort$direction; + return fieldToSort.sort(a, b, (_view$sort$direction = view.sort?.direction) !== null && _view$sort$direction !== void 0 ? _view$sort$direction : 'desc'); + }); + } + } + + // Handle pagination. + let totalItems = filteredData.length; + let totalPages = 1; + if (view.page !== undefined && view.perPage !== undefined) { + const start = (view.page - 1) * view.perPage; + totalItems = filteredData?.length || 0; + totalPages = Math.ceil(totalItems / view.perPage); + filteredData = filteredData?.slice(start, start + view.perPage); + } + return { + data: filteredData, + paginationInfo: { + totalItems, + totalPages + } + }; +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +const DataViewsContext = (0,external_wp_element_namespaceObject.createContext)({ + view: { + type: constants_LAYOUT_TABLE + }, + onChangeView: () => {}, + fields: [], + data: [], + paginationInfo: { + totalItems: 0, + totalPages: 0 + }, + selection: [], + onChangeSelection: () => {}, + setOpenedFilter: () => {}, + openedFilter: null, + getItemId: item => item.id, + isItemClickable: () => true, + containerWidth: 0 +}); +/* harmony default export */ const dataviews_context = (DataViewsContext); + +;// ./node_modules/@wordpress/icons/build-module/library/funnel.js /** * WordPress dependencies */ @@ -24792,1643 +28244,1650 @@ }); /* harmony default export */ const library_funnel = (funnel); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/unseen.js -/** - * WordPress dependencies - */ - - -const unseen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M4.67 10.664s-2.09 1.11-2.917 1.582l.494.87 1.608-.914.002.002c.343.502.86 1.17 1.563 1.84.348.33.742.663 1.185.976L5.57 16.744l.858.515 1.02-1.701a9.1 9.1 0 0 0 4.051 1.18V19h1v-2.263a9.1 9.1 0 0 0 4.05-1.18l1.021 1.7.858-.514-1.034-1.723c.442-.313.837-.646 1.184-.977.703-.669 1.22-1.337 1.563-1.839l.002-.003 1.61.914.493-.87c-1.75-.994-2.918-1.58-2.918-1.58l-.003.005a8.29 8.29 0 0 1-.422.689 10.097 10.097 0 0 1-1.36 1.598c-1.218 1.16-3.042 2.293-5.544 2.293-2.503 0-4.327-1.132-5.546-2.293a10.099 10.099 0 0 1-1.359-1.599 8.267 8.267 0 0 1-.422-.689l-.003-.005Z" - }) -}); -/* harmony default export */ const library_unseen = (unseen); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/single-selection-checkbox.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -function SingleSelectionCheckbox({ - selection, - onSelectionChange, - item, - data, - getItemId, - primaryField, - disabled -}) { - const id = getItemId(item); - const isSelected = !disabled && selection.includes(id); - let selectionLabel; - if (primaryField?.getValue && item) { - // eslint-disable-next-line @wordpress/valid-sprintf - selectionLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: item title. */ - isSelected ? (0,external_wp_i18n_namespaceObject.__)('Deselect item: %s') : (0,external_wp_i18n_namespaceObject.__)('Select item: %s'), primaryField.getValue({ - item - })); +;// ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js +"use client"; +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var _3YLGPPWQ_spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var _3YLGPPWQ_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __objRest = (source, exclude) => { + var target = {}; + for (var prop in source) + if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && __getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; + + + +;// ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js +"use client"; +var _3YLGPPWQ_defProp = Object.defineProperty; +var _3YLGPPWQ_defProps = Object.defineProperties; +var _3YLGPPWQ_getOwnPropDescs = Object.getOwnPropertyDescriptors; +var _3YLGPPWQ_getOwnPropSymbols = Object.getOwnPropertySymbols; +var _3YLGPPWQ_hasOwnProp = Object.prototype.hasOwnProperty; +var _3YLGPPWQ_propIsEnum = Object.prototype.propertyIsEnumerable; +var _3YLGPPWQ_defNormalProp = (obj, key, value) => key in obj ? _3YLGPPWQ_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var _chunks_3YLGPPWQ_spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (_3YLGPPWQ_hasOwnProp.call(b, prop)) + _3YLGPPWQ_defNormalProp(a, prop, b[prop]); + if (_3YLGPPWQ_getOwnPropSymbols) + for (var prop of _3YLGPPWQ_getOwnPropSymbols(b)) { + if (_3YLGPPWQ_propIsEnum.call(b, prop)) + _3YLGPPWQ_defNormalProp(a, prop, b[prop]); + } + return a; +}; +var _chunks_3YLGPPWQ_spreadProps = (a, b) => _3YLGPPWQ_defProps(a, _3YLGPPWQ_getOwnPropDescs(b)); +var _3YLGPPWQ_objRest = (source, exclude) => { + var target = {}; + for (var prop in source) + if (_3YLGPPWQ_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && _3YLGPPWQ_getOwnPropSymbols) + for (var prop of _3YLGPPWQ_getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && _3YLGPPWQ_propIsEnum.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; + + + +;// ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js +"use client"; + + +// src/utils/misc.ts +function PBFD2E7P_noop(..._) { +} +function shallowEqual(a, b) { + if (a === b) return true; + if (!a) return false; + if (!b) return false; + if (typeof a !== "object") return false; + if (typeof b !== "object") return false; + const aKeys = Object.keys(a); + const bKeys = Object.keys(b); + const { length } = aKeys; + if (bKeys.length !== length) return false; + for (const key of aKeys) { + if (a[key] !== b[key]) { + return false; + } + } + return true; +} +function applyState(argument, currentValue) { + if (isUpdater(argument)) { + const value = isLazyValue(currentValue) ? currentValue() : currentValue; + return argument(value); + } + return argument; +} +function isUpdater(argument) { + return typeof argument === "function"; +} +function isLazyValue(value) { + return typeof value === "function"; +} +function isObject(arg) { + return typeof arg === "object" && arg != null; +} +function isEmpty(arg) { + if (Array.isArray(arg)) return !arg.length; + if (isObject(arg)) return !Object.keys(arg).length; + if (arg == null) return true; + if (arg === "") return true; + return false; +} +function isInteger(arg) { + if (typeof arg === "number") { + return Math.floor(arg) === arg; + } + return String(Math.floor(Number(arg))) === arg; +} +function PBFD2E7P_hasOwnProperty(object, prop) { + if (typeof Object.hasOwn === "function") { + return Object.hasOwn(object, prop); + } + return Object.prototype.hasOwnProperty.call(object, prop); +} +function chain(...fns) { + return (...args) => { + for (const fn of fns) { + if (typeof fn === "function") { + fn(...args); + } + } + }; +} +function cx(...args) { + return args.filter(Boolean).join(" ") || void 0; +} +function PBFD2E7P_normalizeString(str) { + return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); +} +function omit(object, keys) { + const result = _chunks_3YLGPPWQ_spreadValues({}, object); + for (const key of keys) { + if (PBFD2E7P_hasOwnProperty(result, key)) { + delete result[key]; + } + } + return result; +} +function pick(object, paths) { + const result = {}; + for (const key of paths) { + if (PBFD2E7P_hasOwnProperty(object, key)) { + result[key] = object[key]; + } + } + return result; +} +function identity(value) { + return value; +} +function beforePaint(cb = PBFD2E7P_noop) { + const raf = requestAnimationFrame(cb); + return () => cancelAnimationFrame(raf); +} +function afterPaint(cb = PBFD2E7P_noop) { + let raf = requestAnimationFrame(() => { + raf = requestAnimationFrame(cb); + }); + return () => cancelAnimationFrame(raf); +} +function invariant(condition, message) { + if (condition) return; + if (typeof message !== "string") throw new Error("Invariant failed"); + throw new Error(message); +} +function getKeys(obj) { + return Object.keys(obj); +} +function isFalsyBooleanCallback(booleanOrCallback, ...args) { + const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; + if (result == null) return false; + return !result; +} +function disabledFromProps(props) { + return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; +} +function removeUndefinedValues(obj) { + const result = {}; + for (const key in obj) { + if (obj[key] !== void 0) { + result[key] = obj[key]; + } + } + return result; +} +function defaultValue(...values) { + for (const value of values) { + if (value !== void 0) return value; + } + return void 0; +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js +"use client"; + + +// src/utils/misc.ts + + +function setRef(ref, value) { + if (typeof ref === "function") { + ref(value); + } else if (ref) { + ref.current = value; + } +} +function isValidElementWithRef(element) { + if (!element) return false; + if (!(0,external_React_.isValidElement)(element)) return false; + if ("ref" in element.props) return true; + if ("ref" in element) return true; + return false; +} +function getRefProperty(element) { + if (!isValidElementWithRef(element)) return null; + const props = _3YLGPPWQ_spreadValues({}, element.props); + return props.ref || element.ref; +} +function mergeProps(base, overrides) { + const props = _3YLGPPWQ_spreadValues({}, base); + for (const key in overrides) { + if (!PBFD2E7P_hasOwnProperty(overrides, key)) continue; + if (key === "className") { + const prop = "className"; + props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop]; + continue; + } + if (key === "style") { + const prop = "style"; + props[prop] = base[prop] ? _3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; + continue; + } + const overrideValue = overrides[key]; + if (typeof overrideValue === "function" && key.startsWith("on")) { + const baseValue = base[key]; + if (typeof baseValue === "function") { + props[key] = (...args) => { + overrideValue(...args); + baseValue(...args); + }; + continue; + } + } + props[key] = overrideValue; + } + return props; +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.js +"use client"; + +// src/utils/dom.ts +var DTR5TSDJ_canUseDOM = checkIsBrowser(); +function checkIsBrowser() { + var _a; + return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); +} +function getDocument(node) { + if (!node) return document; + if ("self" in node) return node.document; + return node.ownerDocument || document; +} +function getWindow(node) { + if (!node) return self; + if ("self" in node) return node.self; + return getDocument(node).defaultView || window; +} +function DTR5TSDJ_getActiveElement(node, activeDescendant = false) { + const { activeElement } = getDocument(node); + if (!(activeElement == null ? void 0 : activeElement.nodeName)) { + return null; + } + if (DTR5TSDJ_isFrame(activeElement) && activeElement.contentDocument) { + return DTR5TSDJ_getActiveElement( + activeElement.contentDocument.body, + activeDescendant + ); + } + if (activeDescendant) { + const id = activeElement.getAttribute("aria-activedescendant"); + if (id) { + const element = getDocument(activeElement).getElementById(id); + if (element) { + return element; + } + } + } + return activeElement; +} +function contains(parent, child) { + return parent === child || parent.contains(child); +} +function DTR5TSDJ_isFrame(element) { + return element.tagName === "IFRAME"; +} +function isButton(element) { + const tagName = element.tagName.toLowerCase(); + if (tagName === "button") return true; + if (tagName === "input" && element.type) { + return buttonInputTypes.indexOf(element.type) !== -1; + } + return false; +} +var buttonInputTypes = [ + "button", + "color", + "file", + "image", + "reset", + "submit" +]; +function isVisible(element) { + if (typeof element.checkVisibility === "function") { + return element.checkVisibility(); + } + const htmlElement = element; + return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; +} +function isTextField(element) { + try { + const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; + const isTextArea = element.tagName === "TEXTAREA"; + return isTextInput || isTextArea || false; + } catch (error) { + return false; + } +} +function isTextbox(element) { + return element.isContentEditable || isTextField(element); +} +function getTextboxValue(element) { + if (isTextField(element)) { + return element.value; + } + if (element.isContentEditable) { + const range = getDocument(element).createRange(); + range.selectNodeContents(element); + return range.toString(); + } + return ""; +} +function getTextboxSelection(element) { + let start = 0; + let end = 0; + if (isTextField(element)) { + start = element.selectionStart || 0; + end = element.selectionEnd || 0; + } else if (element.isContentEditable) { + const selection = getDocument(element).getSelection(); + if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { + const range = selection.getRangeAt(0); + const nextRange = range.cloneRange(); + nextRange.selectNodeContents(element); + nextRange.setEnd(range.startContainer, range.startOffset); + start = nextRange.toString().length; + nextRange.setEnd(range.endContainer, range.endOffset); + end = nextRange.toString().length; + } + } + return { start, end }; +} +function getPopupRole(element, fallback) { + const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; + const role = element == null ? void 0 : element.getAttribute("role"); + if (role && allowedPopupRoles.indexOf(role) !== -1) { + return role; + } + return fallback; +} +function getPopupItemRole(element, fallback) { + var _a; + const itemRoleByPopupRole = { + menu: "menuitem", + listbox: "option", + tree: "treeitem" + }; + const popupRole = getPopupRole(element); + if (!popupRole) return fallback; + const key = popupRole; + return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback; +} +function scrollIntoViewIfNeeded(element, arg) { + if (isPartiallyHidden(element) && "scrollIntoView" in element) { + element.scrollIntoView(arg); + } +} +function getScrollingElement(element) { + if (!element) return null; + const isScrollableOverflow = (overflow) => { + if (overflow === "auto") return true; + if (overflow === "scroll") return true; + return false; + }; + if (element.clientHeight && element.scrollHeight > element.clientHeight) { + const { overflowY } = getComputedStyle(element); + if (isScrollableOverflow(overflowY)) return element; + } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { + const { overflowX } = getComputedStyle(element); + if (isScrollableOverflow(overflowX)) return element; + } + return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; +} +function isPartiallyHidden(element) { + const elementRect = element.getBoundingClientRect(); + const scroller = getScrollingElement(element); + if (!scroller) return false; + const scrollerRect = scroller.getBoundingClientRect(); + const isHTML = scroller.tagName === "HTML"; + const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top; + const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom; + const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left; + const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right; + const top = elementRect.top < scrollerTop; + const left = elementRect.left < scrollerLeft; + const bottom = elementRect.bottom > scrollerBottom; + const right = elementRect.right > scrollerRight; + return top || left || bottom || right; +} +function setSelectionRange(element, ...args) { + if (/text|search|password|tel|url/i.test(element.type)) { + element.setSelectionRange(...args); + } +} +function sortBasedOnDOMPosition(items, getElement) { + const pairs = items.map((item, index) => [index, item]); + let isOrderDifferent = false; + pairs.sort(([indexA, a], [indexB, b]) => { + const elementA = getElement(a); + const elementB = getElement(b); + if (elementA === elementB) return 0; + if (!elementA || !elementB) return 0; + if (isElementPreceding(elementA, elementB)) { + if (indexA > indexB) { + isOrderDifferent = true; + } + return -1; + } + if (indexA < indexB) { + isOrderDifferent = true; + } + return 1; + }); + if (isOrderDifferent) { + return pairs.map(([_, item]) => item); + } + return items; +} +function isElementPreceding(a, b) { + return Boolean( + b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING + ); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/QAGXQEUG.js +"use client"; + + +// src/utils/platform.ts +function isTouchDevice() { + return DTR5TSDJ_canUseDOM && !!navigator.maxTouchPoints; +} +function isApple() { + if (!DTR5TSDJ_canUseDOM) return false; + return /mac|iphone|ipad|ipod/i.test(navigator.platform); +} +function isSafari() { + return DTR5TSDJ_canUseDOM && isApple() && /apple/i.test(navigator.vendor); +} +function isFirefox() { + return DTR5TSDJ_canUseDOM && /firefox\//i.test(navigator.userAgent); +} +function isMac() { + return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); +} + + + +;// ./node_modules/@ariakit/core/esm/utils/events.js +"use client"; + + + + +// src/utils/events.ts +function isPortalEvent(event) { + return Boolean( + event.currentTarget && !contains(event.currentTarget, event.target) + ); +} +function isSelfTarget(event) { + return event.target === event.currentTarget; +} +function isOpeningInNewTab(event) { + const element = event.currentTarget; + if (!element) return false; + const isAppleDevice = isApple(); + if (isAppleDevice && !event.metaKey) return false; + if (!isAppleDevice && !event.ctrlKey) return false; + const tagName = element.tagName.toLowerCase(); + if (tagName === "a") return true; + if (tagName === "button" && element.type === "submit") return true; + if (tagName === "input" && element.type === "submit") return true; + return false; +} +function isDownloading(event) { + const element = event.currentTarget; + if (!element) return false; + const tagName = element.tagName.toLowerCase(); + if (!event.altKey) return false; + if (tagName === "a") return true; + if (tagName === "button" && element.type === "submit") return true; + if (tagName === "input" && element.type === "submit") return true; + return false; +} +function fireEvent(element, type, eventInit) { + const event = new Event(type, eventInit); + return element.dispatchEvent(event); +} +function fireBlurEvent(element, eventInit) { + const event = new FocusEvent("blur", eventInit); + const defaultAllowed = element.dispatchEvent(event); + const bubbleInit = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, eventInit), { bubbles: true }); + element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); + return defaultAllowed; +} +function fireFocusEvent(element, eventInit) { + const event = new FocusEvent("focus", eventInit); + const defaultAllowed = element.dispatchEvent(event); + const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); + element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); + return defaultAllowed; +} +function fireKeyboardEvent(element, type, eventInit) { + const event = new KeyboardEvent(type, eventInit); + return element.dispatchEvent(event); +} +function fireClickEvent(element, eventInit) { + const event = new MouseEvent("click", eventInit); + return element.dispatchEvent(event); +} +function isFocusEventOutside(event, container) { + const containerElement = container || event.currentTarget; + const relatedTarget = event.relatedTarget; + return !relatedTarget || !contains(containerElement, relatedTarget); +} +function getInputType(event) { + const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event; + if (!nativeEvent) return; + if (!("inputType" in nativeEvent)) return; + if (typeof nativeEvent.inputType !== "string") return; + return nativeEvent.inputType; +} +function queueBeforeEvent(element, type, callback, timeout) { + const createTimer = (callback2) => { + if (timeout) { + const timerId2 = setTimeout(callback2, timeout); + return () => clearTimeout(timerId2); + } + const timerId = requestAnimationFrame(callback2); + return () => cancelAnimationFrame(timerId); + }; + const cancelTimer = createTimer(() => { + element.removeEventListener(type, callSync, true); + callback(); + }); + const callSync = () => { + cancelTimer(); + callback(); + }; + element.addEventListener(type, callSync, { once: true, capture: true }); + return cancelTimer; +} +function addGlobalEventListener(type, listener, options, scope = window) { + const children = []; + try { + scope.document.addEventListener(type, listener, options); + for (const frame of Array.from(scope.frames)) { + children.push(addGlobalEventListener(type, listener, options, frame)); + } + } catch (e) { + } + const removeEventListener = () => { + try { + scope.document.removeEventListener(type, listener, options); + } catch (e) { + } + for (const remove of children) { + remove(); + } + }; + return removeEventListener; +} + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/ABQUS43J.js +"use client"; + + + +// src/utils/hooks.ts + + + + +var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject); +var useReactId = _React.useId; +var useReactDeferredValue = _React.useDeferredValue; +var useReactInsertionEffect = _React.useInsertionEffect; +var useSafeLayoutEffect = DTR5TSDJ_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; +function useInitialValue(value) { + const [initialValue] = (0,external_React_.useState)(value); + return initialValue; +} +function useLazyValue(init) { + const ref = useRef(); + if (ref.current === void 0) { + ref.current = init(); + } + return ref.current; +} +function useLiveRef(value) { + const ref = (0,external_React_.useRef)(value); + useSafeLayoutEffect(() => { + ref.current = value; + }); + return ref; +} +function usePreviousValue(value) { + const [previousValue, setPreviousValue] = useState(value); + if (value !== previousValue) { + setPreviousValue(value); + } + return previousValue; +} +function useEvent(callback) { + const ref = (0,external_React_.useRef)(() => { + throw new Error("Cannot call an event handler while rendering."); + }); + if (useReactInsertionEffect) { + useReactInsertionEffect(() => { + ref.current = callback; + }); } else { - selectionLabel = isSelected ? (0,external_wp_i18n_namespaceObject.__)('Select a new item') : (0,external_wp_i18n_namespaceObject.__)('Deselect item'); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { - className: "dataviews-view-table-selection-checkbox", - __nextHasNoMarginBottom: true, - "aria-label": selectionLabel, - "aria-disabled": disabled, - checked: isSelected, - onChange: () => { - if (disabled) { - return; - } - if (!isSelected) { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId === id || selection.includes(itemId); - })); - } else { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId !== id && selection.includes(itemId); - })); - } - } - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/item-actions.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const { - DropdownMenuV2: item_actions_DropdownMenu, - DropdownMenuGroupV2: DropdownMenuGroup, - DropdownMenuItemV2: item_actions_DropdownMenuItem, - DropdownMenuItemLabelV2: item_actions_DropdownMenuItemLabel, - kebabCase: item_actions_kebabCase -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function ButtonTrigger({ - action, - onClick, - items -}) { - const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: label, - icon: action.icon, - isDestructive: action.isDestructive, - size: "compact", - onClick: onClick - }); -} -function DropdownMenuItemTrigger({ - action, - onClick, - items -}) { - const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(item_actions_DropdownMenuItem, { - onClick: onClick, - hideOnClick: !('RenderModal' in action), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(item_actions_DropdownMenuItemLabel, { - children: label - }) - }); -} -function ActionModal({ - action, - items, - closeModal -}) { - const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: action.modalHeader || label, - __experimentalHideHeader: !!action.hideModalHeader, - onRequestClose: closeModal !== null && closeModal !== void 0 ? closeModal : () => {}, - overlayClassName: `dataviews-action-modal dataviews-action-modal__${item_actions_kebabCase(action.id)}`, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { - items: items, - closeModal: closeModal, - onActionStart: action.onActionStart, - onActionPerformed: action.onActionPerformed - }) - }); -} -function ActionWithModal({ - action, - items, - ActionTrigger, - isBusy -}) { - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const actionTriggerProps = { - action, - onClick: () => { - setIsModalOpen(true); - }, + ref.current = callback; + } + return (0,external_React_.useCallback)((...args) => { + var _a; + return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); + }, []); +} +function useTransactionState(callback) { + const [state, setState] = (0,external_React_.useState)(null); + useSafeLayoutEffect(() => { + if (state == null) return; + if (!callback) return; + let prevState = null; + callback((prev) => { + prevState = prev; + return state; + }); + return () => { + callback(prevState); + }; + }, [state, callback]); + return [state, setState]; +} +function useMergeRefs(...refs) { + return (0,external_React_.useMemo)(() => { + if (!refs.some(Boolean)) return; + return (value) => { + for (const ref of refs) { + setRef(ref, value); + } + }; + }, refs); +} +function useId(defaultId) { + if (useReactId) { + const reactId = useReactId(); + if (defaultId) return defaultId; + return reactId; + } + const [id, setId] = (0,external_React_.useState)(defaultId); + useSafeLayoutEffect(() => { + if (defaultId || id) return; + const random = Math.random().toString(36).slice(2, 8); + setId(`id-${random}`); + }, [defaultId, id]); + return defaultId || id; +} +function useDeferredValue(value) { + if (useReactDeferredValue) { + return useReactDeferredValue(value); + } + const [deferredValue, setDeferredValue] = useState(value); + useEffect(() => { + const raf = requestAnimationFrame(() => setDeferredValue(value)); + return () => cancelAnimationFrame(raf); + }, [value]); + return deferredValue; +} +function useTagName(refOrElement, type) { + const stringOrUndefined = (type2) => { + if (typeof type2 !== "string") return; + return type2; + }; + const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type)); + useSafeLayoutEffect(() => { + const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; + setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); + }, [refOrElement, type]); + return tagName; +} +function useAttribute(refOrElement, attributeName, defaultValue) { + const initialValue = useInitialValue(defaultValue); + const [attribute, setAttribute] = (0,external_React_.useState)(initialValue); + (0,external_React_.useEffect)(() => { + const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; + if (!element) return; + const callback = () => { + const value = element.getAttribute(attributeName); + setAttribute(value == null ? initialValue : value); + }; + const observer = new MutationObserver(callback); + observer.observe(element, { attributeFilter: [attributeName] }); + callback(); + return () => observer.disconnect(); + }, [refOrElement, attributeName, initialValue]); + return attribute; +} +function useUpdateEffect(effect, deps) { + const mounted = (0,external_React_.useRef)(false); + (0,external_React_.useEffect)(() => { + if (mounted.current) { + return effect(); + } + mounted.current = true; + }, deps); + (0,external_React_.useEffect)( + () => () => { + mounted.current = false; + }, + [] + ); +} +function useUpdateLayoutEffect(effect, deps) { + const mounted = (0,external_React_.useRef)(false); + useSafeLayoutEffect(() => { + if (mounted.current) { + return effect(); + } + mounted.current = true; + }, deps); + useSafeLayoutEffect( + () => () => { + mounted.current = false; + }, + [] + ); +} +function useForceUpdate() { + return (0,external_React_.useReducer)(() => [], []); +} +function useBooleanEvent(booleanOrCallback) { + return useEvent( + typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback + ); +} +function useWrapElement(props, callback, deps = []) { + const wrapElement = (0,external_React_.useCallback)( + (element) => { + if (props.wrapElement) { + element = props.wrapElement(element); + } + return callback(element); + }, + [...deps, props.wrapElement] + ); + return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { wrapElement }); +} +function usePortalRef(portalProp = false, portalRefProp) { + const [portalNode, setPortalNode] = useState(null); + const portalRef = useMergeRefs(setPortalNode, portalRefProp); + const domReady = !portalProp || portalNode; + return { portalRef, portalNode, domReady }; +} +function useMetadataProps(props, key, value) { + const parent = props.onLoadedMetadataCapture; + const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { + return Object.assign(() => { + }, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, parent), { [key]: value })); + }, [parent, key, value]); + return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; +} +function useIsMouseMoving() { + (0,external_React_.useEffect)(() => { + addGlobalEventListener("mousemove", setMouseMoving, true); + addGlobalEventListener("mousedown", resetMouseMoving, true); + addGlobalEventListener("mouseup", resetMouseMoving, true); + addGlobalEventListener("keydown", resetMouseMoving, true); + addGlobalEventListener("scroll", resetMouseMoving, true); + }, []); + const isMouseMoving = useEvent(() => mouseMoving); + return isMouseMoving; +} +var mouseMoving = false; +var previousScreenX = 0; +var previousScreenY = 0; +function hasMouseMovement(event) { + const movementX = event.movementX || event.screenX - previousScreenX; + const movementY = event.movementY || event.screenY - previousScreenY; + previousScreenX = event.screenX; + previousScreenY = event.screenY; + return movementX || movementY || "production" === "test"; +} +function setMouseMoving(event) { + if (!hasMouseMovement(event)) return; + mouseMoving = true; +} +function resetMouseMoving() { + mouseMoving = false; +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/LMDWO4NN.js +"use client"; + + + + +// src/utils/system.tsx + + +function forwardRef2(render) { + const Role = external_React_.forwardRef((props, ref) => render(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref }))); + Role.displayName = render.displayName || render.name; + return Role; +} +function memo2(Component, propsAreEqual) { + return external_React_.memo(Component, propsAreEqual); +} +function createElement(Type, props) { + const _a = props, { wrapElement, render } = _a, rest = __objRest(_a, ["wrapElement", "render"]); + const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); + let element; + if (external_React_.isValidElement(render)) { + const renderProps = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, render.props), { ref: mergedRef }); + element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); + } else if (render) { + element = render(rest); + } else { + element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _3YLGPPWQ_spreadValues({}, rest)); + } + if (wrapElement) { + return wrapElement(element); + } + return element; +} +function createHook(useProps) { + const useRole = (props = {}) => { + return useProps(props); + }; + useRole.displayName = useProps.name; + return useRole; +} +function createStoreContext(providers = [], scopedProviders = []) { + const context = external_React_.createContext(void 0); + const scopedContext = external_React_.createContext(void 0); + const useContext2 = () => external_React_.useContext(context); + const useScopedContext = (onlyScoped = false) => { + const scoped = external_React_.useContext(scopedContext); + const store = useContext2(); + if (onlyScoped) return scoped; + return scoped || store; + }; + const useProviderContext = () => { + const scoped = external_React_.useContext(scopedContext); + const store = useContext2(); + if (scoped && scoped === store) return; + return store; + }; + const ContextProvider = (props) => { + return providers.reduceRight( + (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })), + /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _3YLGPPWQ_spreadValues({}, props)) + ); + }; + const ScopedContextProvider = (props) => { + return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children: scopedProviders.reduceRight( + (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })), + /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _3YLGPPWQ_spreadValues({}, props)) + ) })); + }; + return { + context, + scopedContext, + useContext: useContext2, + useScopedContext, + useProviderContext, + ContextProvider, + ScopedContextProvider + }; +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/VDHZ5F7K.js +"use client"; + + +// src/collection/collection-context.tsx +var ctx = createStoreContext(); +var useCollectionContext = ctx.useContext; +var useCollectionScopedContext = ctx.useScopedContext; +var useCollectionProviderContext = ctx.useProviderContext; +var CollectionContextProvider = ctx.ContextProvider; +var CollectionScopedContextProvider = ctx.ScopedContextProvider; + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/P7GR5CS5.js +"use client"; + + + +// src/composite/composite-context.tsx + +var P7GR5CS5_ctx = createStoreContext( + [CollectionContextProvider], + [CollectionScopedContextProvider] +); +var useCompositeContext = P7GR5CS5_ctx.useContext; +var useCompositeScopedContext = P7GR5CS5_ctx.useScopedContext; +var useCompositeProviderContext = P7GR5CS5_ctx.useProviderContext; +var CompositeContextProvider = P7GR5CS5_ctx.ContextProvider; +var CompositeScopedContextProvider = P7GR5CS5_ctx.ScopedContextProvider; +var CompositeItemContext = (0,external_React_.createContext)( + void 0 +); +var CompositeRowContext = (0,external_React_.createContext)( + void 0 +); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/3XAVFTCA.js +"use client"; + + + +// src/tag/tag-context.tsx + +var TagValueContext = (0,external_React_.createContext)(null); +var TagRemoveIdContext = (0,external_React_.createContext)( + null +); +var _3XAVFTCA_ctx = createStoreContext( + [CompositeContextProvider], + [CompositeScopedContextProvider] +); +var useTagContext = _3XAVFTCA_ctx.useContext; +var useTagScopedContext = _3XAVFTCA_ctx.useScopedContext; +var useTagProviderContext = _3XAVFTCA_ctx.useProviderContext; +var TagContextProvider = _3XAVFTCA_ctx.ContextProvider; +var TagScopedContextProvider = _3XAVFTCA_ctx.ScopedContextProvider; + + + +;// ./node_modules/@ariakit/core/esm/__chunks/BCALMBPZ.js +"use client"; + + + +// src/utils/store.ts +function getInternal(store, key) { + const internals = store.__unstableInternals; + invariant(internals, "Invalid store"); + return internals[key]; +} +function createStore(initialState, ...stores) { + let state = initialState; + let prevStateBatch = state; + let lastUpdate = Symbol(); + let destroy = PBFD2E7P_noop; + const instances = /* @__PURE__ */ new Set(); + const updatedKeys = /* @__PURE__ */ new Set(); + const setups = /* @__PURE__ */ new Set(); + const listeners = /* @__PURE__ */ new Set(); + const batchListeners = /* @__PURE__ */ new Set(); + const disposables = /* @__PURE__ */ new WeakMap(); + const listenerKeys = /* @__PURE__ */ new WeakMap(); + const storeSetup = (callback) => { + setups.add(callback); + return () => setups.delete(callback); + }; + const storeInit = () => { + const initialized = instances.size; + const instance = Symbol(); + instances.add(instance); + const maybeDestroy = () => { + instances.delete(instance); + if (instances.size) return; + destroy(); + }; + if (initialized) return maybeDestroy; + const desyncs = getKeys(state).map( + (key) => chain( + ...stores.map((store) => { + var _a; + const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); + if (!storeState) return; + if (!PBFD2E7P_hasOwnProperty(storeState, key)) return; + return sync(store, [key], (state2) => { + setState( + key, + state2[key], + // @ts-expect-error - Not public API. This is just to prevent + // infinite loops. + true + ); + }); + }) + ) + ); + const teardowns = []; + for (const setup2 of setups) { + teardowns.push(setup2()); + } + const cleanups = stores.map(init); + destroy = chain(...desyncs, ...teardowns, ...cleanups); + return maybeDestroy; + }; + const sub = (keys, listener, set = listeners) => { + set.add(listener); + listenerKeys.set(listener, keys); + return () => { + var _a; + (_a = disposables.get(listener)) == null ? void 0 : _a(); + disposables.delete(listener); + listenerKeys.delete(listener); + set.delete(listener); + }; + }; + const storeSubscribe = (keys, listener) => sub(keys, listener); + const storeSync = (keys, listener) => { + disposables.set(listener, listener(state, state)); + return sub(keys, listener); + }; + const storeBatch = (keys, listener) => { + disposables.set(listener, listener(state, prevStateBatch)); + return sub(keys, listener, batchListeners); + }; + const storePick = (keys) => createStore(pick(state, keys), finalStore); + const storeOmit = (keys) => createStore(omit(state, keys), finalStore); + const getState = () => state; + const setState = (key, value, fromStores = false) => { + var _a; + if (!PBFD2E7P_hasOwnProperty(state, key)) return; + const nextValue = applyState(value, state[key]); + if (nextValue === state[key]) return; + if (!fromStores) { + for (const store of stores) { + (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); + } + } + const prevState = state; + state = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, state), { [key]: nextValue }); + const thisUpdate = Symbol(); + lastUpdate = thisUpdate; + updatedKeys.add(key); + const run = (listener, prev, uKeys) => { + var _a2; + const keys = listenerKeys.get(listener); + const updated = (k) => uKeys ? uKeys.has(k) : k === key; + if (!keys || keys.some(updated)) { + (_a2 = disposables.get(listener)) == null ? void 0 : _a2(); + disposables.set(listener, listener(state, prev)); + } + }; + for (const listener of listeners) { + run(listener, prevState); + } + queueMicrotask(() => { + if (lastUpdate !== thisUpdate) return; + const snapshot = state; + for (const listener of batchListeners) { + run(listener, prevStateBatch, updatedKeys); + } + prevStateBatch = snapshot; + updatedKeys.clear(); + }); + }; + const finalStore = { + getState, + setState, + __unstableInternals: { + setup: storeSetup, + init: storeInit, + subscribe: storeSubscribe, + sync: storeSync, + batch: storeBatch, + pick: storePick, + omit: storeOmit + } + }; + return finalStore; +} +function setup(store, ...args) { + if (!store) return; + return getInternal(store, "setup")(...args); +} +function init(store, ...args) { + if (!store) return; + return getInternal(store, "init")(...args); +} +function subscribe(store, ...args) { + if (!store) return; + return getInternal(store, "subscribe")(...args); +} +function sync(store, ...args) { + if (!store) return; + return getInternal(store, "sync")(...args); +} +function batch(store, ...args) { + if (!store) return; + return getInternal(store, "batch")(...args); +} +function omit2(store, ...args) { + if (!store) return; + return getInternal(store, "omit")(...args); +} +function pick2(store, ...args) { + if (!store) return; + return getInternal(store, "pick")(...args); +} +function mergeStore(...stores) { + const initialState = stores.reduce((state, store2) => { + var _a; + const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); + if (!nextState) return state; + return Object.assign(state, nextState); + }, {}); + const store = createStore(initialState, ...stores); + return Object.assign({}, ...stores, store); +} +function throwOnConflictingProps(props, store) { + if (true) return; + if (!store) return; + const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { + var _a; + const stateKey = key.replace("default", ""); + return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; + }); + if (!defaultKeys.length) return; + const storeState = store.getState(); + const conflictingProps = defaultKeys.filter( + (key) => PBFD2E7P_hasOwnProperty(storeState, key) + ); + if (!conflictingProps.length) return; + throw new Error( + `Passing a store prop in conjunction with a default state is not supported. + +const store = useSelectStore(); + + ^ ^ + +Instead, pass the default state to the topmost store: + +const store = useSelectStore({ defaultValue: "Apple" }); + + +See https://github.com/ariakit/ariakit/pull/2745 for more details. + +If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit +` + ); +} + + + +// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js +var shim = __webpack_require__(422); +;// ./node_modules/@ariakit/react-core/esm/__chunks/YV4JVR4I.js +"use client"; + + + +// src/utils/store.tsx + + + + +var { useSyncExternalStore } = shim; +var noopSubscribe = () => () => { +}; +function useStoreState(store, keyOrSelector = identity) { + const storeSubscribe = external_React_.useCallback( + (callback) => { + if (!store) return noopSubscribe(); + return subscribe(store, null, callback); + }, + [store] + ); + const getSnapshot = () => { + const key = typeof keyOrSelector === "string" ? keyOrSelector : null; + const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; + const state = store == null ? void 0 : store.getState(); + if (selector) return selector(state); + if (!state) return; + if (!key) return; + if (!PBFD2E7P_hasOwnProperty(state, key)) return; + return state[key]; + }; + return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); +} +function useStoreStateObject(store, object) { + const objRef = external_React_.useRef( + {} + ); + const storeSubscribe = external_React_.useCallback( + (callback) => { + if (!store) return noopSubscribe(); + return subscribe(store, null, callback); + }, + [store] + ); + const getSnapshot = () => { + const state = store == null ? void 0 : store.getState(); + let updated = false; + const obj = objRef.current; + for (const prop in object) { + const keyOrSelector = object[prop]; + if (typeof keyOrSelector === "function") { + const value = keyOrSelector(state); + if (value !== obj[prop]) { + obj[prop] = value; + updated = true; + } + } + if (typeof keyOrSelector === "string") { + if (!state) continue; + if (!PBFD2E7P_hasOwnProperty(state, keyOrSelector)) continue; + const value = state[keyOrSelector]; + if (value !== obj[prop]) { + obj[prop] = value; + updated = true; + } + } + } + if (updated) { + objRef.current = _3YLGPPWQ_spreadValues({}, obj); + } + return objRef.current; + }; + return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); +} +function useStoreProps(store, props, key, setKey) { + const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0; + const setValue = setKey ? props[setKey] : void 0; + const propsRef = useLiveRef({ value, setValue }); + useSafeLayoutEffect(() => { + return sync(store, [key], (state, prev) => { + const { value: value2, setValue: setValue2 } = propsRef.current; + if (!setValue2) return; + if (state[key] === prev[key]) return; + if (state[key] === value2) return; + setValue2(state[key]); + }); + }, [store, key]); + useSafeLayoutEffect(() => { + if (value === void 0) return; + store.setState(key, value); + return batch(store, [key], () => { + if (value === void 0) return; + store.setState(key, value); + }); + }); +} +function YV4JVR4I_useStore(createStore, props) { + const [store, setStore] = external_React_.useState(() => createStore(props)); + useSafeLayoutEffect(() => init(store), [store]); + const useState2 = external_React_.useCallback( + (keyOrSelector) => useStoreState(store, keyOrSelector), + [store] + ); + const memoizedStore = external_React_.useMemo( + () => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { useState: useState2 }), + [store, useState2] + ); + const updateStore = useEvent(() => { + setStore((store2) => createStore(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, props), store2.getState()))); + }); + return [memoizedStore, updateStore]; +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/C3IKGW5T.js +"use client"; + + + +// src/collection/collection-store.ts + +function useCollectionStoreProps(store, update, props) { + useUpdateEffect(update, [props.store]); + useStoreProps(store, props, "items", "setItems"); + return store; +} +function useCollectionStore(props = {}) { + const [store, update] = useStore(Core.createCollectionStore, props); + return useCollectionStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/4CMBR7SL.js +"use client"; + + + + + +// src/composite/composite-store.ts + +function useCompositeStoreOptions(props) { + const id = useId(props.id); + return _3YLGPPWQ_spreadValues({ id }, props); +} +function useCompositeStoreProps(store, update, props) { + store = useCollectionStoreProps(store, update, props); + useStoreProps(store, props, "activeId", "setActiveId"); + useStoreProps(store, props, "includesBaseElement"); + useStoreProps(store, props, "virtualFocus"); + useStoreProps(store, props, "orientation"); + useStoreProps(store, props, "rtl"); + useStoreProps(store, props, "focusLoop"); + useStoreProps(store, props, "focusWrap"); + useStoreProps(store, props, "focusShift"); + return store; +} +function useCompositeStore(props = {}) { + props = useCompositeStoreOptions(props); + const [store, update] = useStore(Core.createCompositeStore, props); + return useCompositeStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/WYCIER3C.js +"use client"; + + + +// src/disclosure/disclosure-store.ts + +function useDisclosureStoreProps(store, update, props) { + useUpdateEffect(update, [props.store, props.disclosure]); + useStoreProps(store, props, "open", "setOpen"); + useStoreProps(store, props, "mounted", "setMounted"); + useStoreProps(store, props, "animated"); + return Object.assign(store, { disclosure: props.disclosure }); +} +function useDisclosureStore(props = {}) { + const [store, update] = useStore(Core.createDisclosureStore, props); + return useDisclosureStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/BM6PGYQY.js +"use client"; + + + +// src/dialog/dialog-store.ts + +function useDialogStoreProps(store, update, props) { + return useDisclosureStoreProps(store, update, props); +} +function useDialogStore(props = {}) { + const [store, update] = useStore(Core.createDialogStore, props); + return useDialogStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/O2PQ2652.js +"use client"; + + + + +// src/popover/popover-store.ts + +function usePopoverStoreProps(store, update, props) { + useUpdateEffect(update, [props.popover]); + useStoreProps(store, props, "placement"); + return useDialogStoreProps(store, update, props); +} +function usePopoverStore(props = {}) { + const [store, update] = useStore(Core.createPopoverStore, props); + return usePopoverStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/CYQWQL4J.js +"use client"; + + + + + +// src/collection/collection-store.ts +function getCommonParent(items) { + var _a; + const firstItem = items.find((item) => !!item.element); + const lastItem = [...items].reverse().find((item) => !!item.element); + let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; + while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { + const parent = parentElement; + if (lastItem && parent.contains(lastItem.element)) { + return parentElement; + } + parentElement = parentElement.parentElement; + } + return getDocument(parentElement).body; +} +function getPrivateStore(store) { + return store == null ? void 0 : store.__unstablePrivateStore; +} +function createCollectionStore(props = {}) { + var _a; + throwOnConflictingProps(props, props.store); + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const items = defaultValue( + props.items, + syncState == null ? void 0 : syncState.items, + props.defaultItems, + [] + ); + const itemsMap = new Map(items.map((item) => [item.id, item])); + const initialState = { items, - isBusy - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { - ...actionTriggerProps - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { - action: action, - items: items, - closeModal: () => setIsModalOpen(false) - })] - }); -} -function ActionsDropdownMenuGroup({ - actions, - item -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuGroup, { - children: actions.map(action => { - if ('RenderModal' in action) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - items: [item], - ActionTrigger: DropdownMenuItemTrigger - }, action.id); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, { - action: action, - onClick: () => action.callback([item]), - items: [item] - }, action.id); - }) - }); -} -function ItemActions({ - item, - actions, - isCompact -}) { - const { - primaryActions, - eligibleActions - } = (0,external_wp_element_namespaceObject.useMemo)(() => { - // If an action is eligible for all items, doesn't need - // to provide the `isEligible` function. - const _eligibleActions = actions.filter(action => !action.isEligible || action.isEligible(item)); - const _primaryActions = _eligibleActions.filter(action => action.isPrimary && !!action.icon); - return { - primaryActions: _primaryActions, - eligibleActions: _eligibleActions - }; - }, [actions, item]); - if (isCompact) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { - item: item, - actions: eligibleActions - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 1, - justify: "flex-end", - className: "dataviews-item-actions", - style: { - flexShrink: '0', - width: 'auto' - }, - children: [!!primaryActions.length && primaryActions.map(action => { - if ('RenderModal' in action) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - items: [item], - ActionTrigger: ButtonTrigger - }, action.id); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ButtonTrigger, { - action: action, - onClick: () => action.callback([item]), - items: [item] - }, action.id); - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { - item: item, - actions: eligibleActions - })] - }); -} -function CompactItemActions({ - item, - actions -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(item_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - __experimentalIsFocusable: true, - disabled: !actions.length, - className: "dataviews-all-actions-button" - }), - placement: "bottom-end", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { - actions: actions, - item: item - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/utils.js -/** - * Internal dependencies - */ - -function sanitizeOperators(field) { - let operators = field.filterBy?.operators; - - // Assign default values. - if (!operators || !Array.isArray(operators)) { - operators = [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE]; - } - - // Make sure only valid operators are used. - operators = operators.filter(operator => ALL_OPERATORS.includes(operator)); - - // Do not allow mixing single & multiselection operators. - // Remove multiselection operators if any of the single selection ones is present. - if (operators.includes(constants_OPERATOR_IS) || operators.includes(constants_OPERATOR_IS_NOT)) { - operators = operators.filter(operator => [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT].includes(operator)); - } - return operators; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/bulk-actions.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -const { - DropdownMenuV2: bulk_actions_DropdownMenu, - DropdownMenuGroupV2: bulk_actions_DropdownMenuGroup, - DropdownMenuItemV2: bulk_actions_DropdownMenuItem, - DropdownMenuSeparatorV2: DropdownMenuSeparator -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function useHasAPossibleBulkAction(actions, item) { - return (0,external_wp_element_namespaceObject.useMemo)(() => { - return actions.some(action => { - return action.supportsBulk && (!action.isEligible || action.isEligible(item)); - }); - }, [actions, item]); -} -function useSomeItemHasAPossibleBulkAction(actions, data) { - return (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.some(item => { - return actions.some(action => { - return action.supportsBulk && (!action.isEligible || action.isEligible(item)); - }); - }); - }, [actions, data]); -} -function bulk_actions_ActionWithModal({ - action, - selectedItems, - setActionWithModal, - onMenuOpenChange -}) { - const eligibleItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return selectedItems.filter(item => !action.isEligible || action.isEligible(item)); - }, [action, selectedItems]); - const { - RenderModal, - hideModalHeader - } = action; - const onCloseModal = (0,external_wp_element_namespaceObject.useCallback)(() => { - setActionWithModal(undefined); - }, [setActionWithModal]); - if (!eligibleItems.length) { - return null; - } - const label = typeof action.label === 'string' ? action.label : action.label(selectedItems); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: !hideModalHeader ? label : undefined, - __experimentalHideHeader: !!hideModalHeader, - onRequestClose: onCloseModal, - overlayClassName: "dataviews-action-modal", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderModal, { - items: eligibleItems, - closeModal: onCloseModal, - onActionPerformed: () => onMenuOpenChange(false) - }) - }); -} -function BulkActionItem({ - action, - selectedItems, - setActionWithModal -}) { - const eligibleItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return selectedItems.filter(item => !action.isEligible || action.isEligible(item)); - }, [action, selectedItems]); - const shouldShowModal = ('RenderModal' in action); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bulk_actions_DropdownMenuItem, { - disabled: eligibleItems.length === 0, - hideOnClick: !shouldShowModal, - onClick: async () => { - if (shouldShowModal) { - setActionWithModal(action); - } else { - await action.callback(eligibleItems); - } - }, - suffix: eligibleItems.length > 0 ? eligibleItems.length : undefined, - children: action.label - }, action.id); -} -function ActionsMenuGroup({ - actions, - selectedItems, - setActionWithModal -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bulk_actions_DropdownMenuGroup, { - children: actions.map(action => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkActionItem, { - action: action, - selectedItems: selectedItems, - setActionWithModal: setActionWithModal - }, action.id)) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuSeparator, {})] - }); -} -function BulkActions({ - data, - actions, - selection, - onSelectionChange, - getItemId -}) { - const bulkActions = (0,external_wp_element_namespaceObject.useMemo)(() => actions.filter(action => action.supportsBulk), [actions]); - const [isMenuOpen, onMenuOpenChange] = (0,external_wp_element_namespaceObject.useState)(false); - const [actionWithModal, setActionWithModal] = (0,external_wp_element_namespaceObject.useState)(); - const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.filter(item => { - return bulkActions.some(action => !action.isEligible || action.isEligible(item)); - }); - }, [data, bulkActions]); - const numberSelectableItems = selectableItems.length; - const selectedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.filter(item => selection.includes(getItemId(item)) && selectableItems.includes(item)); - }, [selection, data, getItemId, selectableItems]); - const areAllSelected = selectedItems.length === numberSelectableItems; - if (bulkActions.length === 0) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(bulk_actions_DropdownMenu, { - open: isMenuOpen, - onOpenChange: onMenuOpenChange, - label: (0,external_wp_i18n_namespaceObject.__)('Bulk actions'), - style: { - minWidth: '240px' - }, - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - className: "dataviews-bulk-edit-button", - __next40pxDefaultSize: true, - variant: "tertiary", - size: "compact", - children: selectedItems.length ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of items. */ - (0,external_wp_i18n_namespaceObject._n)('Edit %d item', 'Edit %d items', selectedItems.length), selectedItems.length) : (0,external_wp_i18n_namespaceObject.__)('Bulk edit') - }), - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsMenuGroup, { - actions: bulkActions, - setActionWithModal: setActionWithModal, - selectedItems: selectedItems - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(bulk_actions_DropdownMenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bulk_actions_DropdownMenuItem, { - disabled: areAllSelected, - hideOnClick: false, - onClick: () => { - onSelectionChange(selectableItems); - }, - suffix: numberSelectableItems, - children: (0,external_wp_i18n_namespaceObject.__)('Select all') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bulk_actions_DropdownMenuItem, { - disabled: selection.length === 0, - hideOnClick: false, - onClick: () => { - onSelectionChange([]); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Deselect') - })] - })] - }), actionWithModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bulk_actions_ActionWithModal, { - action: actionWithModal, - selectedItems: selectedItems, - setActionWithModal: setActionWithModal, - onMenuOpenChange: onMenuOpenChange - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/view-table.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -const { - DropdownMenuV2: view_table_DropdownMenu, - DropdownMenuGroupV2: view_table_DropdownMenuGroup, - DropdownMenuItemV2: view_table_DropdownMenuItem, - DropdownMenuRadioItemV2: DropdownMenuRadioItem, - DropdownMenuItemLabelV2: view_table_DropdownMenuItemLabel, - DropdownMenuSeparatorV2: view_table_DropdownMenuSeparator -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function WithDropDownMenuSeparators({ - children -}) { - return external_wp_element_namespaceObject.Children.toArray(children).filter(Boolean).map((child, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { - children: [i > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuSeparator, {}), child] - }, i)); -} -const _HeaderMenu = (0,external_wp_element_namespaceObject.forwardRef)(function HeaderMenu({ - field, - view, - onChangeView, - onHide, - setOpenedFilter -}, ref) { - const isHidable = field.enableHiding !== false; - const isSortable = field.enableSorting !== false; - const isSorted = view.sort?.field === field.id; - const operators = sanitizeOperators(field); - // Filter can be added: - // 1. If the field is not already part of a view's filters. - // 2. If the field meets the type and operator requirements. - // 3. If it's not primary. If it is, it should be already visible. - const canAddFilter = !view.filters?.some(_filter => field.id === _filter.field) && !!field.elements?.length && !!operators.length && !field.filterBy?.isPrimary; - if (!isSortable && !isHidable && !canAddFilter) { - return field.header; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenu, { - align: "start", - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { - size: "compact", - className: "dataviews-view-table-header-button", - ref: ref, - variant: "tertiary", - children: [field.header, view.sort && isSorted && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - "aria-hidden": "true", - children: sortArrows[view.sort.direction] - })] - }), - style: { - minWidth: '240px' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithDropDownMenuSeparators, { - children: [isSortable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuGroup, { - children: SORTING_DIRECTIONS.map(direction => { - const isChecked = view.sort && isSorted && view.sort.direction === direction; - const value = `${field.id}-${direction}`; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuRadioItem, { - // All sorting radio items share the same name, so that - // selecting a sorting option automatically deselects the - // previously selected one, even if it is displayed in - // another submenu. The field and direction are passed via - // the `value` prop. - name: "view-table-sorting", - value: value, - checked: isChecked, - onChange: () => { - onChangeView({ - ...view, - sort: { - field: field.id, - direction - } - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuItemLabel, { - children: sortLabels[direction] - }) - }, value); - }) - }), canAddFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuGroup, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuItem, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: library_funnel - }), - onClick: () => { - setOpenedFilter(field.id); - onChangeView({ - ...view, - page: 1, - filters: [...(view.filters || []), { - field: field.id, - value: undefined, - operator: operators[0] - }] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Add filter') - }) - }) - }), isHidable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuItem, { - prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: library_unseen - }), - onClick: () => { - onHide(field); - onChangeView({ - ...view, - hiddenFields: view.hiddenFields.concat(field.id) - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_table_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Hide') - }) - })] - }) - }); -}); - -// @ts-expect-error Lift the `Item` type argument through the forwardRef. -const HeaderMenu = _HeaderMenu; -function BulkSelectionCheckbox({ - selection, - onSelectionChange, - data, - actions, - getItemId -}) { - const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.filter(item => { - return actions.some(action => action.supportsBulk && (!action.isEligible || action.isEligible(item))); - }); - }, [data, actions]); - const selectedItems = data.filter(item => selection.includes(getItemId(item)) && selectableItems.includes(item)); - const areAllSelected = selectedItems.length === selectableItems.length; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { - className: "dataviews-view-table-selection-checkbox", - __nextHasNoMarginBottom: true, - checked: areAllSelected, - indeterminate: !areAllSelected && !!selectedItems.length, - onChange: () => { - if (areAllSelected) { - onSelectionChange([]); + renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) + }; + const syncPrivateStore = getPrivateStore(props.store); + const privateStore = createStore( + { items, renderedItems: initialState.renderedItems }, + syncPrivateStore + ); + const collection = createStore(initialState, props.store); + const sortItems = (renderedItems) => { + const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element); + privateStore.setState("renderedItems", sortedItems); + collection.setState("renderedItems", sortedItems); + }; + setup(collection, () => init(privateStore)); + setup(privateStore, () => { + return batch(privateStore, ["items"], (state) => { + collection.setState("items", state.items); + }); + }); + setup(privateStore, () => { + return batch(privateStore, ["renderedItems"], (state) => { + let firstRun = true; + let raf = requestAnimationFrame(() => { + const { renderedItems } = collection.getState(); + if (state.renderedItems === renderedItems) return; + sortItems(state.renderedItems); + }); + if (typeof IntersectionObserver !== "function") { + return () => cancelAnimationFrame(raf); + } + const ioCallback = () => { + if (firstRun) { + firstRun = false; + return; + } + cancelAnimationFrame(raf); + raf = requestAnimationFrame(() => sortItems(state.renderedItems)); + }; + const root = getCommonParent(state.renderedItems); + const observer = new IntersectionObserver(ioCallback, { root }); + for (const item of state.renderedItems) { + if (!item.element) continue; + observer.observe(item.element); + } + return () => { + cancelAnimationFrame(raf); + observer.disconnect(); + }; + }); + }); + const mergeItem = (item, setItems, canDeleteFromMap = false) => { + let prevItem; + setItems((items2) => { + const index = items2.findIndex(({ id }) => id === item.id); + const nextItems = items2.slice(); + if (index !== -1) { + prevItem = items2[index]; + const nextItem = _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, prevItem), item); + nextItems[index] = nextItem; + itemsMap.set(item.id, nextItem); } else { - onSelectionChange(selectableItems); - } - }, - "aria-label": areAllSelected ? (0,external_wp_i18n_namespaceObject.__)('Deselect all') : (0,external_wp_i18n_namespaceObject.__)('Select all') - }); -} -function TableRow({ - hasBulkActions, - item, - actions, - id, - visibleFields, - primaryField, - selection, - getItemId, - onSelectionChange, - data -}) { - const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item); - const isSelected = hasPossibleBulkAction && selection.includes(id); - const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); - const handleMouseEnter = () => { - setIsHovered(true); - }; - const handleMouseLeave = () => { - setIsHovered(false); - }; - - // Will be set to true if `onTouchStart` fires. This happens before - // `onClick` and can be used to exclude touchscreen devices from certain - // behaviours. - const isTouchDevice = (0,external_wp_element_namespaceObject.useRef)(false); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { - className: dist_clsx('dataviews-view-table__row', { - 'is-selected': hasPossibleBulkAction && isSelected, - 'is-hovered': isHovered, - 'has-bulk-actions': hasPossibleBulkAction - }), - onMouseEnter: handleMouseEnter, - onMouseLeave: handleMouseLeave, - onTouchStart: () => { - isTouchDevice.current = true; - }, - onClick: () => { - if (!hasPossibleBulkAction) { - return; - } - if (!isTouchDevice.current && document.getSelection()?.type !== 'Range') { - if (!isSelected) { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId === id || selection.includes(itemId); - })); - } else { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId !== id && selection.includes(itemId); - })); - } - } - }, - children: [hasBulkActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { - className: "dataviews-view-table__checkbox-column", - style: { - width: '1%' - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-table__cell-content-wrapper", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleSelectionCheckbox, { - item: item, - selection: selection, - onSelectionChange: onSelectionChange, - getItemId: getItemId, - data: data, - primaryField: primaryField, - disabled: !hasPossibleBulkAction - }) - }) - }), visibleFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { - style: { - width: field.width || undefined, - minWidth: field.minWidth || undefined, - maxWidth: field.maxWidth || undefined - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('dataviews-view-table__cell-content-wrapper', { - 'dataviews-view-table__primary-field': primaryField?.id === field.id - }), - children: field.render({ - item - }) - }) - }, field.id)), !!actions?.length && - /*#__PURE__*/ - // Disable reason: we are not making the element interactive, - // but preventing any click events from bubbling up to the - // table row. This allows us to add a click handler to the row - // itself (to toggle row selection) without erroneously - // intercepting click events from ItemActions. - /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ - (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { - className: "dataviews-view-table__actions-column", - onClick: e => e.stopPropagation(), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { - item: item, - actions: actions - }) - }) - /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */] - }); -} -function ViewTable({ - actions, - data, - fields, - getItemId, - isLoading = false, - onChangeView, - onSelectionChange, - selection, - setOpenedFilter, - view -}) { - const headerMenuRefs = (0,external_wp_element_namespaceObject.useRef)(new Map()); - const headerMenuToFocusRef = (0,external_wp_element_namespaceObject.useRef)(); - const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,external_wp_element_namespaceObject.useState)(); - const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (headerMenuToFocusRef.current) { - headerMenuToFocusRef.current.focus(); - headerMenuToFocusRef.current = undefined; - } - }); - const tableNoticeId = (0,external_wp_element_namespaceObject.useId)(); - if (nextHeaderMenuToFocus) { - // If we need to force focus, we short-circuit rendering here - // to prevent any additional work while we handle that. - // Clearing out the focus directive is necessary to make sure - // future renders don't cause unexpected focus jumps. - headerMenuToFocusRef.current = nextHeaderMenuToFocus; - setNextHeaderMenuToFocus(undefined); - return; - } - const onHide = field => { - const hidden = headerMenuRefs.current.get(field.id); - const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : undefined; - setNextHeaderMenuToFocus(fallback?.node); - }; - const visibleFields = fields.filter(field => !view.hiddenFields.includes(field.id) && ![view.layout.mediaField].includes(field.id)); - const hasData = !!data?.length; - const primaryField = fields.find(field => field.id === view.layout.primaryField); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { - className: "dataviews-view-table", - "aria-busy": isLoading, - "aria-describedby": tableNoticeId, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("thead", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { - className: "dataviews-view-table__row", - children: [hasBulkActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { - className: "dataviews-view-table__checkbox-column", - style: { - width: '1%' - }, - "data-field-id": "selection", - scope: "col", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkSelectionCheckbox, { - selection: selection, - onSelectionChange: onSelectionChange, - data: data, - actions: actions, - getItemId: getItemId - }) - }), visibleFields.map((field, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { - style: { - width: field.width || undefined, - minWidth: field.minWidth || undefined, - maxWidth: field.maxWidth || undefined - }, - "data-field-id": field.id, - "aria-sort": view.sort?.field === field.id ? sortValues[view.sort.direction] : undefined, - scope: "col", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HeaderMenu, { - ref: node => { - if (node) { - headerMenuRefs.current.set(field.id, { - node, - fallback: visibleFields[index > 0 ? index - 1 : 1]?.id - }); - } else { - headerMenuRefs.current.delete(field.id); - } - }, - field: field, - view: view, - onChangeView: onChangeView, - onHide: onHide, - setOpenedFilter: setOpenedFilter - }) - }, field.id)), !!actions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { - "data-field-id": "actions", - className: "dataviews-view-table__actions-column", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-view-table-header", - children: (0,external_wp_i18n_namespaceObject.__)('Actions') - }) - })] - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", { - children: hasData && data.map((item, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableRow, { - item: item, - hasBulkActions: hasBulkActions, - actions: actions, - id: getItemId(item) || index.toString(), - visibleFields: visibleFields, - primaryField: primaryField, - selection: selection, - getItemId: getItemId, - onSelectionChange: onSelectionChange, - data: data - }, getItemId(item))) - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx({ - 'dataviews-loading': isLoading, - 'dataviews-no-results': !hasData && !isLoading - }), - id: tableNoticeId, - children: !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') - }) - })] - }); -} -/* harmony default export */ const view_table = (ViewTable); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/view-grid.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -function GridItem({ - selection, - data, - onSelectionChange, - getItemId, - item, - actions, - mediaField, - primaryField, - visibleFields, - badgeFields, - columnFields -}) { - const hasBulkAction = useHasAPossibleBulkAction(actions, item); - const id = getItemId(item); - const isSelected = selection.includes(id); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 0, - className: dist_clsx('dataviews-view-grid__card', { - 'is-selected': hasBulkAction && isSelected - }), - onClickCapture: event => { - if (event.ctrlKey || event.metaKey) { - event.stopPropagation(); - event.preventDefault(); - if (!hasBulkAction) { - return; - } - if (!isSelected) { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId === id || selection.includes(itemId); - })); - } else { - onSelectionChange(data.filter(_item => { - const itemId = getItemId?.(_item); - return itemId !== id && selection.includes(itemId); - })); - } - } - }, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-grid__media", - children: mediaField?.render({ - item - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "space-between", - className: "dataviews-view-grid__title-actions", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleSelectionCheckbox, { - item: item, - selection: selection, - onSelectionChange: onSelectionChange, - getItemId: getItemId, - data: data, - primaryField: primaryField, - disabled: !hasBulkAction - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "dataviews-view-grid__primary-field", - children: primaryField?.render({ - item - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { - item: item, - actions: actions, - isCompact: true - })] - }), !!badgeFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "dataviews-view-grid__badge-fields", - spacing: 2, - wrap: true, - alignment: "top", - justify: "flex-start", - children: badgeFields.map(field => { - const renderedValue = field.render({ - item - }); - if (!renderedValue) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-value", - children: renderedValue - }, field.id); - }) - }), !!visibleFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "dataviews-view-grid__fields", - spacing: 3, - children: visibleFields.map(field => { - const renderedValue = field.render({ - item - }); - if (!renderedValue) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { - className: dist_clsx('dataviews-view-grid__field', columnFields?.includes(field.id) ? 'is-column' : 'is-row'), - gap: 1, - justify: "flex-start", - expanded: true, - style: { - height: 'auto' - }, - direction: columnFields?.includes(field.id) ? 'column' : 'row', - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-name", - children: field.header - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-view-grid__field-value", - style: { - maxHeight: 'none' - }, - children: renderedValue - })] - }) - }, field.id); - }) - })] - }, id); -} -function ViewGrid({ - actions, - data, - fields, - getItemId, - isLoading, - onSelectionChange, - selection, - view -}) { - const mediaField = fields.find(field => field.id === view.layout.mediaField); - const primaryField = fields.find(field => field.id === view.layout.primaryField); - const { - visibleFields, - badgeFields - } = fields.reduce((accumulator, field) => { - if (view.hiddenFields.includes(field.id) || [view.layout.mediaField, view.layout.primaryField].includes(field.id)) { - return accumulator; - } - // If the field is a badge field, add it to the badgeFields array - // otherwise add it to the rest visibleFields array. - const key = view.layout.badgeFields?.includes(field.id) ? 'badgeFields' : 'visibleFields'; - accumulator[key].push(field); - return accumulator; - }, { - visibleFields: [], - badgeFields: [] - }); - const hasData = !!data?.length; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { - gap: 8, - columns: 2, - alignment: "top", - className: "dataviews-view-grid", - "aria-busy": isLoading, - children: data.map(item => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItem, { - selection: selection, - data: data, - onSelectionChange: onSelectionChange, - getItemId: getItemId, - item: item, - actions: actions, - mediaField: mediaField, - primaryField: primaryField, - visibleFields: visibleFields, - badgeFields: badgeFields, - columnFields: view.layout.columnFields - }, getItemId(item)); - }) - }), !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx({ - 'dataviews-loading': isLoading, - 'dataviews-no-results': !isLoading - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') - }) - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/view-list.js -/** - * External dependencies - */ - -// Import CompositeStore type, which is not exported from @wordpress/components. -// eslint-disable-next-line no-restricted-imports - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -const { - useCompositeStoreV2: view_list_useCompositeStore, - CompositeV2: view_list_Composite, - CompositeItemV2: view_list_CompositeItem, - CompositeRowV2: CompositeRow, - DropdownMenuV2: view_list_DropdownMenu -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function ListItem({ - actions, - id, - isSelected, - item, - mediaField, - onSelect, - primaryField, - store, - visibleFields -}) { - const itemRef = (0,external_wp_element_namespaceObject.useRef)(null); - const labelId = `${id}-label`; - const descriptionId = `${id}-description`; - const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); - const handleMouseEnter = () => { - setIsHovered(true); - }; - const handleMouseLeave = () => { - setIsHovered(false); - }; - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (isSelected) { - itemRef.current?.scrollIntoView({ - behavior: 'auto', - block: 'nearest', - inline: 'nearest' - }); - } - }, [isSelected]); - const { - primaryAction, - eligibleActions - } = (0,external_wp_element_namespaceObject.useMemo)(() => { - // If an action is eligible for all items, doesn't need - // to provide the `isEligible` function. - const _eligibleActions = actions.filter(action => !action.isEligible || action.isEligible(item)); - const _primaryActions = _eligibleActions.filter(action => action.isPrimary && !!action.icon); - return { - primaryAction: _primaryActions?.[0], - eligibleActions: _eligibleActions - }; - }, [actions, item]); - const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const primaryActionLabel = primaryAction && (typeof primaryAction.label === 'string' ? primaryAction.label : primaryAction.label([item])); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRow, { - ref: itemRef, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", {}), - role: "row", - className: dist_clsx({ - 'is-selected': isSelected, - 'is-hovered': isHovered - }), - onMouseEnter: handleMouseEnter, - onMouseLeave: handleMouseLeave, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "dataviews-view-list__item-wrapper", - alignment: "center", - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_CompositeItem, { - store: store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), - role: "button", - id: id, - "aria-pressed": isSelected, - "aria-labelledby": labelId, - "aria-describedby": descriptionId, - className: "dataviews-view-list__item", - onClick: () => onSelect(item), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 3, - justify: "start", - alignment: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__media-wrapper", - children: mediaField?.render({ - item - }) || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__media-placeholder" - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-view-list__primary-field", - id: labelId, - children: primaryField?.render({ - item - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-view-list__fields", - id: descriptionId, - children: visibleFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "dataviews-view-list__field", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { - as: "span", - className: "dataviews-view-list__field-label", - children: field.header - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-view-list__field-value", - children: field.render({ - item - }) - })] - }, field.id)) - })] - })] - }) - }) - }), eligibleActions?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 1, - justify: "flex-end", - className: "dataviews-view-list__item-actions", - style: { - flexShrink: '0', - width: 'auto' - }, - children: [primaryAction && 'RenderModal' in primaryAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_CompositeItem, { - store: store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: primaryActionLabel, - icon: primaryAction.icon, - isDestructive: primaryAction.isDestructive, - size: "compact", - onClick: () => setIsModalOpen(true) - }), - children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { - action: primaryAction, - items: [item], - closeModal: () => setIsModalOpen(false) - }) - }) - }), primaryAction && !('RenderModal' in primaryAction) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_CompositeItem, { - store: store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - label: primaryActionLabel, - icon: primaryAction.icon, - isDestructive: primaryAction.isDestructive, - size: "compact", - onClick: () => primaryAction.callback([item]) - }) - }) - }, primaryAction.id), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - role: "gridcell", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_CompositeItem, { - store: store, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - __experimentalIsFocusable: true, - disabled: !actions.length, - onKeyDown: event => { - if (event.key === 'ArrowDown') { - // Prevent the default behaviour (open dropdown menu) and go down. - event.preventDefault(); - store.move(store.down()); - } - if (event.key === 'ArrowUp') { - // Prevent the default behavior (open dropdown menu) and go up. - event.preventDefault(); - store.move(store.up()); - } - } - }) - }), - placement: "bottom-end", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, { - actions: eligibleActions, - item: item - }) - }) - })] - })] - }) - }); -} -function ViewList(props) { - const { - actions, - data, - fields, - getItemId, - isLoading, - onSelectionChange, - selection, - view - } = props; - const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ViewList, 'view-list'); - const selectedItem = data?.findLast(item => selection.includes(getItemId(item))); - const mediaField = fields.find(field => field.id === view.layout.mediaField); - const primaryField = fields.find(field => field.id === view.layout.primaryField); - const visibleFields = fields.filter(field => !view.hiddenFields.includes(field.id) && ![view.layout.primaryField, view.layout.mediaField].includes(field.id)); - const onSelect = (0,external_wp_element_namespaceObject.useCallback)(item => onSelectionChange([item]), [onSelectionChange]); - const getItemDomId = (0,external_wp_element_namespaceObject.useCallback)(item => item ? `${baseId}-${getItemId(item)}` : undefined, [baseId, getItemId]); - const store = view_list_useCompositeStore({ - defaultActiveId: getItemDomId(selectedItem) - }); - - // Manage focused item, when the active one is removed from the list. - const isActiveIdInList = store.useState(state => state.items.some(item => item.id === state.activeId)); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!isActiveIdInList) { - // Prefer going down, except if there is no item below (last item), then go up (last item in list). - if (store.down()) { - store.move(store.down()); - } else if (store.up()) { - store.move(store.up()); - } - } - }, [isActiveIdInList]); - const hasData = data?.length; - if (!hasData) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx({ - 'dataviews-loading': isLoading, - 'dataviews-no-results': !hasData && !isLoading - }), - children: !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') - }) - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_list_Composite, { - id: baseId, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", {}), - className: "dataviews-view-list", - role: "grid", - store: store, - children: data.map(item => { - const id = getItemDomId(item); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListItem, { - id: id, - actions: actions, - item: item, - isSelected: item === selectedItem, - onSelect: onSelect, - mediaField: mediaField, - primaryField: primaryField, - store: store, - visibleFields: visibleFields - }, id); - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/layouts.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -const VIEW_LAYOUTS = [{ - type: constants_LAYOUT_TABLE, - label: (0,external_wp_i18n_namespaceObject.__)('Table'), - component: view_table, - icon: block_table -}, { - type: constants_LAYOUT_GRID, - label: (0,external_wp_i18n_namespaceObject.__)('Grid'), - component: ViewGrid, - icon: library_category -}, { - type: constants_LAYOUT_LIST, - label: (0,external_wp_i18n_namespaceObject.__)('List'), - component: ViewList, - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets -}]; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/view-actions.js -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - - -const { - DropdownMenuV2: view_actions_DropdownMenu, - DropdownMenuGroupV2: view_actions_DropdownMenuGroup, - DropdownMenuItemV2: view_actions_DropdownMenuItem, - DropdownMenuRadioItemV2: view_actions_DropdownMenuRadioItem, - DropdownMenuCheckboxItemV2: DropdownMenuCheckboxItem, - DropdownMenuItemLabelV2: view_actions_DropdownMenuItemLabel -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); -function ViewTypeMenu({ - view, - onChangeView, - supportedLayouts -}) { - let _availableViews = VIEW_LAYOUTS; - if (supportedLayouts) { - _availableViews = _availableViews.filter(_view => supportedLayouts.includes(_view.type)); - } - if (_availableViews.length === 1) { - return null; - } - const activeView = _availableViews.find(v => view.type === v.type); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItem, { - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - "aria-hidden": "true", - children: activeView?.label - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Layout') - }) - }), - children: _availableViews.map(availableView => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuRadioItem, { - value: availableView.type, - name: "view-actions-available-view", - checked: availableView.type === view.type, - hideOnClick: true, - onChange: e => { - switch (e.target.value) { - case 'list': - case 'grid': - case 'table': - return onChangeView({ - ...view, - type: e.target.value, - layout: {} - }); - } - throw new Error('Invalid dataview'); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: availableView.label - }) - }, availableView.type); - }) - }); -} -const PAGE_SIZE_VALUES = [10, 20, 50, 100]; -function PageSizeMenu({ - view, - onChangeView -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItem, { - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - "aria-hidden": "true", - children: view.perPage - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Items per page') - }) - }), - children: PAGE_SIZE_VALUES.map(size => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuRadioItem, { - value: size, - name: "view-actions-page-size", - checked: view.perPage === size, - onChange: () => { - onChangeView({ - ...view, - // `e.target.value` holds the same value as `size` but as a string, - // so we use `size` directly to avoid parsing to int. - perPage: size, - page: 1 - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: size - }) - }, size); - }) - }); -} -function FieldsVisibilityMenu({ - view, - onChangeView, - fields -}) { - const hidableFields = fields.filter(field => field.enableHiding !== false && field.id !== view.layout.mediaField); - if (!hidableFields?.length) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Fields') - }) - }), - children: hidableFields?.map(field => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuCheckboxItem, { - value: field.id, - checked: !view.hiddenFields?.includes(field.id), - onChange: () => { - onChangeView({ - ...view, - hiddenFields: view.hiddenFields?.includes(field.id) ? view.hiddenFields.filter(id => id !== field.id) : [...(view.hiddenFields || []), field.id] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: field.header - }) - }, field.id); - }) - }); -} -function SortMenu({ - fields, - view, - onChangeView -}) { - const sortableFields = fields.filter(field => field.enableSorting !== false); - if (!sortableFields?.length) { - return null; - } - const currentSortedField = fields.find(field => field.id === view.sort?.field); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItem, { - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - "aria-hidden": "true", - children: currentSortedField?.header - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Sort by') - }) - }), - children: sortableFields?.map(field => { - const sortedDirection = view.sort?.direction; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItem, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: field.header - }) - }), - style: { - minWidth: '220px' - }, - children: SORTING_DIRECTIONS.map(direction => { - const isChecked = currentSortedField !== undefined && sortedDirection === direction && field.id === currentSortedField.id; - const value = `${field.id}-${direction}`; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuRadioItem, { - // All sorting radio items share the same name, so that - // selecting a sorting option automatically deselects the - // previously selected one, even if it is displayed in - // another submenu. The field and direction are passed via - // the `value` prop. - name: "view-actions-sorting", - value: value, - checked: isChecked, - onChange: () => { - onChangeView({ - ...view, - sort: { - field: field.id, - direction - } - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenuItemLabel, { - children: sortLabels[direction] - }) - }, value); - }) - }, field.id); - }) - }); -} -function _ViewActions({ - fields, - view, - onChangeView, - supportedLayouts -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - size: "compact", - icon: library_settings, - label: (0,external_wp_i18n_namespaceObject.__)('View options') - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(view_actions_DropdownMenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewTypeMenu, { - view: view, - onChangeView: onChangeView, - supportedLayouts: supportedLayouts - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortMenu, { - fields: fields, - view: view, - onChangeView: onChangeView - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldsVisibilityMenu, { - fields: fields, - view: view, - onChangeView: onChangeView - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageSizeMenu, { - view: view, - onChangeView: onChangeView - })] - }) - }); -} - -// A type assertion is used here to keep the type argument. -const ViewActions = (0,external_wp_element_namespaceObject.memo)(_ViewActions); -/* harmony default export */ const view_actions = (ViewActions); - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3IEDWLST.js -"use client"; - -// src/composite/utils.ts - + nextItems.push(item); + itemsMap.set(item.id, item); + } + return nextItems; + }); + const unmergeItem = () => { + setItems((items2) => { + if (!prevItem) { + if (canDeleteFromMap) { + itemsMap.delete(item.id); + } + return items2.filter(({ id }) => id !== item.id); + } + const index = items2.findIndex(({ id }) => id === item.id); + if (index === -1) return items2; + const nextItems = items2.slice(); + nextItems[index] = prevItem; + itemsMap.set(item.id, prevItem); + return nextItems; + }); + }; + return unmergeItem; + }; + const registerItem = (item) => mergeItem( + item, + (getItems) => privateStore.setState("items", getItems), + true + ); + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection), { + registerItem, + renderItem: (item) => chain( + registerItem(item), + mergeItem( + item, + (getItems) => privateStore.setState("renderedItems", getItems) + ) + ), + item: (id) => { + if (!id) return null; + let item = itemsMap.get(id); + if (!item) { + const { items: items2 } = privateStore.getState(); + item = items2.find((item2) => item2.id === id); + if (item) { + itemsMap.set(id, item); + } + } + return item || null; + }, + // @ts-expect-error Internal + __unstablePrivateStore: privateStore + }); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js +"use client"; + +// src/utils/array.ts +function toArray(arg) { + if (Array.isArray(arg)) { + return arg; + } + return typeof arg !== "undefined" ? [arg] : []; +} +function addItemToArray(array, item, index = -1) { + if (!(index in array)) { + return [...array, item]; + } + return [...array.slice(0, index), item, ...array.slice(index)]; +} +function flatten2DArray(array) { + const flattened = []; + for (const row of array) { + flattened.push(...row); + } + return flattened; +} +function reverseArray(array) { + return array.slice().reverse(); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/AJZ4BYF3.js +"use client"; + + + + + + +// src/composite/composite-store.ts var NULL_ITEM = { id: null }; +function findFirstEnabledItem(items, excludeId) { + return items.find((item) => { + if (excludeId) { + return !item.disabled && item.id !== excludeId; + } + return !item.disabled; + }); +} +function getEnabledItems(items, excludeId) { + return items.filter((item) => { + if (excludeId) { + return !item.disabled && item.id !== excludeId; + } + return !item.disabled; + }); +} +function getItemsInRow(items, rowId) { + return items.filter((item) => item.rowId === rowId); +} function flipItems(items, activeId, shouldInsertNullItem = false) { const index = items.findIndex((item) => item.id === activeId); return [ @@ -26437,7 +29896,746 @@ ...items.slice(0, index) ]; } -function findFirstEnabledItem(items, excludeId) { +function groupItemsByRows(items) { + const rows = []; + for (const item of items) { + const row = rows.find((currentRow) => { + var _a; + return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; + }); + if (row) { + row.push(item); + } else { + rows.push([item]); + } + } + return rows; +} +function getMaxRowLength(array) { + let maxLength = 0; + for (const { length } of array) { + if (length > maxLength) { + maxLength = length; + } + } + return maxLength; +} +function createEmptyItem(rowId) { + return { + id: "__EMPTY_ITEM__", + disabled: true, + rowId + }; +} +function normalizeRows(rows, activeId, focusShift) { + const maxLength = getMaxRowLength(rows); + for (const row of rows) { + for (let i = 0; i < maxLength; i += 1) { + const item = row[i]; + if (!item || focusShift && item.disabled) { + const isFirst = i === 0; + const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1]; + row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); + } + } + } + return rows; +} +function verticalizeItems(items) { + const rows = groupItemsByRows(items); + const maxLength = getMaxRowLength(rows); + const verticalized = []; + for (let i = 0; i < maxLength; i += 1) { + for (const row of rows) { + const item = row[i]; + if (item) { + verticalized.push(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, item), { + // If there's no rowId, it means that it's not a grid composite, but + // a single row instead. So, instead of verticalizing it, that is, + // assigning a different rowId based on the column index, we keep it + // undefined so they will be part of the same row. This is useful + // when using up/down on one-dimensional composites. + rowId: item.rowId ? `${i}` : void 0 + })); + } + } + } + return verticalized; +} +function createCompositeStore(props = {}) { + var _a; + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const collection = createCollectionStore(props); + const activeId = defaultValue( + props.activeId, + syncState == null ? void 0 : syncState.activeId, + props.defaultActiveId + ); + const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), { + id: defaultValue( + props.id, + syncState == null ? void 0 : syncState.id, + `id-${Math.random().toString(36).slice(2, 8)}` + ), + activeId, + baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), + includesBaseElement: defaultValue( + props.includesBaseElement, + syncState == null ? void 0 : syncState.includesBaseElement, + activeId === null + ), + moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), + orientation: defaultValue( + props.orientation, + syncState == null ? void 0 : syncState.orientation, + "both" + ), + rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), + virtualFocus: defaultValue( + props.virtualFocus, + syncState == null ? void 0 : syncState.virtualFocus, + false + ), + focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), + focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), + focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) + }); + const composite = createStore(initialState, collection, props.store); + setup( + composite, + () => sync(composite, ["renderedItems", "activeId"], (state) => { + composite.setState("activeId", (activeId2) => { + var _a2; + if (activeId2 !== void 0) return activeId2; + return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id; + }); + }) + ); + const getNextId = (direction = "next", options = {}) => { + var _a2, _b; + const defaultState = composite.getState(); + const { + skip = 0, + activeId: activeId2 = defaultState.activeId, + focusShift = defaultState.focusShift, + focusLoop = defaultState.focusLoop, + focusWrap = defaultState.focusWrap, + includesBaseElement = defaultState.includesBaseElement, + renderedItems = defaultState.renderedItems, + rtl = defaultState.rtl + } = options; + const isVerticalDirection = direction === "up" || direction === "down"; + const isNextDirection = direction === "next" || direction === "down"; + const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection; + const canShift = focusShift && !skip; + let items = !isVerticalDirection ? renderedItems : flatten2DArray( + normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift) + ); + items = canReverse ? reverseArray(items) : items; + items = isVerticalDirection ? verticalizeItems(items) : items; + if (activeId2 == null) { + return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id; + } + const activeItem = items.find((item) => item.id === activeId2); + if (!activeItem) { + return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id; + } + const isGrid = items.some((item) => item.rowId); + const activeIndex = items.indexOf(activeItem); + const nextItems = items.slice(activeIndex + 1); + const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); + if (skip) { + const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); + const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. + nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; + return nextItem2 == null ? void 0 : nextItem2.id; + } + const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical"); + const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical"); + const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false; + if (canLoop) { + const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId); + const sortedItems = flipItems(loopItems, activeId2, hasNullItem); + const nextItem2 = findFirstEnabledItem(sortedItems, activeId2); + return nextItem2 == null ? void 0 : nextItem2.id; + } + if (canWrap) { + const nextItem2 = findFirstEnabledItem( + // We can use nextItems, which contains all the next items, including + // items from other rows, to wrap between rows. However, if there is a + // null item (the composite container), we'll only use the next items in + // the row. So moving next from the last item will focus on the + // composite container. On grid composites, horizontal navigation never + // focuses on the composite container, only vertical. + hasNullItem ? nextItemsInRow : nextItems, + activeId2 + ); + const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; + return nextId; + } + const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2); + if (!nextItem && hasNullItem) { + return null; + } + return nextItem == null ? void 0 : nextItem.id; + }; + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, collection), composite), { + setBaseElement: (element) => composite.setState("baseElement", element), + setActiveId: (id) => composite.setState("activeId", id), + move: (id) => { + if (id === void 0) return; + composite.setState("activeId", id); + composite.setState("moves", (moves) => moves + 1); + }, + first: () => { + var _a2; + return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id; + }, + last: () => { + var _a2; + return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; + }, + next: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("next", options); + }, + previous: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("previous", options); + }, + down: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("down", options); + }, + up: (options) => { + if (options !== void 0 && typeof options === "number") { + options = { skip: options }; + } + return getNextId("up", options); + } + }); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/RCQ5P4YE.js +"use client"; + + + + +// src/disclosure/disclosure-store.ts +function createDisclosureStore(props = {}) { + const store = mergeStore( + props.store, + omit2(props.disclosure, ["contentElement", "disclosureElement"]) + ); + throwOnConflictingProps(props, store); + const syncState = store == null ? void 0 : store.getState(); + const open = defaultValue( + props.open, + syncState == null ? void 0 : syncState.open, + props.defaultOpen, + false + ); + const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); + const initialState = { + open, + animated, + animating: !!animated && open, + mounted: open, + contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), + disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) + }; + const disclosure = createStore(initialState, store); + setup( + disclosure, + () => sync(disclosure, ["animated", "animating"], (state) => { + if (state.animated) return; + disclosure.setState("animating", false); + }) + ); + setup( + disclosure, + () => subscribe(disclosure, ["open"], () => { + if (!disclosure.getState().animated) return; + disclosure.setState("animating", true); + }) + ); + setup( + disclosure, + () => sync(disclosure, ["open", "animating"], (state) => { + disclosure.setState("mounted", state.open || state.animating); + }) + ); + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, disclosure), { + disclosure: props.disclosure, + setOpen: (value) => disclosure.setState("open", value), + show: () => disclosure.setState("open", true), + hide: () => disclosure.setState("open", false), + toggle: () => disclosure.setState("open", (open2) => !open2), + stopAnimation: () => disclosure.setState("animating", false), + setContentElement: (value) => disclosure.setState("contentElement", value), + setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) + }); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/FZZ2AVHF.js +"use client"; + + +// src/dialog/dialog-store.ts +function createDialogStore(props = {}) { + return createDisclosureStore(props); +} + + + +;// ./node_modules/@ariakit/core/esm/__chunks/ME2CUF3F.js +"use client"; + + + + + +// src/popover/popover-store.ts +function createPopoverStore(_a = {}) { + var _b = _a, { + popover: otherPopover + } = _b, props = _3YLGPPWQ_objRest(_b, [ + "popover" + ]); + const store = mergeStore( + props.store, + omit2(otherPopover, [ + "arrowElement", + "anchorElement", + "contentElement", + "popoverElement", + "disclosureElement" + ]) + ); + throwOnConflictingProps(props, store); + const syncState = store == null ? void 0 : store.getState(); + const dialog = createDialogStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { store })); + const placement = defaultValue( + props.placement, + syncState == null ? void 0 : syncState.placement, + "bottom" + ); + const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, dialog.getState()), { + placement, + currentPlacement: placement, + anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), + popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), + arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), + rendered: Symbol("rendered") + }); + const popover = createStore(initialState, dialog, store); + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, dialog), popover), { + setAnchorElement: (element) => popover.setState("anchorElement", element), + setPopoverElement: (element) => popover.setState("popoverElement", element), + setArrowElement: (element) => popover.setState("arrowElement", element), + render: () => popover.setState("rendered", Symbol("rendered")) + }); +} + + + +;// ./node_modules/@ariakit/core/esm/combobox/combobox-store.js +"use client"; + + + + + + + + + + + + +// src/combobox/combobox-store.ts +var isTouchSafari = isSafari() && isTouchDevice(); +function createComboboxStore(_a = {}) { + var _b = _a, { + tag + } = _b, props = _3YLGPPWQ_objRest(_b, [ + "tag" + ]); + const store = mergeStore(props.store, pick2(tag, ["value", "rtl"])); + throwOnConflictingProps(props, store); + const tagState = tag == null ? void 0 : tag.getState(); + const syncState = store == null ? void 0 : store.getState(); + const activeId = defaultValue( + props.activeId, + syncState == null ? void 0 : syncState.activeId, + props.defaultActiveId, + null + ); + const composite = createCompositeStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { + activeId, + includesBaseElement: defaultValue( + props.includesBaseElement, + syncState == null ? void 0 : syncState.includesBaseElement, + true + ), + orientation: defaultValue( + props.orientation, + syncState == null ? void 0 : syncState.orientation, + "vertical" + ), + focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true), + focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true), + virtualFocus: defaultValue( + props.virtualFocus, + syncState == null ? void 0 : syncState.virtualFocus, + true + ) + })); + const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { + placement: defaultValue( + props.placement, + syncState == null ? void 0 : syncState.placement, + "bottom-start" + ) + })); + const value = defaultValue( + props.value, + syncState == null ? void 0 : syncState.value, + props.defaultValue, + "" + ); + const selectedValue = defaultValue( + props.selectedValue, + syncState == null ? void 0 : syncState.selectedValue, + tagState == null ? void 0 : tagState.values, + props.defaultSelectedValue, + "" + ); + const multiSelectable = Array.isArray(selectedValue); + const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, composite.getState()), popover.getState()), { + value, + selectedValue, + resetValueOnSelect: defaultValue( + props.resetValueOnSelect, + syncState == null ? void 0 : syncState.resetValueOnSelect, + multiSelectable + ), + resetValueOnHide: defaultValue( + props.resetValueOnHide, + syncState == null ? void 0 : syncState.resetValueOnHide, + multiSelectable && !tag + ), + activeValue: syncState == null ? void 0 : syncState.activeValue + }); + const combobox = createStore(initialState, composite, popover, store); + if (isTouchSafari) { + setup( + combobox, + () => sync(combobox, ["virtualFocus"], () => { + combobox.setState("virtualFocus", false); + }) + ); + } + setup(combobox, () => { + if (!tag) return; + return chain( + sync(combobox, ["selectedValue"], (state) => { + if (!Array.isArray(state.selectedValue)) return; + tag.setValues(state.selectedValue); + }), + sync(tag, ["values"], (state) => { + combobox.setState("selectedValue", state.values); + }) + ); + }); + setup( + combobox, + () => sync(combobox, ["resetValueOnHide", "mounted"], (state) => { + if (!state.resetValueOnHide) return; + if (state.mounted) return; + combobox.setState("value", value); + }) + ); + setup( + combobox, + () => sync(combobox, ["open"], (state) => { + if (state.open) return; + combobox.setState("activeId", activeId); + combobox.setState("moves", 0); + }) + ); + setup( + combobox, + () => sync(combobox, ["moves", "activeId"], (state, prevState) => { + if (state.moves === prevState.moves) { + combobox.setState("activeValue", void 0); + } + }) + ); + setup( + combobox, + () => batch(combobox, ["moves", "renderedItems"], (state, prev) => { + if (state.moves === prev.moves) return; + const { activeId: activeId2 } = combobox.getState(); + const activeItem = composite.item(activeId2); + combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value); + }) + ); + return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, popover), composite), combobox), { + tag, + setValue: (value2) => combobox.setState("value", value2), + resetValue: () => combobox.setState("value", initialState.value), + setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2) + }); +} + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/FEOFMWBY.js +"use client"; + + + + + + + +// src/combobox/combobox-store.ts + +function useComboboxStoreOptions(props) { + const tag = useTagContext(); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { + tag: props.tag !== void 0 ? props.tag : tag + }); + return useCompositeStoreOptions(props); +} +function useComboboxStoreProps(store, update, props) { + useUpdateEffect(update, [props.tag]); + useStoreProps(store, props, "value", "setValue"); + useStoreProps(store, props, "selectedValue", "setSelectedValue"); + useStoreProps(store, props, "resetValueOnHide"); + useStoreProps(store, props, "resetValueOnSelect"); + return Object.assign( + useCompositeStoreProps( + usePopoverStoreProps(store, update, props), + update, + props + ), + { tag: props.tag } + ); +} +function useComboboxStore(props = {}) { + props = useComboboxStoreOptions(props); + const [store, update] = YV4JVR4I_useStore(createComboboxStore, props); + return useComboboxStoreProps(store, update, props); +} + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/S6EF7IVO.js +"use client"; + + +// src/disclosure/disclosure-context.tsx +var S6EF7IVO_ctx = createStoreContext(); +var useDisclosureContext = S6EF7IVO_ctx.useContext; +var useDisclosureScopedContext = S6EF7IVO_ctx.useScopedContext; +var useDisclosureProviderContext = S6EF7IVO_ctx.useProviderContext; +var DisclosureContextProvider = S6EF7IVO_ctx.ContextProvider; +var DisclosureScopedContextProvider = S6EF7IVO_ctx.ScopedContextProvider; + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/RS7LB2H4.js +"use client"; + + + +// src/dialog/dialog-context.tsx + +var RS7LB2H4_ctx = createStoreContext( + [DisclosureContextProvider], + [DisclosureScopedContextProvider] +); +var useDialogContext = RS7LB2H4_ctx.useContext; +var useDialogScopedContext = RS7LB2H4_ctx.useScopedContext; +var useDialogProviderContext = RS7LB2H4_ctx.useProviderContext; +var DialogContextProvider = RS7LB2H4_ctx.ContextProvider; +var DialogScopedContextProvider = RS7LB2H4_ctx.ScopedContextProvider; +var DialogHeadingContext = (0,external_React_.createContext)(void 0); +var DialogDescriptionContext = (0,external_React_.createContext)(void 0); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/MTZPJQMC.js +"use client"; + + + +// src/popover/popover-context.tsx +var MTZPJQMC_ctx = createStoreContext( + [DialogContextProvider], + [DialogScopedContextProvider] +); +var usePopoverContext = MTZPJQMC_ctx.useContext; +var usePopoverScopedContext = MTZPJQMC_ctx.useScopedContext; +var usePopoverProviderContext = MTZPJQMC_ctx.useProviderContext; +var PopoverContextProvider = MTZPJQMC_ctx.ContextProvider; +var PopoverScopedContextProvider = MTZPJQMC_ctx.ScopedContextProvider; + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/VEVQD5MH.js +"use client"; + + + + +// src/combobox/combobox-context.tsx + +var ComboboxListRoleContext = (0,external_React_.createContext)( + void 0 +); +var VEVQD5MH_ctx = createStoreContext( + [PopoverContextProvider, CompositeContextProvider], + [PopoverScopedContextProvider, CompositeScopedContextProvider] +); +var useComboboxContext = VEVQD5MH_ctx.useContext; +var useComboboxScopedContext = VEVQD5MH_ctx.useScopedContext; +var useComboboxProviderContext = VEVQD5MH_ctx.useProviderContext; +var ComboboxContextProvider = VEVQD5MH_ctx.ContextProvider; +var ComboboxScopedContextProvider = VEVQD5MH_ctx.ScopedContextProvider; +var ComboboxItemValueContext = (0,external_React_.createContext)( + void 0 +); +var ComboboxItemCheckedContext = (0,external_React_.createContext)(false); + + + +;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js +"use client"; + + + + + + + + + + + + + + + + + + + +// src/combobox/combobox-provider.tsx + +function ComboboxProvider(props = {}) { + const store = useComboboxStore(props); + return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxContextProvider, { value: store, children: props.children }); +} + + +;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js +"use client"; + + + + + + + + + + + +// src/combobox/combobox-label.tsx + +var TagName = "label"; +var useComboboxLabel = createHook( + function useComboboxLabel2(_a) { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useComboboxProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const comboboxId = store.useState((state) => { + var _a2; + return (_a2 = state.baseElement) == null ? void 0 : _a2.id; + }); + props = _3YLGPPWQ_spreadValues({ + htmlFor: comboboxId + }, props); + return removeUndefinedValues(props); + } +); +var ComboboxLabel = memo2( + forwardRef2(function ComboboxLabel2(props) { + const htmlProps = useComboboxLabel(props); + return createElement(TagName, htmlProps); + }) +); + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/OMU7RWRV.js +"use client"; + + + + + +// src/popover/popover-anchor.tsx +var OMU7RWRV_TagName = "div"; +var usePopoverAnchor = createHook( + function usePopoverAnchor2(_a) { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = usePopoverProviderContext(); + store = store || context; + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { + ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref) + }); + return props; + } +); +var PopoverAnchor = forwardRef2(function PopoverAnchor2(props) { + const htmlProps = usePopoverAnchor(props); + return createElement(OMU7RWRV_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js +"use client"; + +// src/composite/utils.ts + +var _5VQZOHHZ_NULL_ITEM = { id: null }; +function _5VQZOHHZ_flipItems(items, activeId, shouldInsertNullItem = false) { + const index = items.findIndex((item) => item.id === activeId); + return [ + ...items.slice(index + 1), + ...shouldInsertNullItem ? [_5VQZOHHZ_NULL_ITEM] : [], + ...items.slice(0, index) + ]; +} +function _5VQZOHHZ_findFirstEnabledItem(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; @@ -26446,11 +30644,10 @@ }); } function getEnabledItem(store, id) { - if (!id) - return null; + if (!id) return null; return store.item(id) || null; } -function groupItemsByRows(items) { +function _5VQZOHHZ_groupItemsByRows(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { @@ -26490,1194 +30687,58 @@ return isSilentlyFocused; } function isItem(store, element, exclude) { - if (!element) - return false; - if (element === exclude) - return false; + if (!element) return false; + if (element === exclude) return false; const item = store.item(element.id); - if (!item) - return false; - if (exclude && item.element === exclude) - return false; - return true; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4R3V3JGP.js -"use client"; -var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var _4R3V3JGP_spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var _4R3V3JGP_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __objRest = (source, exclude) => { - var target = {}; - for (var prop in source) - if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) - target[prop] = source[prop]; - if (source != null && __getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(source)) { - if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) - target[prop] = source[prop]; - } - return target; -}; - - - -// EXTERNAL MODULE: external "React" -var external_React_ = __webpack_require__(1609); -var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/4R3V3JGP.js -"use client"; -var _4R3V3JGP_defProp = Object.defineProperty; -var _4R3V3JGP_defProps = Object.defineProperties; -var _4R3V3JGP_getOwnPropDescs = Object.getOwnPropertyDescriptors; -var _4R3V3JGP_getOwnPropSymbols = Object.getOwnPropertySymbols; -var _4R3V3JGP_hasOwnProp = Object.prototype.hasOwnProperty; -var _4R3V3JGP_propIsEnum = Object.prototype.propertyIsEnumerable; -var _4R3V3JGP_defNormalProp = (obj, key, value) => key in obj ? _4R3V3JGP_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var _chunks_4R3V3JGP_spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (_4R3V3JGP_hasOwnProp.call(b, prop)) - _4R3V3JGP_defNormalProp(a, prop, b[prop]); - if (_4R3V3JGP_getOwnPropSymbols) - for (var prop of _4R3V3JGP_getOwnPropSymbols(b)) { - if (_4R3V3JGP_propIsEnum.call(b, prop)) - _4R3V3JGP_defNormalProp(a, prop, b[prop]); - } - return a; -}; -var _chunks_4R3V3JGP_spreadProps = (a, b) => _4R3V3JGP_defProps(a, _4R3V3JGP_getOwnPropDescs(b)); -var _4R3V3JGP_objRest = (source, exclude) => { - var target = {}; - for (var prop in source) - if (_4R3V3JGP_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) - target[prop] = source[prop]; - if (source != null && _4R3V3JGP_getOwnPropSymbols) - for (var prop of _4R3V3JGP_getOwnPropSymbols(source)) { - if (exclude.indexOf(prop) < 0 && _4R3V3JGP_propIsEnum.call(source, prop)) - target[prop] = source[prop]; - } - return target; -}; - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Y3OOHFCN.js -"use client"; - - -// src/utils/misc.ts -function Y3OOHFCN_noop(..._) { -} -function shallowEqual(a, b) { - if (a === b) - return true; - if (!a) - return false; - if (!b) - return false; - if (typeof a !== "object") - return false; - if (typeof b !== "object") - return false; - const aKeys = Object.keys(a); - const bKeys = Object.keys(b); - const { length } = aKeys; - if (bKeys.length !== length) - return false; - for (const key of aKeys) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function Y3OOHFCN_applyState(argument, currentValue) { - if (isUpdater(argument)) { - const value = isLazyValue(currentValue) ? currentValue() : currentValue; - return argument(value); - } - return argument; -} -function isUpdater(argument) { - return typeof argument === "function"; -} -function isLazyValue(value) { - return typeof value === "function"; -} -function isObject(arg) { - return typeof arg === "object" && arg != null; -} -function isEmpty(arg) { - if (Array.isArray(arg)) - return !arg.length; - if (isObject(arg)) - return !Object.keys(arg).length; - if (arg == null) - return true; - if (arg === "") - return true; - return false; -} -function isInteger(arg) { - if (typeof arg === "number") { - return Math.floor(arg) === arg; - } - return String(Math.floor(Number(arg))) === arg; -} -function Y3OOHFCN_hasOwnProperty(object, prop) { - if (typeof Object.hasOwn === "function") { - return Object.hasOwn(object, prop); - } - return Object.prototype.hasOwnProperty.call(object, prop); -} -function chain(...fns) { - return (...args) => { - for (const fn of fns) { - if (typeof fn === "function") { - fn(...args); - } - } - }; -} -function cx(...args) { - return args.filter(Boolean).join(" ") || void 0; -} -function normalizeString(str) { - return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); -} -function omit(object, keys) { - const result = _chunks_4R3V3JGP_spreadValues({}, object); - for (const key of keys) { - if (Y3OOHFCN_hasOwnProperty(result, key)) { - delete result[key]; - } - } - return result; -} -function pick(object, paths) { - const result = {}; - for (const key of paths) { - if (Y3OOHFCN_hasOwnProperty(object, key)) { - result[key] = object[key]; - } - } - return result; -} -function identity(value) { - return value; -} -function beforePaint(cb = Y3OOHFCN_noop) { - const raf = requestAnimationFrame(cb); - return () => cancelAnimationFrame(raf); -} -function afterPaint(cb = Y3OOHFCN_noop) { - let raf = requestAnimationFrame(() => { - raf = requestAnimationFrame(cb); - }); - return () => cancelAnimationFrame(raf); -} -function invariant(condition, message) { - if (condition) - return; - if (typeof message !== "string") - throw new Error("Invariant failed"); - throw new Error(message); -} -function getKeys(obj) { - return Object.keys(obj); -} -function isFalsyBooleanCallback(booleanOrCallback, ...args) { - const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; - if (result == null) - return false; - return !result; -} -function disabledFromProps(props) { - return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; -} -function defaultValue(...values) { - for (const value of values) { - if (value !== void 0) - return value; - } - return void 0; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XM66DUTO.js -"use client"; - - -// src/utils/misc.ts - - -function setRef(ref, value) { - if (typeof ref === "function") { - ref(value); - } else if (ref) { - ref.current = value; - } -} -function isValidElementWithRef(element) { - if (!element) - return false; - if (!(0,external_React_.isValidElement)(element)) - return false; - if (!("ref" in element)) - return false; + if (!item) return false; + if (exclude && item.element === exclude) return false; return true; } -function getRefProperty(element) { - if (!isValidElementWithRef(element)) - return null; - return element.ref; -} -function mergeProps(base, overrides) { - const props = _4R3V3JGP_spreadValues({}, base); - for (const key in overrides) { - if (!Y3OOHFCN_hasOwnProperty(overrides, key)) - continue; - if (key === "className") { - const prop = "className"; - props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop]; - continue; - } - if (key === "style") { - const prop = "style"; - props[prop] = base[prop] ? _4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; - continue; - } - const overrideValue = overrides[key]; - if (typeof overrideValue === "function" && key.startsWith("on")) { - const baseValue = base[key]; - if (typeof baseValue === "function") { - props[key] = (...args) => { - overrideValue(...args); - baseValue(...args); - }; - continue; - } - } - props[key] = overrideValue; - } - return props; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/DLOEKDPY.js -"use client"; - -// src/utils/dom.ts -var DLOEKDPY_canUseDOM = checkIsBrowser(); -function checkIsBrowser() { - var _a; - return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); -} -function DLOEKDPY_getDocument(node) { - return node ? node.ownerDocument || node : document; -} -function getWindow(node) { - return DLOEKDPY_getDocument(node).defaultView || window; -} -function DLOEKDPY_getActiveElement(node, activeDescendant = false) { - const { activeElement } = DLOEKDPY_getDocument(node); - if (!(activeElement == null ? void 0 : activeElement.nodeName)) { - return null; - } - if (DLOEKDPY_isFrame(activeElement) && activeElement.contentDocument) { - return DLOEKDPY_getActiveElement( - activeElement.contentDocument.body, - activeDescendant - ); - } - if (activeDescendant) { - const id = activeElement.getAttribute("aria-activedescendant"); - if (id) { - const element = DLOEKDPY_getDocument(activeElement).getElementById(id); - if (element) { - return element; - } - } - } - return activeElement; -} -function contains(parent, child) { - return parent === child || parent.contains(child); -} -function DLOEKDPY_isFrame(element) { - return element.tagName === "IFRAME"; -} -function isButton(element) { - const tagName = element.tagName.toLowerCase(); - if (tagName === "button") - return true; - if (tagName === "input" && element.type) { - return buttonInputTypes.indexOf(element.type) !== -1; - } - return false; -} -var buttonInputTypes = [ - "button", - "color", - "file", - "image", - "reset", - "submit" -]; -function matches(element, selectors) { - if ("matches" in element) { - return element.matches(selectors); - } - if ("msMatchesSelector" in element) { - return element.msMatchesSelector(selectors); - } - return element.webkitMatchesSelector(selectors); -} -function isVisible(element) { - const htmlElement = element; - return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; -} -function DLOEKDPY_closest(element, selectors) { - if ("closest" in element) - return element.closest(selectors); - do { - if (matches(element, selectors)) - return element; - element = element.parentElement || element.parentNode; - } while (element !== null && element.nodeType === 1); - return null; -} -function DLOEKDPY_isTextField(element) { - try { - const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; - const isTextArea = element.tagName === "TEXTAREA"; - return isTextInput || isTextArea || false; - } catch (error) { - return false; - } -} -function getPopupRole(element, fallback) { - const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; - const role = element == null ? void 0 : element.getAttribute("role"); - if (role && allowedPopupRoles.indexOf(role) !== -1) { - return role; - } - return fallback; -} -function getPopupItemRole(element, fallback) { - var _a; - const itemRoleByPopupRole = { - menu: "menuitem", - listbox: "option", - tree: "treeitem", - grid: "gridcell" - }; - const popupRole = getPopupRole(element); - if (!popupRole) - return fallback; - const key = popupRole; - return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback; -} -function getTextboxSelection(element) { - let start = 0; - let end = 0; - if (DLOEKDPY_isTextField(element)) { - start = element.selectionStart || 0; - end = element.selectionEnd || 0; - } else if (element.isContentEditable) { - const selection = DLOEKDPY_getDocument(element).getSelection(); - if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { - const range = selection.getRangeAt(0); - const nextRange = range.cloneRange(); - nextRange.selectNodeContents(element); - nextRange.setEnd(range.startContainer, range.startOffset); - start = nextRange.toString().length; - nextRange.setEnd(range.endContainer, range.endOffset); - end = nextRange.toString().length; - } - } - return { start, end }; -} -function scrollIntoViewIfNeeded(element, arg) { - if (isPartiallyHidden(element) && "scrollIntoView" in element) { - element.scrollIntoView(arg); - } -} -function getScrollingElement(element) { - if (!element) - return null; - if (element.clientHeight && element.scrollHeight > element.clientHeight) { - const { overflowY } = getComputedStyle(element); - const isScrollable = overflowY !== "visible" && overflowY !== "hidden"; - if (isScrollable) - return element; - } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { - const { overflowX } = getComputedStyle(element); - const isScrollable = overflowX !== "visible" && overflowX !== "hidden"; - if (isScrollable) - return element; - } - return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; -} -function isPartiallyHidden(element) { - const elementRect = element.getBoundingClientRect(); - const scroller = getScrollingElement(element); - if (!scroller) - return false; - const scrollerRect = scroller.getBoundingClientRect(); - const isHTML = scroller.tagName === "HTML"; - const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top; - const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom; - const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left; - const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right; - const top = elementRect.top < scrollerTop; - const left = elementRect.left < scrollerLeft; - const bottom = elementRect.bottom > scrollerBottom; - const right = elementRect.right > scrollerRight; - return top || left || bottom || right; -} -function setSelectionRange(element, ...args) { - if (/text|search|password|tel|url/i.test(element.type)) { - element.setSelectionRange(...args); - } -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/MHPO2BXA.js -"use client"; - - -// src/utils/platform.ts -function isTouchDevice() { - return DLOEKDPY_canUseDOM && !!navigator.maxTouchPoints; -} -function isApple() { - if (!DLOEKDPY_canUseDOM) - return false; - return /mac|iphone|ipad|ipod/i.test(navigator.platform); -} -function isSafari() { - return DLOEKDPY_canUseDOM && isApple() && /apple/i.test(navigator.vendor); -} -function isFirefox() { - return DLOEKDPY_canUseDOM && /firefox\//i.test(navigator.userAgent); -} -function isMac() { - return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/events.js -"use client"; - - - - -// src/utils/events.ts -function isPortalEvent(event) { - return Boolean( - event.currentTarget && !contains(event.currentTarget, event.target) - ); -} -function isSelfTarget(event) { - return event.target === event.currentTarget; -} -function isOpeningInNewTab(event) { - const element = event.currentTarget; - if (!element) - return false; - const isAppleDevice = isApple(); - if (isAppleDevice && !event.metaKey) - return false; - if (!isAppleDevice && !event.ctrlKey) - return false; - const tagName = element.tagName.toLowerCase(); - if (tagName === "a") - return true; - if (tagName === "button" && element.type === "submit") - return true; - if (tagName === "input" && element.type === "submit") - return true; - return false; -} -function isDownloading(event) { - const element = event.currentTarget; - if (!element) - return false; - const tagName = element.tagName.toLowerCase(); - if (!event.altKey) - return false; - if (tagName === "a") - return true; - if (tagName === "button" && element.type === "submit") - return true; - if (tagName === "input" && element.type === "submit") - return true; - return false; -} -function fireEvent(element, type, eventInit) { - const event = new Event(type, eventInit); - return element.dispatchEvent(event); -} -function fireBlurEvent(element, eventInit) { - const event = new FocusEvent("blur", eventInit); - const defaultAllowed = element.dispatchEvent(event); - const bubbleInit = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, eventInit), { bubbles: true }); - element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); - return defaultAllowed; -} -function fireFocusEvent(element, eventInit) { - const event = new FocusEvent("focus", eventInit); - const defaultAllowed = element.dispatchEvent(event); - const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); - element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); - return defaultAllowed; -} -function fireKeyboardEvent(element, type, eventInit) { - const event = new KeyboardEvent(type, eventInit); - return element.dispatchEvent(event); -} -function fireClickEvent(element, eventInit) { - const event = new MouseEvent("click", eventInit); - return element.dispatchEvent(event); -} -function isFocusEventOutside(event, container) { - const containerElement = container || event.currentTarget; - const relatedTarget = event.relatedTarget; - return !relatedTarget || !contains(containerElement, relatedTarget); -} -function queueBeforeEvent(element, type, callback) { - const raf = requestAnimationFrame(() => { - element.removeEventListener(type, callImmediately, true); - callback(); - }); - const callImmediately = () => { - cancelAnimationFrame(raf); - callback(); - }; - element.addEventListener(type, callImmediately, { - once: true, - capture: true - }); - return raf; -} -function addGlobalEventListener(type, listener, options, scope = window) { - const children = []; - try { - scope.document.addEventListener(type, listener, options); - for (const frame of Array.from(scope.frames)) { - children.push(addGlobalEventListener(type, listener, options, frame)); - } - } catch (e) { - } - const removeEventListener = () => { - try { - scope.document.removeEventListener(type, listener, options); - } catch (e) { - } - children.forEach((remove) => remove()); - }; - return removeEventListener; -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6O5OEQGF.js -"use client"; - - - -// src/utils/hooks.ts - - - - - -var _React = _4R3V3JGP_spreadValues({}, external_React_namespaceObject); -var useReactId = _React.useId; -var useReactDeferredValue = _React.useDeferredValue; -var useReactInsertionEffect = _React.useInsertionEffect; -var useSafeLayoutEffect = DLOEKDPY_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; -function useInitialValue(value) { - const [initialValue] = useState(value); - return initialValue; -} -function useLazyValue(init) { - const ref = useRef(); - if (ref.current === void 0) { - ref.current = init(); - } - return ref.current; -} -function useLiveRef(value) { - const ref = (0,external_React_.useRef)(value); - useSafeLayoutEffect(() => { - ref.current = value; - }); - return ref; -} -function usePreviousValue(value) { - const [previousValue, setPreviousValue] = useState(value); - if (value !== previousValue) { - setPreviousValue(value); - } - return previousValue; -} -function useEvent(callback) { - const ref = (0,external_React_.useRef)(() => { - throw new Error("Cannot call an event handler while rendering."); - }); - if (useReactInsertionEffect) { - useReactInsertionEffect(() => { - ref.current = callback; - }); - } else { - ref.current = callback; - } - return (0,external_React_.useCallback)((...args) => { - var _a; - return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); - }, []); -} -function useMergeRefs(...refs) { - return (0,external_React_.useMemo)(() => { - if (!refs.some(Boolean)) - return; - return (value) => { - refs.forEach((ref) => setRef(ref, value)); - }; - }, refs); -} -function useRefId(ref, deps) { - const [id, setId] = useState(void 0); - useSafeLayoutEffect(() => { - var _a; - setId((_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.id); - }, deps); - return id; -} -function useId(defaultId) { - if (useReactId) { - const reactId = useReactId(); - if (defaultId) - return defaultId; - return reactId; - } - const [id, setId] = (0,external_React_.useState)(defaultId); - useSafeLayoutEffect(() => { - if (defaultId || id) - return; - const random = Math.random().toString(36).substr(2, 6); - setId(`id-${random}`); - }, [defaultId, id]); - return defaultId || id; -} -function useDeferredValue(value) { - if (useReactDeferredValue) { - return useReactDeferredValue(value); - } - const [deferredValue, setDeferredValue] = useState(value); - useEffect(() => { - const raf = requestAnimationFrame(() => setDeferredValue(value)); - return () => cancelAnimationFrame(raf); - }, [value]); - return deferredValue; -} -function useTagName(refOrElement, type) { - const stringOrUndefined = (type2) => { - if (typeof type2 !== "string") - return; - return type2; - }; - const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type)); - useSafeLayoutEffect(() => { - const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; - setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); - }, [refOrElement, type]); - return tagName; -} -function useAttribute(refOrElement, attributeName, defaultValue) { - const [attribute, setAttribute] = (0,external_React_.useState)(defaultValue); - useSafeLayoutEffect(() => { - const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; - const value = element == null ? void 0 : element.getAttribute(attributeName); - if (value == null) - return; - setAttribute(value); - }, [refOrElement, attributeName]); - return attribute; -} -function useUpdateEffect(effect, deps) { - const mounted = (0,external_React_.useRef)(false); - (0,external_React_.useEffect)(() => { - if (mounted.current) { - return effect(); - } - mounted.current = true; - }, deps); - (0,external_React_.useEffect)( - () => () => { - mounted.current = false; - }, - [] - ); -} -function useUpdateLayoutEffect(effect, deps) { - const mounted = (0,external_React_.useRef)(false); - useSafeLayoutEffect(() => { - if (mounted.current) { - return effect(); - } - mounted.current = true; - }, deps); - useSafeLayoutEffect( - () => () => { - mounted.current = false; - }, - [] - ); -} -function useControlledState(defaultState, state, setState) { - const [localState, setLocalState] = useState(defaultState); - const nextState = state !== void 0 ? state : localState; - const stateRef = useLiveRef(state); - const setStateRef = useLiveRef(setState); - const nextStateRef = useLiveRef(nextState); - const setNextState = useCallback((prevValue) => { - const setStateProp = setStateRef.current; - if (setStateProp) { - if (isSetNextState(setStateProp)) { - setStateProp(prevValue); - } else { - const nextValue = applyState(prevValue, nextStateRef.current); - nextStateRef.current = nextValue; - setStateProp(nextValue); - } - } - if (stateRef.current === void 0) { - setLocalState(prevValue); - } - }, []); - defineSetNextState(setNextState); - return [nextState, setNextState]; -} -var SET_NEXT_STATE = Symbol("setNextState"); -function isSetNextState(arg) { - return arg[SET_NEXT_STATE] === true; -} -function defineSetNextState(arg) { - if (!isSetNextState(arg)) { - Object.defineProperty(arg, SET_NEXT_STATE, { value: true }); - } -} -function useForceUpdate() { - return (0,external_React_.useReducer)(() => [], []); -} -function useBooleanEvent(booleanOrCallback) { - return useEvent( - typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback - ); -} -function useWrapElement(props, callback, deps = []) { - const wrapElement = (0,external_React_.useCallback)( - (element) => { - if (props.wrapElement) { - element = props.wrapElement(element); - } - return callback(element); - }, - [...deps, props.wrapElement] - ); - return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { wrapElement }); -} -function usePortalRef(portalProp = false, portalRefProp) { - const [portalNode, setPortalNode] = useState(null); - const portalRef = useMergeRefs(setPortalNode, portalRefProp); - const domReady = !portalProp || portalNode; - return { portalRef, portalNode, domReady }; -} -function useMetadataProps(props, key, value) { - const parent = props.onLoadedMetadataCapture; - const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { - return Object.assign(() => { - }, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, parent), { [key]: value })); - }, [parent, key, value]); - return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; -} -function useIsMouseMoving() { - (0,external_React_.useEffect)(() => { - addGlobalEventListener("mousemove", setMouseMoving, true); - addGlobalEventListener("mousedown", resetMouseMoving, true); - addGlobalEventListener("mouseup", resetMouseMoving, true); - addGlobalEventListener("keydown", resetMouseMoving, true); - addGlobalEventListener("scroll", resetMouseMoving, true); - }, []); - const isMouseMoving = useEvent(() => mouseMoving); - return isMouseMoving; -} -var mouseMoving = false; -var previousScreenX = 0; -var previousScreenY = 0; -function hasMouseMovement(event) { - const movementX = event.movementX || event.screenX - previousScreenX; - const movementY = event.movementY || event.screenY - previousScreenY; - previousScreenX = event.screenX; - previousScreenY = event.screenY; - return movementX || movementY || "production" === "test"; -} -function setMouseMoving(event) { - if (!hasMouseMovement(event)) - return; - mouseMoving = true; -} -function resetMouseMoving() { - mouseMoving = false; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3ORBWXWF.js -"use client"; - - - - -// src/utils/system.tsx - - - -function isRenderProp(children) { - return typeof children === "function"; -} -function forwardRef2(render) { - const Role = React.forwardRef((props, ref) => render(__spreadProps(__spreadValues({}, props), { ref }))); - Role.displayName = render.displayName || render.name; - return Role; -} -function memo2(Component, propsAreEqual) { - const Role = React.memo(Component, propsAreEqual); - Role.displayName = Component.displayName || Component.name; - return Role; -} -function createComponent(render) { - const Role = (props, ref) => render(_4R3V3JGP_spreadValues({ ref }, props)); - return external_React_.forwardRef(Role); -} -function createMemoComponent(render) { - const Role = createComponent(render); - return external_React_.memo(Role); -} -function createElement(Type, props) { - const _a = props, { as: As, wrapElement, render } = _a, rest = __objRest(_a, ["as", "wrapElement", "render"]); - let element; - const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); - if (false) {} - if (As && typeof As !== "string") { - element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(As, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rest), { render })); - } else if (external_React_.isValidElement(render)) { - const renderProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, render.props), { ref: mergedRef }); - element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); - } else if (render) { - element = render(rest); - } else if (isRenderProp(props.children)) { - if (false) {} - const _b = rest, { children } = _b, otherProps = __objRest(_b, ["children"]); - element = props.children(otherProps); - } else if (As) { - element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(As, _4R3V3JGP_spreadValues({}, rest)); - } else { - element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _4R3V3JGP_spreadValues({}, rest)); - } - if (wrapElement) { - return wrapElement(element); - } - return element; -} -function createHook(useProps) { - const useRole = (props = {}) => { - const htmlProps = useProps(props); - const copy = {}; - for (const prop in htmlProps) { - if (Y3OOHFCN_hasOwnProperty(htmlProps, prop) && htmlProps[prop] !== void 0) { - copy[prop] = htmlProps[prop]; - } - } - return copy; - }; - return useRole; -} -function createStoreContext(providers = [], scopedProviders = []) { - const context = external_React_.createContext(void 0); - const scopedContext = external_React_.createContext(void 0); - const useContext2 = () => external_React_.useContext(context); - const useScopedContext = (onlyScoped = false) => { - const scoped = external_React_.useContext(scopedContext); - const store = useContext2(); - if (onlyScoped) - return scoped; - return scoped || store; - }; - const useProviderContext = () => { - const scoped = external_React_.useContext(scopedContext); - const store = useContext2(); - if (scoped && scoped === store) - return; - return store; - }; - const ContextProvider = (props) => { - return providers.reduceRight( - (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), - /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _4R3V3JGP_spreadValues({}, props)) - ); - }; - const ScopedContextProvider = (props) => { - return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children: scopedProviders.reduceRight( - (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), - /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _4R3V3JGP_spreadValues({}, props)) - ) })); - }; - return { - context, - scopedContext, - useContext: useContext2, - useScopedContext, - useProviderContext, - ContextProvider, - ScopedContextProvider - }; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4UUKJZ4V.js -"use client"; - - -// src/collection/collection-context.tsx -var ctx = createStoreContext(); -var useCollectionContext = ctx.useContext; -var useCollectionScopedContext = ctx.useScopedContext; -var useCollectionProviderContext = ctx.useProviderContext; -var CollectionContextProvider = ctx.ContextProvider; -var CollectionScopedContextProvider = ctx.ScopedContextProvider; - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IB7YUKH5.js -"use client"; - - - -// src/composite/composite-context.tsx - -var IB7YUKH5_ctx = createStoreContext( - [CollectionContextProvider], - [CollectionScopedContextProvider] -); -var useCompositeContext = IB7YUKH5_ctx.useContext; -var useCompositeScopedContext = IB7YUKH5_ctx.useScopedContext; -var useCompositeProviderContext = IB7YUKH5_ctx.useProviderContext; -var CompositeContextProvider = IB7YUKH5_ctx.ContextProvider; -var CompositeScopedContextProvider = IB7YUKH5_ctx.ScopedContextProvider; -var CompositeItemContext = (0,external_React_.createContext)( - void 0 -); -var CompositeRowContext = (0,external_React_.createContext)( - void 0 -); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/346FK57L.js -"use client"; - - - - - - -// src/composite/composite-typeahead.ts - - - - -var chars = ""; -function clearChars() { - chars = ""; -} -function isValidTypeaheadEvent(event) { - const target = event.target; - if (target && DLOEKDPY_isTextField(target)) - return false; - if (event.key === " " && chars.length) - return true; - return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && /^[\p{Letter}\p{Number}]$/u.test(event.key); -} -function isSelfTargetOrItem(event, items) { - if (isSelfTarget(event)) - return true; - const target = event.target; - if (!target) - return false; - const isItem = items.some((item) => item.element === target); - return isItem; -} -function getEnabledItems(items) { - return items.filter((item) => !item.disabled); -} -function itemTextStartsWith(item, text) { - var _a; - const itemText = ((_a = item.element) == null ? void 0 : _a.textContent) || item.children; - if (!itemText) - return false; - return normalizeString(itemText).trim().toLowerCase().startsWith(text.toLowerCase()); -} -function getSameInitialItems(items, char, activeId) { - if (!activeId) - return items; - const activeItem = items.find((item) => item.id === activeId); - if (!activeItem) - return items; - if (!itemTextStartsWith(activeItem, char)) - return items; - if (chars !== char && itemTextStartsWith(activeItem, chars)) - return items; - chars = char; - return flipItems( - items.filter((item) => itemTextStartsWith(item, chars)), - activeId - ).filter((item) => item.id !== activeId); -} -var useCompositeTypeahead = createHook( - (_a) => { - var _b = _a, { store, typeahead = true } = _b, props = __objRest(_b, ["store", "typeahead"]); - const context = useCompositeContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const onKeyDownCaptureProp = props.onKeyDownCapture; - const cleanupTimeoutRef = (0,external_React_.useRef)(0); - const onKeyDownCapture = useEvent( - (event) => { - onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); - if (event.defaultPrevented) - return; - if (!typeahead) - return; - if (!store) - return; - const { items, activeId } = store.getState(); - if (!isValidTypeaheadEvent(event)) - return clearChars(); - let enabledItems = getEnabledItems(items); - if (!isSelfTargetOrItem(event, enabledItems)) - return clearChars(); - event.preventDefault(); - window.clearTimeout(cleanupTimeoutRef.current); - cleanupTimeoutRef.current = window.setTimeout(() => { - chars = ""; - }, 500); - const char = event.key.toLowerCase(); - chars += char; - enabledItems = getSameInitialItems(enabledItems, char, activeId); - const item = enabledItems.find( - (item2) => itemTextStartsWith(item2, chars) - ); - if (item) { - store.move(item.id); - } else { - clearChars(); - } - } - ); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { - onKeyDownCapture - }); - return props; - } -); -var CompositeTypeahead = createComponent( - (props) => { - const htmlProps = useCompositeTypeahead(props); - return createElement("div", htmlProps); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/focus.js + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js +"use client"; + +// src/focusable/focusable-context.tsx + +var FocusableContext = (0,external_React_.createContext)(true); + + + +;// ./node_modules/@ariakit/core/esm/utils/focus.js "use client"; // src/utils/focus.ts -var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; +var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; function hasNegativeTabIndex(element) { - const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); + const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10); return tabIndex < 0; } function isFocusable(element) { - if (!matches(element, selector)) - return false; - if (!isVisible(element)) - return false; - if (DLOEKDPY_closest(element, "[inert]")) - return false; + if (!element.matches(selector)) return false; + if (!isVisible(element)) return false; + if (element.closest("[inert]")) return false; return true; } function isTabbable(element) { - if (!isFocusable(element)) - return false; - if (hasNegativeTabIndex(element)) - return false; - if (!("form" in element)) - return true; - if (!element.form) - return true; - if (element.checked) - return true; - if (element.type !== "radio") - return true; + if (!isFocusable(element)) return false; + if (hasNegativeTabIndex(element)) return false; + if (!("form" in element)) return true; + if (!element.form) return true; + if (element.checked) return true; + if (element.type !== "radio") return true; const radioGroup = element.form.elements.namedItem(element.name); - if (!radioGroup) - return true; - if (!("length" in radioGroup)) - return true; + if (!radioGroup) return true; + if (!("length" in radioGroup)) return true; const activeElement = getActiveElement(element); - if (!activeElement) - return true; - if (activeElement === element) - return true; - if (!("form" in activeElement)) - return true; - if (activeElement.form !== element.form) - return true; - if (activeElement.name !== element.name) - return true; + if (!activeElement) return true; + if (activeElement === element) return true; + if (!("form" in activeElement)) return true; + if (activeElement.form !== element.form) return true; + if (activeElement.name !== element.name) return true; return false; } function getAllFocusableIn(container, includeContainer) { @@ -27787,34 +30848,26 @@ } function getClosestFocusable(element) { while (element && !isFocusable(element)) { - element = closest(element, selector); + element = element.closest(selector); } return element || null; } function hasFocus(element) { - const activeElement = DLOEKDPY_getActiveElement(element); - if (!activeElement) - return false; - if (activeElement === element) - return true; + const activeElement = DTR5TSDJ_getActiveElement(element); + if (!activeElement) return false; + if (activeElement === element) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); - if (!activeDescendant) - return false; + if (!activeDescendant) return false; return activeDescendant === element.id; } function hasFocusWithin(element) { - const activeElement = DLOEKDPY_getActiveElement(element); - if (!activeElement) - return false; - if (contains(element, activeElement)) - return true; + const activeElement = DTR5TSDJ_getActiveElement(element); + if (!activeElement) return false; + if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); - if (!activeDescendant) - return false; - if (!("id" in element)) - return false; - if (activeDescendant === element.id) - return true; + if (!activeDescendant) return false; + if (!("id" in element)) return false; + if (activeDescendant === element.id) return true; return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); } function focusIfNeeded(element) { @@ -27830,7 +30883,9 @@ } function disableFocusIn(container, includeContainer) { const tabbableElements = getAllTabbableIn(container, includeContainer); - tabbableElements.forEach(disableFocus); + for (const element of tabbableElements) { + disableFocus(element); + } } function restoreFocusIn(container) { const elements = container.querySelectorAll("[data-tabindex]"); @@ -27846,1541 +30901,35 @@ if (container.hasAttribute("data-tabindex")) { restoreTabIndex(container); } - elements.forEach(restoreTabIndex); + for (const element of elements) { + restoreTabIndex(element); + } } function focusIntoView(element, options) { if (!("scrollIntoView" in element)) { element.focus(); } else { element.focus({ preventScroll: true }); - element.scrollIntoView(_chunks_4R3V3JGP_spreadValues({ block: "nearest", inline: "nearest" }, options)); - } -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6ONQ5EH.js -"use client"; - - - - - -// src/composite/composite-hover.ts - - - - -function getMouseDestination(event) { - const relatedTarget = event.relatedTarget; - if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { - return relatedTarget; - } - return null; -} -function hoveringInside(event) { - const nextElement = getMouseDestination(event); - if (!nextElement) - return false; - return contains(event.currentTarget, nextElement); -} -var symbol = Symbol("composite-hover"); -function movingToAnotherItem(event) { - let dest = getMouseDestination(event); - if (!dest) - return false; - do { - if (Y3OOHFCN_hasOwnProperty(dest, symbol) && dest[symbol]) - return true; - dest = dest.parentElement; - } while (dest); - return false; -} -var useCompositeHover = createHook( - (_a) => { - var _b = _a, { - store, - focusOnHover = true, - blurOnHoverEnd = !!focusOnHover - } = _b, props = __objRest(_b, [ - "store", - "focusOnHover", - "blurOnHoverEnd" - ]); - const context = useCompositeContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const isMouseMoving = useIsMouseMoving(); - const onMouseMoveProp = props.onMouseMove; - const focusOnHoverProp = useBooleanEvent(focusOnHover); - const onMouseMove = useEvent((event) => { - onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); - if (event.defaultPrevented) - return; - if (!isMouseMoving()) - return; - if (!focusOnHoverProp(event)) - return; - if (!hasFocusWithin(event.currentTarget)) { - const baseElement = store == null ? void 0 : store.getState().baseElement; - if (baseElement && !hasFocus(baseElement)) { - baseElement.focus(); - } - } - store == null ? void 0 : store.setActiveId(event.currentTarget.id); - }); - const onMouseLeaveProp = props.onMouseLeave; - const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd); - const onMouseLeave = useEvent((event) => { - var _a2; - onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); - if (event.defaultPrevented) - return; - if (!isMouseMoving()) - return; - if (hoveringInside(event)) - return; - if (movingToAnotherItem(event)) - return; - if (!focusOnHoverProp(event)) - return; - if (!blurOnHoverEndProp(event)) - return; - store == null ? void 0 : store.setActiveId(null); - (_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus(); - }); - const ref = (0,external_React_.useCallback)((element) => { - if (!element) - return; - element[symbol] = true; - }, []); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { - ref: useMergeRefs(ref, props.ref), - onMouseMove, - onMouseLeave - }); - return props; - } -); -var CompositeHover = createMemoComponent( - (props) => { - const htmlProps = useCompositeHover(props); - return createElement("div", htmlProps); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EAHJFCU4.js -"use client"; - - - -// src/utils/store.ts -function getInternal(store, key) { - const internals = store.__unstableInternals; - invariant(internals, "Invalid store"); - return internals[key]; -} -function createStore(initialState, ...stores) { - let state = initialState; - let prevStateBatch = state; - let lastUpdate = Symbol(); - let destroy = Y3OOHFCN_noop; - const instances = /* @__PURE__ */ new Set(); - const updatedKeys = /* @__PURE__ */ new Set(); - const setups = /* @__PURE__ */ new Set(); - const listeners = /* @__PURE__ */ new Set(); - const batchListeners = /* @__PURE__ */ new Set(); - const disposables = /* @__PURE__ */ new WeakMap(); - const listenerKeys = /* @__PURE__ */ new WeakMap(); - const storeSetup = (callback) => { - setups.add(callback); - return () => setups.delete(callback); - }; - const storeInit = () => { - const initialized = instances.size; - const instance = Symbol(); - instances.add(instance); - const maybeDestroy = () => { - instances.delete(instance); - if (instances.size) - return; - destroy(); - }; - if (initialized) - return maybeDestroy; - const desyncs = getKeys(state).map( - (key) => chain( - ...stores.map((store) => { - var _a; - const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); - if (!storeState) - return; - if (!Y3OOHFCN_hasOwnProperty(storeState, key)) - return; - return sync(store, [key], (state2) => { - setState( - key, - state2[key], - // @ts-expect-error - Not public API. This is just to prevent - // infinite loops. - true - ); - }); - }) - ) - ); - const teardowns = []; - setups.forEach((setup2) => teardowns.push(setup2())); - const cleanups = stores.map(init); - destroy = chain(...desyncs, ...teardowns, ...cleanups); - return maybeDestroy; - }; - const sub = (keys, listener, set = listeners) => { - set.add(listener); - listenerKeys.set(listener, keys); - return () => { - var _a; - (_a = disposables.get(listener)) == null ? void 0 : _a(); - disposables.delete(listener); - listenerKeys.delete(listener); - set.delete(listener); - }; - }; - const storeSubscribe = (keys, listener) => sub(keys, listener); - const storeSync = (keys, listener) => { - disposables.set(listener, listener(state, state)); - return sub(keys, listener); - }; - const storeBatch = (keys, listener) => { - disposables.set(listener, listener(state, prevStateBatch)); - return sub(keys, listener, batchListeners); - }; - const storePick = (keys) => createStore(pick(state, keys), finalStore); - const storeOmit = (keys) => createStore(omit(state, keys), finalStore); - const getState = () => state; - const setState = (key, value, fromStores = false) => { - if (!Y3OOHFCN_hasOwnProperty(state, key)) - return; - const nextValue = Y3OOHFCN_applyState(value, state[key]); - if (nextValue === state[key]) - return; - if (!fromStores) { - stores.forEach((store) => { - var _a; - (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); - }); - } - const prevState = state; - state = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, state), { [key]: nextValue }); - const thisUpdate = Symbol(); - lastUpdate = thisUpdate; - updatedKeys.add(key); - const run = (listener, prev, uKeys) => { - var _a; - const keys = listenerKeys.get(listener); - const updated = (k) => uKeys ? uKeys.has(k) : k === key; - if (!keys || keys.some(updated)) { - (_a = disposables.get(listener)) == null ? void 0 : _a(); - disposables.set(listener, listener(state, prev)); - } - }; - listeners.forEach((listener) => { - run(listener, prevState); - }); - queueMicrotask(() => { - if (lastUpdate !== thisUpdate) - return; - const snapshot = state; - batchListeners.forEach((listener) => { - run(listener, prevStateBatch, updatedKeys); - }); - prevStateBatch = snapshot; - updatedKeys.clear(); - }); - }; - const finalStore = { - getState, - setState, - __unstableInternals: { - setup: storeSetup, - init: storeInit, - subscribe: storeSubscribe, - sync: storeSync, - batch: storeBatch, - pick: storePick, - omit: storeOmit - } - }; - return finalStore; -} -function setup(store, ...args) { - if (!store) - return; - return getInternal(store, "setup")(...args); -} -function init(store, ...args) { - if (!store) - return; - return getInternal(store, "init")(...args); -} -function subscribe(store, ...args) { - if (!store) - return; - return getInternal(store, "subscribe")(...args); -} -function sync(store, ...args) { - if (!store) - return; - return getInternal(store, "sync")(...args); -} -function batch(store, ...args) { - if (!store) - return; - return getInternal(store, "batch")(...args); -} -function omit2(store, ...args) { - if (!store) - return; - return getInternal(store, "omit")(...args); -} -function pick2(store, ...args) { - if (!store) - return; - return getInternal(store, "pick")(...args); -} -function mergeStore(...stores) { - const initialState = stores.reduce((state, store2) => { - var _a; - const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); - if (!nextState) - return state; - return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, state), nextState); - }, {}); - const store = createStore(initialState, ...stores); - return store; -} -function throwOnConflictingProps(props, store) { - if (true) - return; - if (!store) - return; - const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { - var _a; - const stateKey = key.replace("default", ""); - return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; - }); - if (!defaultKeys.length) - return; - const storeState = store.getState(); - const conflictingProps = defaultKeys.filter( - (key) => Y3OOHFCN_hasOwnProperty(storeState, key) - ); - if (!conflictingProps.length) - return; - throw new Error( - `Passing a store prop in conjunction with a default state is not supported. - -const store = useSelectStore(); - - ^ ^ - -Instead, pass the default state to the topmost store: - -const store = useSelectStore({ defaultValue: "Apple" }); - - -See https://github.com/ariakit/ariakit/pull/2745 for more details. - -If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit -` - ); -} - - - -// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js -var shim = __webpack_require__(422); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/EKQEJRUF.js -"use client"; - - - -// src/utils/store.tsx - - - - -var { useSyncExternalStore } = shim; -var noopSubscribe = () => () => { -}; -function useStoreState(store, keyOrSelector = identity) { - const storeSubscribe = external_React_.useCallback( - (callback) => { - if (!store) - return noopSubscribe(); - return subscribe(store, null, callback); - }, - [store] - ); - const getSnapshot = () => { - const key = typeof keyOrSelector === "string" ? keyOrSelector : null; - const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; - const state = store == null ? void 0 : store.getState(); - if (selector) - return selector(state); - if (!state) - return; - if (!key) - return; - if (!Y3OOHFCN_hasOwnProperty(state, key)) - return; - return state[key]; - }; - return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); -} -function useStoreProps(store, props, key, setKey) { - const value = Y3OOHFCN_hasOwnProperty(props, key) ? props[key] : void 0; - const setValue = setKey ? props[setKey] : void 0; - const propsRef = useLiveRef({ value, setValue }); - useSafeLayoutEffect(() => { - return sync(store, [key], (state, prev) => { - const { value: value2, setValue: setValue2 } = propsRef.current; - if (!setValue2) - return; - if (state[key] === prev[key]) - return; - if (state[key] === value2) - return; - setValue2(state[key]); - }); - }, [store, key]); - useSafeLayoutEffect(() => { - if (value === void 0) - return; - store.setState(key, value); - return batch(store, [key], () => { - if (value === void 0) - return; - store.setState(key, value); - }); - }); -} -function EKQEJRUF_useStore(createStore, props) { - const [store, setStore] = external_React_.useState(() => createStore(props)); - useSafeLayoutEffect(() => init(store), [store]); - const useState2 = external_React_.useCallback( - (keyOrSelector) => useStoreState(store, keyOrSelector), - [store] - ); - const memoizedStore = external_React_.useMemo( - () => _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, store), { useState: useState2 }), - [store, useState2] - ); - const updateStore = useEvent(() => { - setStore((store2) => createStore(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, props), store2.getState()))); - }); - return [memoizedStore, updateStore]; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Y6GYTNQ2.js -"use client"; - - - -// src/collection/collection-store.ts - -function useCollectionStoreProps(store, update, props) { - useUpdateEffect(update, [props.store]); - useStoreProps(store, props, "items", "setItems"); - return store; -} -function useCollectionStore(props = {}) { - const [store, update] = useStore(Core.createCollectionStore, props); - return useCollectionStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7GBW5FLS.js -"use client"; - - - -// src/composite/composite-store.ts - -function useCompositeStoreProps(store, update, props) { - store = useCollectionStoreProps(store, update, props); - useStoreProps(store, props, "activeId", "setActiveId"); - useStoreProps(store, props, "includesBaseElement"); - useStoreProps(store, props, "virtualFocus"); - useStoreProps(store, props, "orientation"); - useStoreProps(store, props, "rtl"); - useStoreProps(store, props, "focusLoop"); - useStoreProps(store, props, "focusWrap"); - useStoreProps(store, props, "focusShift"); - return store; -} -function _7GBW5FLS_useCompositeStore(props = {}) { - const [store, update] = useStore(Core.createCompositeStore, props); - return useCompositeStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SFCBA2JZ.js -"use client"; - - - -// src/disclosure/disclosure-store.ts - -function useDisclosureStoreProps(store, update, props) { - useUpdateEffect(update, [props.store, props.disclosure]); - useStoreProps(store, props, "open", "setOpen"); - useStoreProps(store, props, "mounted", "setMounted"); - useStoreProps(store, props, "animated"); - return store; -} -function useDisclosureStore(props = {}) { - const [store, update] = useStore(Core.createDisclosureStore, props); - return useDisclosureStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZSELSBRM.js -"use client"; - - - -// src/dialog/dialog-store.ts - -function useDialogStoreProps(store, update, props) { - return useDisclosureStoreProps(store, update, props); -} -function useDialogStore(props = {}) { - const [store, update] = useStore(Core.createDialogStore, props); - return useDialogStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MG4P3223.js -"use client"; - - - - -// src/popover/popover-store.ts - -function usePopoverStoreProps(store, update, props) { - useUpdateEffect(update, [props.popover]); - store = useDialogStoreProps(store, update, props); - useStoreProps(store, props, "placement"); - return store; -} -function usePopoverStore(props = {}) { - const [store, update] = useStore(Core.createPopoverStore, props); - return usePopoverStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Z5IGYIPT.js -"use client"; - - - - -// src/disclosure/disclosure-store.ts -function createDisclosureStore(props = {}) { - const store = mergeStore( - props.store, - omit2(props.disclosure, ["contentElement", "disclosureElement"]) - ); - throwOnConflictingProps(props, store); - const syncState = store == null ? void 0 : store.getState(); - const open = defaultValue( - props.open, - syncState == null ? void 0 : syncState.open, - props.defaultOpen, - false - ); - const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); - const initialState = { - open, - animated, - animating: !!animated && open, - mounted: open, - contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), - disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) - }; - const disclosure = createStore(initialState, store); - setup( - disclosure, - () => sync(disclosure, ["animated", "animating"], (state) => { - if (state.animated) - return; - disclosure.setState("animating", false); - }) - ); - setup( - disclosure, - () => subscribe(disclosure, ["open"], () => { - if (!disclosure.getState().animated) - return; - disclosure.setState("animating", true); - }) - ); - setup( - disclosure, - () => sync(disclosure, ["open", "animating"], (state) => { - disclosure.setState("mounted", state.open || state.animating); - }) - ); - return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, disclosure), { - setOpen: (value) => disclosure.setState("open", value), - show: () => disclosure.setState("open", true), - hide: () => disclosure.setState("open", false), - toggle: () => disclosure.setState("open", (open2) => !open2), - stopAnimation: () => disclosure.setState("animating", false), - setContentElement: (value) => disclosure.setState("contentElement", value), - setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SX2XFD6A.js -"use client"; - - -// src/dialog/dialog-store.ts -function createDialogStore(props = {}) { - return createDisclosureStore(props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/AF6IUUFN.js -"use client"; - - - - - -// src/popover/popover-store.ts -function createPopoverStore(_a = {}) { - var _b = _a, { - popover: otherPopover - } = _b, props = _4R3V3JGP_objRest(_b, [ - "popover" - ]); - const store = mergeStore( - props.store, - omit2(otherPopover, [ - "arrowElement", - "anchorElement", - "contentElement", - "popoverElement", - "disclosureElement" - ]) - ); - throwOnConflictingProps(props, store); - const syncState = store == null ? void 0 : store.getState(); - const dialog = createDialogStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { store })); - const placement = defaultValue( - props.placement, - syncState == null ? void 0 : syncState.placement, - "bottom" - ); - const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, dialog.getState()), { - placement, - currentPlacement: placement, - anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), - popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), - arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), - rendered: Symbol("rendered") - }); - const popover = createStore(initialState, dialog, store); - return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, dialog), popover), { - setAnchorElement: (element) => popover.setState("anchorElement", element), - setPopoverElement: (element) => popover.setState("popoverElement", element), - setArrowElement: (element) => popover.setState("arrowElement", element), - render: () => popover.setState("rendered", Symbol("rendered")) - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/22K762VQ.js -"use client"; - - - - - -// src/collection/collection-store.ts -function isElementPreceding(a, b) { - return Boolean( - b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING - ); -} -function sortBasedOnDOMPosition(items) { - const pairs = items.map((item, index) => [index, item]); - let isOrderDifferent = false; - pairs.sort(([indexA, a], [indexB, b]) => { - const elementA = a.element; - const elementB = b.element; - if (elementA === elementB) - return 0; - if (!elementA || !elementB) - return 0; - if (isElementPreceding(elementA, elementB)) { - if (indexA > indexB) { - isOrderDifferent = true; - } - return -1; - } - if (indexA < indexB) { - isOrderDifferent = true; - } - return 1; - }); - if (isOrderDifferent) { - return pairs.map(([_, item]) => item); - } - return items; -} -function getCommonParent(items) { - var _a; - const firstItem = items.find((item) => !!item.element); - const lastItem = [...items].reverse().find((item) => !!item.element); - let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; - while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { - const parent = parentElement; - if (lastItem && parent.contains(lastItem.element)) { - return parentElement; - } - parentElement = parentElement.parentElement; - } - return DLOEKDPY_getDocument(parentElement).body; -} -function getPrivateStore(store) { - return store == null ? void 0 : store.__unstablePrivateStore; -} -function createCollectionStore(props = {}) { - var _a; - throwOnConflictingProps(props, props.store); - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const items = defaultValue( - props.items, - syncState == null ? void 0 : syncState.items, - props.defaultItems, - [] - ); - const itemsMap = new Map(items.map((item) => [item.id, item])); - const initialState = { - items, - renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) - }; - const syncPrivateStore = getPrivateStore(props.store); - const privateStore = createStore( - { items, renderedItems: initialState.renderedItems }, - syncPrivateStore - ); - const collection = createStore(initialState, props.store); - const sortItems = (renderedItems) => { - const sortedItems = sortBasedOnDOMPosition(renderedItems); - privateStore.setState("renderedItems", sortedItems); - collection.setState("renderedItems", sortedItems); - }; - setup(collection, () => init(privateStore)); - setup(privateStore, () => { - return batch(privateStore, ["items"], (state) => { - collection.setState("items", state.items); - }); - }); - setup(privateStore, () => { - return batch(privateStore, ["renderedItems"], (state) => { - let firstRun = true; - let raf = requestAnimationFrame(() => { - const { renderedItems } = collection.getState(); - if (state.renderedItems === renderedItems) - return; - sortItems(state.renderedItems); - }); - if (typeof IntersectionObserver !== "function") { - return () => cancelAnimationFrame(raf); - } - const ioCallback = () => { - if (firstRun) { - firstRun = false; - return; - } - cancelAnimationFrame(raf); - raf = requestAnimationFrame(() => sortItems(state.renderedItems)); - }; - const root = getCommonParent(state.renderedItems); - const observer = new IntersectionObserver(ioCallback, { root }); - for (const item of state.renderedItems) { - if (!item.element) - continue; - observer.observe(item.element); - } - return () => { - cancelAnimationFrame(raf); - observer.disconnect(); - }; - }); - }); - const mergeItem = (item, setItems, canDeleteFromMap = false) => { - let prevItem; - setItems((items2) => { - const index = items2.findIndex(({ id }) => id === item.id); - const nextItems = items2.slice(); - if (index !== -1) { - prevItem = items2[index]; - const nextItem = _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, prevItem), item); - nextItems[index] = nextItem; - itemsMap.set(item.id, nextItem); - } else { - nextItems.push(item); - itemsMap.set(item.id, item); - } - return nextItems; - }); - const unmergeItem = () => { - setItems((items2) => { - if (!prevItem) { - if (canDeleteFromMap) { - itemsMap.delete(item.id); - } - return items2.filter(({ id }) => id !== item.id); - } - const index = items2.findIndex(({ id }) => id === item.id); - if (index === -1) - return items2; - const nextItems = items2.slice(); - nextItems[index] = prevItem; - itemsMap.set(item.id, prevItem); - return nextItems; - }); - }; - return unmergeItem; - }; - const registerItem = (item) => mergeItem( - item, - (getItems) => privateStore.setState("items", getItems), - true - ); - return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, collection), { - registerItem, - renderItem: (item) => chain( - registerItem(item), - mergeItem( - item, - (getItems) => privateStore.setState("renderedItems", getItems) - ) - ), - item: (id) => { - if (!id) - return null; - let item = itemsMap.get(id); - if (!item) { - const { items: items2 } = collection.getState(); - item = items2.find((item2) => item2.id === id); - if (item) { - itemsMap.set(id, item); - } - } - return item || null; - }, - // @ts-expect-error Internal - __unstablePrivateStore: privateStore - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js -"use client"; - -// src/utils/array.ts -function toArray(arg) { - if (Array.isArray(arg)) { - return arg; - } - return typeof arg !== "undefined" ? [arg] : []; -} -function addItemToArray(array, item, index = -1) { - if (!(index in array)) { - return [...array, item]; - } - return [...array.slice(0, index), item, ...array.slice(index)]; -} -function flatten2DArray(array) { - const flattened = []; - for (const row of array) { - flattened.push(...row); - } - return flattened; -} -function reverseArray(array) { - return array.slice().reverse(); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/IERTEJ3A.js -"use client"; - - - - - - -// src/composite/composite-store.ts -var IERTEJ3A_NULL_ITEM = { id: null }; -function IERTEJ3A_findFirstEnabledItem(items, excludeId) { - return items.find((item) => { - if (excludeId) { - return !item.disabled && item.id !== excludeId; - } - return !item.disabled; - }); -} -function IERTEJ3A_getEnabledItems(items, excludeId) { - return items.filter((item) => { - if (excludeId) { - return !item.disabled && item.id !== excludeId; - } - return !item.disabled; - }); -} -function getOppositeOrientation(orientation) { - if (orientation === "vertical") - return "horizontal"; - if (orientation === "horizontal") - return "vertical"; - return; -} -function getItemsInRow(items, rowId) { - return items.filter((item) => item.rowId === rowId); -} -function IERTEJ3A_flipItems(items, activeId, shouldInsertNullItem = false) { - const index = items.findIndex((item) => item.id === activeId); - return [ - ...items.slice(index + 1), - ...shouldInsertNullItem ? [IERTEJ3A_NULL_ITEM] : [], - ...items.slice(0, index) - ]; -} -function IERTEJ3A_groupItemsByRows(items) { - const rows = []; - for (const item of items) { - const row = rows.find((currentRow) => { - var _a; - return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; - }); - if (row) { - row.push(item); - } else { - rows.push([item]); - } - } - return rows; -} -function getMaxRowLength(array) { - let maxLength = 0; - for (const { length } of array) { - if (length > maxLength) { - maxLength = length; - } - } - return maxLength; -} -function createEmptyItem(rowId) { - return { - id: "__EMPTY_ITEM__", - disabled: true, - rowId - }; -} -function normalizeRows(rows, activeId, focusShift) { - const maxLength = getMaxRowLength(rows); - for (const row of rows) { - for (let i = 0; i < maxLength; i += 1) { - const item = row[i]; - if (!item || focusShift && item.disabled) { - const isFirst = i === 0; - const previousItem = isFirst && focusShift ? IERTEJ3A_findFirstEnabledItem(row) : row[i - 1]; - row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); - } - } - } - return rows; -} -function verticalizeItems(items) { - const rows = IERTEJ3A_groupItemsByRows(items); - const maxLength = getMaxRowLength(rows); - const verticalized = []; - for (let i = 0; i < maxLength; i += 1) { - for (const row of rows) { - const item = row[i]; - if (item) { - verticalized.push(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, item), { - // If there's no rowId, it means that it's not a grid composite, but - // a single row instead. So, instead of verticalizing it, that is, - // assigning a different rowId based on the column index, we keep it - // undefined so they will be part of the same row. This is useful - // when using up/down on one-dimensional composites. - rowId: item.rowId ? `${i}` : void 0 - })); - } - } - } - return verticalized; -} -function createCompositeStore(props = {}) { - var _a; - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const collection = createCollectionStore(props); - const activeId = defaultValue( - props.activeId, - syncState == null ? void 0 : syncState.activeId, - props.defaultActiveId - ); - const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, collection.getState()), { - activeId, - baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), - includesBaseElement: defaultValue( - props.includesBaseElement, - syncState == null ? void 0 : syncState.includesBaseElement, - activeId === null - ), - moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), - orientation: defaultValue( - props.orientation, - syncState == null ? void 0 : syncState.orientation, - "both" - ), - rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), - virtualFocus: defaultValue( - props.virtualFocus, - syncState == null ? void 0 : syncState.virtualFocus, - false - ), - focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), - focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), - focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) - }); - const composite = createStore(initialState, collection, props.store); - setup( - composite, - () => sync(composite, ["renderedItems", "activeId"], (state) => { - composite.setState("activeId", (activeId2) => { - var _a2; - if (activeId2 !== void 0) - return activeId2; - return (_a2 = IERTEJ3A_findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id; - }); - }) - ); - const getNextId = (items, orientation, hasNullItem, skip) => { - var _a2, _b; - const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState(); - const isHorizontal = orientation !== "vertical"; - const isRTL = rtl && isHorizontal; - const allItems = isRTL ? reverseArray(items) : items; - if (activeId2 == null) { - return (_a2 = IERTEJ3A_findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id; - } - const activeItem = allItems.find((item) => item.id === activeId2); - if (!activeItem) { - return (_b = IERTEJ3A_findFirstEnabledItem(allItems)) == null ? void 0 : _b.id; - } - const isGrid = !!activeItem.rowId; - const activeIndex = allItems.indexOf(activeItem); - const nextItems = allItems.slice(activeIndex + 1); - const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); - if (skip !== void 0) { - const nextEnabledItemsInRow = IERTEJ3A_getEnabledItems(nextItemsInRow, activeId2); - const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. - nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; - return nextItem2 == null ? void 0 : nextItem2.id; - } - const oppositeOrientation = getOppositeOrientation( - // If it's a grid and orientation is not set, it's a next/previous call, - // which is inherently horizontal. up/down will call next with orientation - // set to vertical by default (see below on up/down methods). - isGrid ? orientation || "horizontal" : orientation - ); - const canLoop = focusLoop && focusLoop !== oppositeOrientation; - const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation; - hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement; - if (canLoop) { - const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId); - const sortedItems = IERTEJ3A_flipItems(loopItems, activeId2, hasNullItem); - const nextItem2 = IERTEJ3A_findFirstEnabledItem(sortedItems, activeId2); - return nextItem2 == null ? void 0 : nextItem2.id; - } - if (canWrap) { - const nextItem2 = IERTEJ3A_findFirstEnabledItem( - // We can use nextItems, which contains all the next items, including - // items from other rows, to wrap between rows. However, if there is a - // null item (the composite container), we'll only use the next items in - // the row. So moving next from the last item will focus on the - // composite container. On grid composites, horizontal navigation never - // focuses on the composite container, only vertical. - hasNullItem ? nextItemsInRow : nextItems, - activeId2 - ); - const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; - return nextId; - } - const nextItem = IERTEJ3A_findFirstEnabledItem(nextItemsInRow, activeId2); - if (!nextItem && hasNullItem) { - return null; - } - return nextItem == null ? void 0 : nextItem.id; - }; - return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, collection), composite), { - setBaseElement: (element) => composite.setState("baseElement", element), - setActiveId: (id) => composite.setState("activeId", id), - move: (id) => { - if (id === void 0) - return; - composite.setState("activeId", id); - composite.setState("moves", (moves) => moves + 1); - }, - first: () => { - var _a2; - return (_a2 = IERTEJ3A_findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id; - }, - last: () => { - var _a2; - return (_a2 = IERTEJ3A_findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; - }, - next: (skip) => { - const { renderedItems, orientation } = composite.getState(); - return getNextId(renderedItems, orientation, false, skip); - }, - previous: (skip) => { - var _a2; - const { renderedItems, orientation, includesBaseElement } = composite.getState(); - const isGrid = !!((_a2 = IERTEJ3A_findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId); - const hasNullItem = !isGrid && includesBaseElement; - return getNextId( - reverseArray(renderedItems), - orientation, - hasNullItem, - skip - ); - }, - down: (skip) => { - const { - activeId: activeId2, - renderedItems, - focusShift, - focusLoop, - includesBaseElement - } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = verticalizeItems( - flatten2DArray( - normalizeRows(IERTEJ3A_groupItemsByRows(renderedItems), activeId2, shouldShift) - ) - ); - const canLoop = focusLoop && focusLoop !== "horizontal"; - const hasNullItem = canLoop && includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); - }, - up: (skip) => { - const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = verticalizeItems( - reverseArray( - flatten2DArray( - normalizeRows( - IERTEJ3A_groupItemsByRows(renderedItems), - activeId2, - shouldShift - ) - ) - ) - ); - const hasNullItem = includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); - } - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/combobox/combobox-store.js -"use client"; - - - - - - - - - - - - -// src/combobox/combobox-store.ts -var isSafariOnMobile = isSafari() && isTouchDevice(); -function createComboboxStore(props = {}) { - var _a; - throwOnConflictingProps(props, props.store); - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const activeId = defaultValue( - props.activeId, - syncState == null ? void 0 : syncState.activeId, - props.defaultActiveId, - null - ); - const composite = createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { - activeId, - includesBaseElement: defaultValue( - props.includesBaseElement, - syncState == null ? void 0 : syncState.includesBaseElement, - true - ), - orientation: defaultValue( - props.orientation, - syncState == null ? void 0 : syncState.orientation, - "vertical" - ), - focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true), - focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true), - virtualFocus: defaultValue( - props.virtualFocus, - syncState == null ? void 0 : syncState.virtualFocus, - !isSafariOnMobile - ) - })); - const popover = createPopoverStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { - placement: defaultValue( - props.placement, - syncState == null ? void 0 : syncState.placement, - "bottom-start" - ) - })); - const value = defaultValue( - props.value, - syncState == null ? void 0 : syncState.value, - props.defaultValue, - "" - ); - const selectedValue = defaultValue( - props.selectedValue, - syncState == null ? void 0 : syncState.selectedValue, - props.defaultSelectedValue, - "" - ); - const multiSelectable = Array.isArray(selectedValue); - const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite.getState()), popover.getState()), { - value, - selectedValue, - resetValueOnSelect: defaultValue( - props.resetValueOnSelect, - syncState == null ? void 0 : syncState.resetValueOnSelect, - multiSelectable - ), - resetValueOnHide: defaultValue( - props.resetValueOnHide, - syncState == null ? void 0 : syncState.resetValueOnHide, - multiSelectable - ), - activeValue: syncState == null ? void 0 : syncState.activeValue - }); - const combobox = createStore(initialState, composite, popover, props.store); - setup( - combobox, - () => sync(combobox, ["resetValueOnHide", "mounted"], (state) => { - if (!state.resetValueOnHide) - return; - if (state.mounted) - return; - combobox.setState("value", value); - }) - ); - setup( - combobox, - () => sync(combobox, ["resetValueOnSelect", "selectedValue"], (state) => { - if (!state.resetValueOnSelect) - return; - combobox.setState("value", value); - }) - ); - setup( - combobox, - () => batch(combobox, ["mounted"], (state) => { - if (state.mounted) - return; - combobox.setState("activeId", activeId); - combobox.setState("moves", 0); - }) - ); - setup( - combobox, - () => sync(combobox, ["moves", "activeId"], (state, prevState) => { - if (state.moves === prevState.moves) { - combobox.setState("activeValue", void 0); - } - }) - ); - setup( - combobox, - () => batch(combobox, ["moves", "renderedItems"], (state, prev) => { - if (state.moves === prev.moves) - return; - const { activeId: activeId2 } = combobox.getState(); - const activeItem = composite.item(activeId2); - combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value); - }) - ); - return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, popover), composite), combobox), { - setValue: (value2) => combobox.setState("value", value2), - setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2) - }); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZKJ2WLF7.js -"use client"; - - - - -// src/combobox/combobox-store.ts - -function useComboboxStoreProps(store, update, props) { - store = usePopoverStoreProps(store, update, props); - store = useCompositeStoreProps(store, update, props); - useStoreProps(store, props, "value", "setValue"); - useStoreProps(store, props, "selectedValue", "setSelectedValue"); - useStoreProps(store, props, "resetValueOnHide"); - useStoreProps(store, props, "resetValueOnSelect"); - return store; -} -function useComboboxStore(props = {}) { - const [store, update] = EKQEJRUF_useStore(createComboboxStore, props); - return useComboboxStoreProps(store, update, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OAYFXAQ2.js -"use client"; - - -// src/disclosure/disclosure-context.tsx -var OAYFXAQ2_ctx = createStoreContext(); -var useDisclosureContext = OAYFXAQ2_ctx.useContext; -var useDisclosureScopedContext = OAYFXAQ2_ctx.useScopedContext; -var useDisclosureProviderContext = OAYFXAQ2_ctx.useProviderContext; -var DisclosureContextProvider = OAYFXAQ2_ctx.ContextProvider; -var DisclosureScopedContextProvider = OAYFXAQ2_ctx.ScopedContextProvider; - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6BJYYBK.js -"use client"; - - - -// src/dialog/dialog-context.tsx - -var G6BJYYBK_ctx = createStoreContext( - [DisclosureContextProvider], - [DisclosureScopedContextProvider] -); -var useDialogContext = G6BJYYBK_ctx.useContext; -var useDialogScopedContext = G6BJYYBK_ctx.useScopedContext; -var useDialogProviderContext = G6BJYYBK_ctx.useProviderContext; -var DialogContextProvider = G6BJYYBK_ctx.ContextProvider; -var DialogScopedContextProvider = G6BJYYBK_ctx.ScopedContextProvider; -var DialogHeadingContext = (0,external_React_.createContext)(void 0); -var DialogDescriptionContext = (0,external_React_.createContext)(void 0); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7H5KSHHF.js -"use client"; - - - -// src/popover/popover-context.tsx -var _7H5KSHHF_ctx = createStoreContext( - [DialogContextProvider], - [DialogScopedContextProvider] -); -var usePopoverContext = _7H5KSHHF_ctx.useContext; -var usePopoverScopedContext = _7H5KSHHF_ctx.useScopedContext; -var usePopoverProviderContext = _7H5KSHHF_ctx.useProviderContext; -var PopoverContextProvider = _7H5KSHHF_ctx.ContextProvider; -var PopoverScopedContextProvider = _7H5KSHHF_ctx.ScopedContextProvider; - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/W76OTZCC.js -"use client"; - - - - -// src/combobox/combobox-context.tsx - -var W76OTZCC_ctx = createStoreContext( - [PopoverContextProvider, CompositeContextProvider], - [PopoverScopedContextProvider, CompositeScopedContextProvider] -); -var useComboboxContext = W76OTZCC_ctx.useContext; -var useComboboxScopedContext = W76OTZCC_ctx.useScopedContext; -var useComboboxProviderContext = W76OTZCC_ctx.useProviderContext; -var ComboboxContextProvider = W76OTZCC_ctx.ContextProvider; -var ComboboxScopedContextProvider = W76OTZCC_ctx.ScopedContextProvider; -var ComboboxItemValueContext = (0,external_React_.createContext)( - void 0 -); -var ComboboxItemCheckedContext = (0,external_React_.createContext)(false); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js -"use client"; - - - - - - - - - - - - - - - - - - -// src/combobox/combobox-provider.tsx - -function ComboboxProvider(props = {}) { - const store = useComboboxStore(props); - return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxContextProvider, { value: store, children: props.children }); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js -"use client"; - - - - - - - - - - - -// src/combobox/combobox-label.ts - -var useComboboxLabel = createHook( - (_a) => { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const context = useComboboxProviderContext(); - store = store || context; - invariant( - store, - false && 0 - ); - const comboboxId = store.useState((state) => { - var _a2; - return (_a2 = state.baseElement) == null ? void 0 : _a2.id; - }); - props = _4R3V3JGP_spreadValues({ - htmlFor: comboboxId - }, props); - return props; - } -); -var ComboboxLabel = createMemoComponent( - (props) => { - const htmlProps = useComboboxLabel(props); - return createElement("label", htmlProps); - } -); -if (false) {} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JCH6MLL2.js -"use client"; - - - - - -// src/popover/popover-anchor.ts -var usePopoverAnchor = createHook( - (_a) => { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const context = usePopoverProviderContext(); - store = store || context; - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { - ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref) - }); - return props; - } -); -var PopoverAnchor = createComponent((props) => { - const htmlProps = usePopoverAnchor(props); - return createElement("div", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SHA3WOPI.js -"use client"; - -// src/focusable/focusable-context.ts - -var FocusableContext = (0,external_React_.createContext)(true); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KK7H3W2B.js -"use client"; - - - - - -// src/focusable/focusable.ts - - - - - - + element.scrollIntoView(_chunks_3YLGPPWQ_spreadValues({ block: "nearest", inline: "nearest" }, options)); + } +} + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/LVA2YJMS.js +"use client"; + + + + + +// src/focusable/focusable.tsx + + + + + + +var LVA2YJMS_TagName = "div"; var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", @@ -29397,25 +30946,29 @@ "datetime", "datetime-local" ]; +var safariFocusAncestorSymbol = Symbol("safariFocusAncestor"); +function isSafariFocusAncestor(element) { + if (!element) return false; + return !!element[safariFocusAncestorSymbol]; +} +function markSafariFocusAncestor(element, value) { + if (!element) return; + element[safariFocusAncestorSymbol] = value; +} function isAlwaysFocusVisible(element) { const { tagName, readOnly, type } = element; - if (tagName === "TEXTAREA" && !readOnly) - return true; - if (tagName === "SELECT" && !readOnly) - return true; + if (tagName === "TEXTAREA" && !readOnly) return true; + if (tagName === "SELECT" && !readOnly) return true; if (tagName === "INPUT" && !readOnly) { return alwaysFocusVisibleInputTypes.includes(type); } - if (element.isContentEditable) + if (element.isContentEditable) return true; + const role = element.getAttribute("role"); + if (role === "combobox" && element.dataset.name) { return true; + } return false; } -function isAlwaysFocusVisibleDelayed(element) { - const role = element.getAttribute("role"); - if (role !== "combobox") - return false; - return !!element.dataset.name; -} function getLabels(element) { if ("labels" in element) { return element.labels; @@ -29430,13 +30983,11 @@ return false; } function isNativeTabbable(tagName) { - if (!tagName) - return true; - return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; + if (!tagName) return true; + return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; } function supportsDisabledAttribute(tagName) { - if (!tagName) - return true; + if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; } function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { @@ -29457,8 +31008,7 @@ function useDisableEvent(onEvent, disabled) { return useEvent((event) => { onEvent == null ? void 0 : onEvent(event); - if (event.defaultPrevented) - return; + if (event.defaultPrevented) return; if (disabled) { event.stopPropagation(); event.preventDefault(); @@ -29475,16 +31025,13 @@ } } function onGlobalKeyDown(event) { - if (event.metaKey) - return; - if (event.ctrlKey) - return; - if (event.altKey) - return; + if (event.metaKey) return; + if (event.ctrlKey) return; + if (event.altKey) return; isKeyboardModality = true; } var useFocusable = createHook( - (_a) => { + function useFocusable2(_a) { var _b = _a, { focusable = true, accessibleWhenDisabled, @@ -29498,29 +31045,26 @@ ]); const ref = (0,external_React_.useRef)(null); (0,external_React_.useEffect)(() => { - if (!focusable) - return; + if (!focusable) return; addGlobalEventListener("mousedown", onGlobalMouseDown, true); addGlobalEventListener("keydown", onGlobalKeyDown, true); }, [focusable]); if (isSafariBrowser) { (0,external_React_.useEffect)(() => { - if (!focusable) - return; + if (!focusable) return; const element = ref.current; - if (!element) - return; - if (!isNativeCheckboxOrRadio(element)) - return; + if (!element) return; + if (!isNativeCheckboxOrRadio(element)) return; const labels = getLabels(element); - if (!labels) - return; + if (!labels) return; const onMouseUp = () => queueMicrotask(() => element.focus()); - labels.forEach((label) => label.addEventListener("mouseup", onMouseUp)); + for (const label of labels) { + label.addEventListener("mouseup", onMouseUp); + } return () => { - labels.forEach( - (label) => label.removeEventListener("mouseup", onMouseUp) - ); + for (const label of labels) { + label.removeEventListener("mouseup", onMouseUp); + } }; }, [focusable]); } @@ -29528,22 +31072,17 @@ const trulyDisabled = !!disabled && !accessibleWhenDisabled; const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { - if (!focusable) - return; + if (!focusable) return; if (trulyDisabled && focusVisible) { setFocusVisible(false); } }, [focusable, trulyDisabled, focusVisible]); (0,external_React_.useEffect)(() => { - if (!focusable) - return; - if (!focusVisible) - return; + if (!focusable) return; + if (!focusVisible) return; const element = ref.current; - if (!element) - return; - if (typeof IntersectionObserver === "undefined") - return; + if (!element) return; + if (typeof IntersectionObserver === "undefined") return; const observer = new IntersectionObserver(() => { if (!isFocusable(element)) { setFocusVisible(false); @@ -29564,27 +31103,24 @@ const onMouseDownProp = props.onMouseDown; const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); - if (event.defaultPrevented) - return; - if (!focusable) - return; + if (event.defaultPrevented) return; + if (!focusable) return; const element = event.currentTarget; - if (!isSafariBrowser) - return; - if (isPortalEvent(event)) - return; - if (!isButton(element) && !isNativeCheckboxOrRadio(element)) - return; + if (!isSafariBrowser) return; + if (isPortalEvent(event)) return; + if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return; let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; element.addEventListener("focusin", onFocus, options); + const focusableContainer = getClosestFocusable(element.parentElement); + markSafariFocusAncestor(focusableContainer, true); queueBeforeEvent(element, "mouseup", () => { element.removeEventListener("focusin", onFocus, true); - if (receivedFocus) - return; + markSafariFocusAncestor(focusableContainer, false); + if (receivedFocus) return; focusIfNeeded(element); }); }); @@ -29592,47 +31128,34 @@ if (currentTarget) { event.currentTarget = currentTarget; } - if (!focusable) - return; + if (!focusable) return; const element = event.currentTarget; - if (!element) - return; - if (!hasFocus(element)) - return; + if (!element) return; + if (!hasFocus(element)) return; onFocusVisible == null ? void 0 : onFocusVisible(event); - if (event.defaultPrevented) - return; + if (event.defaultPrevented) return; + element.dataset.focusVisible = "true"; setFocusVisible(true); }; const onKeyDownCaptureProp = props.onKeyDownCapture; - const onKeyDownCapture = useEvent( - (event) => { - onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); - if (event.defaultPrevented) - return; - if (!focusable) - return; - if (focusVisible) - return; - if (event.metaKey) - return; - if (event.altKey) - return; - if (event.ctrlKey) - return; - if (!isSelfTarget(event)) - return; - const element = event.currentTarget; - queueMicrotask(() => handleFocusVisible(event, element)); - } - ); + const onKeyDownCapture = useEvent((event) => { + onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); + if (event.defaultPrevented) return; + if (!focusable) return; + if (focusVisible) return; + if (event.metaKey) return; + if (event.altKey) return; + if (event.ctrlKey) return; + if (!isSelfTarget(event)) return; + const element = event.currentTarget; + const applyFocusVisible = () => handleFocusVisible(event, element); + queueBeforeEvent(element, "focusout", applyFocusVisible); + }); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); - if (event.defaultPrevented) - return; - if (!focusable) - return; + if (event.defaultPrevented) return; + if (!focusable) return; if (!isSelfTarget(event)) { setFocusVisible(false); return; @@ -29640,8 +31163,6 @@ const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); if (isKeyboardModality || isAlwaysFocusVisible(event.target)) { - queueMicrotask(applyFocusVisible); - } else if (isAlwaysFocusVisibleDelayed(event.target)) { queueBeforeEvent(event.target, "focusout", applyFocusVisible); } else { setFocusVisible(false); @@ -29650,38 +31171,36 @@ const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); - if (!focusable) - return; - if (!isFocusEventOutside(event)) - return; + if (!focusable) return; + if (!isFocusEventOutside(event)) return; setFocusVisible(false); }); const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext); const autoFocusRef = useEvent((element) => { - if (!focusable) - return; - if (!autoFocus) - return; - if (!element) - return; - if (!autoFocusOnShow) - return; + if (!focusable) return; + if (!autoFocus) return; + if (!element) return; + if (!autoFocusOnShow) return; queueMicrotask(() => { - if (hasFocus(element)) - return; - if (!isFocusable(element)) - return; + if (hasFocus(element)) return; + if (!isFocusable(element)) return; element.focus(); }); }); - const tagName = useTagName(ref, props.as); + const tagName = useTagName(ref); const nativeTabbable = focusable && isNativeTabbable(tagName); const supportsDisabled = focusable && supportsDisabledAttribute(tagName); - const style = trulyDisabled ? _4R3V3JGP_spreadValues({ pointerEvents: "none" }, props.style) : props.style; - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ - "data-focus-visible": focusable && focusVisible ? "" : void 0, - "data-autofocus": autoFocus ? true : void 0, - "aria-disabled": disabled ? true : void 0 + const styleProp = props.style; + const style = (0,external_React_.useMemo)(() => { + if (trulyDisabled) { + return _3YLGPPWQ_spreadValues({ pointerEvents: "none" }, styleProp); + } + return styleProp; + }, [trulyDisabled, styleProp]); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + "data-focus-visible": focusable && focusVisible || void 0, + "data-autofocus": autoFocus || void 0, + "aria-disabled": disabled || void 0 }, props), { ref: useMergeRefs(ref, autoFocusRef, props.ref), style, @@ -29703,18 +31222,17 @@ onFocusCapture, onBlur }); - return props; + return removeUndefinedValues(props); } ); -var Focusable = createComponent((props) => { - props = useFocusable(props); - return createElement("div", props); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7QTPYGNZ.js +var Focusable = forwardRef2(function Focusable2(props) { + const htmlProps = useFocusable(props); + return createElement(LVA2YJMS_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/ITI7HKP4.js "use client"; @@ -29731,13 +31249,13 @@ +var ITI7HKP4_TagName = "div"; function isGrid(items) { return items.some((item) => !!item.rowId); } function isPrintableKey(event) { const target = event.target; - if (target && !DLOEKDPY_isTextField(target)) - return false; + if (target && !isTextField(target)) return false; return event.key.length === 1 && !event.ctrlKey && !event.metaKey; } function isModifierKey(event) { @@ -29747,20 +31265,14 @@ return useEvent((event) => { var _a; onKeyboardEvent == null ? void 0 : onKeyboardEvent(event); - if (event.defaultPrevented) - return; - if (event.isPropagationStopped()) - return; - if (!isSelfTarget(event)) - return; - if (isModifierKey(event)) - return; - if (isPrintableKey(event)) - return; + if (event.defaultPrevented) return; + if (event.isPropagationStopped()) return; + if (!isSelfTarget(event)) return; + if (isModifierKey(event)) return; + if (isPrintableKey(event)) return; const state = store.getState(); const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element; - if (!activeElement) - return; + if (!activeElement) return; const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]); const previousElement = previousElementRef == null ? void 0 : previousElementRef.current; if (activeElement !== previousElement) { @@ -29775,8 +31287,8 @@ }); } function findFirstEnabledItemInTheLastRow(items) { - return findFirstEnabledItem( - flatten2DArray(reverseArray(groupItemsByRows(items))) + return _5VQZOHHZ_findFirstEnabledItem( + flatten2DArray(reverseArray(_5VQZOHHZ_groupItemsByRows(items))) ); } function useScheduleFocus(store) { @@ -29787,17 +31299,15 @@ ); (0,external_React_.useEffect)(() => { const activeElement = activeItem == null ? void 0 : activeItem.element; - if (!scheduled) - return; - if (!activeElement) - return; + if (!scheduled) return; + if (!activeElement) return; setScheduled(false); activeElement.focus({ preventScroll: true }); }, [activeItem, scheduled]); return schedule; } var useComposite = createHook( - (_a) => { + function useComposite2(_a) { var _b = _a, { store, composite = true, @@ -29815,38 +31325,32 @@ store, false && 0 ); + const ref = (0,external_React_.useRef)(null); const previousElementRef = (0,external_React_.useRef)(null); const scheduleFocus = useScheduleFocus(store); const moves = store.useState("moves"); + const [, setBaseElement] = useTransactionState( + composite ? store.setBaseElement : null + ); (0,external_React_.useEffect)(() => { var _a2; - if (!store) - return; - if (!moves) - return; - if (!composite) - return; - if (!focusOnMove) - return; + if (!store) return; + if (!moves) return; + if (!composite) return; + if (!focusOnMove) return; const { activeId: activeId2 } = store.getState(); const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; - if (!itemElement) - return; + if (!itemElement) return; focusIntoView(itemElement); }, [store, moves, composite, focusOnMove]); useSafeLayoutEffect(() => { - if (!store) - return; - if (!moves) - return; - if (!composite) - return; + if (!store) return; + if (!moves) return; + if (!composite) return; const { baseElement, activeId: activeId2 } = store.getState(); const isSelfAcive = activeId2 === null; - if (!isSelfAcive) - return; - if (!baseElement) - return; + if (!isSelfAcive) return; + if (!baseElement) return; const previousElement = previousElementRef.current; previousElementRef.current = null; if (previousElement) { @@ -29860,20 +31364,15 @@ const virtualFocus = store.useState("virtualFocus"); useSafeLayoutEffect(() => { var _a2; - if (!store) - return; - if (!composite) - return; - if (!virtualFocus) - return; + if (!store) return; + if (!composite) return; + if (!virtualFocus) return; const previousElement = previousElementRef.current; previousElementRef.current = null; - if (!previousElement) - return; + if (!previousElement) return; const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element; - const relatedTarget = activeElement || DLOEKDPY_getActiveElement(previousElement); - if (relatedTarget === previousElement) - return; + const relatedTarget = activeElement || DTR5TSDJ_getActiveElement(previousElement); + if (relatedTarget === previousElement) return; fireBlurEvent(previousElement, { relatedTarget }); }, [store, activeId, virtualFocus, composite]); const onKeyDownCapture = useKeyboardEventProxy( @@ -29889,13 +31388,10 @@ const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); - if (event.defaultPrevented) - return; - if (!store) - return; + if (event.defaultPrevented) return; + if (!store) return; const { virtualFocus: virtualFocus2 } = store.getState(); - if (!virtualFocus2) - return; + if (!virtualFocus2) return; const previousActiveElement = event.relatedTarget; const isSilentlyFocused = silentlyFocused(event.currentTarget); if (isSelfTarget(event) && isSilentlyFocused) { @@ -29906,12 +31402,9 @@ const onFocusProp = props.onFocus; const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); - if (event.defaultPrevented) - return; - if (!composite) - return; - if (!store) - return; + if (event.defaultPrevented) return; + if (!composite) return; + if (!store) return; const { relatedTarget } = event; const { virtualFocus: virtualFocus2 } = store.getState(); if (virtualFocus2) { @@ -29926,13 +31419,10 @@ const onBlurCapture = useEvent((event) => { var _a2; onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); - if (event.defaultPrevented) - return; - if (!store) - return; + if (event.defaultPrevented) return; + if (!store) return; const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState(); - if (!virtualFocus2) - return; + if (!virtualFocus2) return; const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; const nextActiveElement = event.relatedTarget; const nextActiveElementIsItem = isItem(store, nextActiveElement); @@ -29961,25 +31451,20 @@ const onKeyDown = useEvent((event) => { var _a2; onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; - if (!store) - return; - if (!isSelfTarget(event)) - return; - const { orientation, items, renderedItems, activeId: activeId2 } = store.getState(); + if (event.defaultPrevented) return; + if (!store) return; + if (!isSelfTarget(event)) return; + const { orientation, renderedItems, activeId: activeId2 } = store.getState(); const activeItem = getEnabledItem(store, activeId2); - if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) - return; + if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return; const isVertical = orientation !== "horizontal"; const isHorizontal = orientation !== "vertical"; const grid = isGrid(renderedItems); const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End"; - if (isHorizontalKey && DLOEKDPY_isTextField(event.currentTarget)) - return; + if (isHorizontalKey && isTextField(event.currentTarget)) return; const up = () => { if (grid) { - const item = items && findFirstEnabledItemInTheLastRow(items); + const item = findFirstEnabledItemInTheLastRow(renderedItems); return item == null ? void 0 : item.id; } return store == null ? void 0 : store.last(); @@ -29998,8 +31483,7 @@ if (action) { const id = action(); if (id !== void 0) { - if (!moveOnKeyPressProp(event)) - return; + if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store.move(id); } @@ -30012,18 +31496,15 @@ ); const activeDescendant = store.useState((state) => { var _a2; - if (!store) - return; - if (!composite) - return; - if (!state.virtualFocus) - return; + if (!store) return; + if (!composite) return; + if (!state.virtualFocus) return; return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id; }); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ "aria-activedescendant": activeDescendant }, props), { - ref: useMergeRefs(composite ? store.setBaseElement : null, props.ref), + ref: useMergeRefs(ref, setBaseElement, props.ref), onKeyDownCapture, onKeyUpCapture, onFocusCapture, @@ -30034,57 +31515,52 @@ const focusable = store.useState( (state) => composite && (state.virtualFocus || state.activeId === null) ); - props = useFocusable(_4R3V3JGP_spreadValues({ focusable }, props)); + props = useFocusable(_3YLGPPWQ_spreadValues({ focusable }, props)); return props; } ); -var _7QTPYGNZ_Composite = createComponent((props) => { +var Composite = forwardRef2(function Composite2(props) { const htmlProps = useComposite(props); - return createElement("div", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: external "ReactDOM" -const external_ReactDOM_namespaceObject = window["ReactDOM"]; -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/combobox/combobox.js -"use client"; - - - - - - - - - - - - - - - - -// src/combobox/combobox.ts - - - - - - + return createElement(ITI7HKP4_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/combobox/combobox.js +"use client"; + + + + + + + + + + + + + + + + +// src/combobox/combobox.tsx + + + + + + +var combobox_TagName = "input"; function isFirstItemAutoSelected(items, activeValue, autoSelect) { - if (!autoSelect) - return false; + if (!autoSelect) return false; const firstItem = items.find((item) => !item.disabled && item.value); return (firstItem == null ? void 0 : firstItem.value) === activeValue; } function hasCompletionString(value, activeValue) { - if (!activeValue) - return false; - if (value == null) - return false; - value = normalizeString(value); + if (!activeValue) return false; + if (value == null) return false; + value = PBFD2E7P_normalizeString(value); return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0; } function isInputEvent(event) { @@ -30093,18 +31569,30 @@ function isAriaAutoCompleteValue(value) { return value === "inline" || value === "list" || value === "both" || value === "none"; } +function getDefaultAutoSelectId(items) { + const item = items.find((item2) => { + var _a; + if (item2.disabled) return false; + return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab"; + }); + return item == null ? void 0 : item.id; +} var useCombobox = createHook( - (_a) => { + function useCombobox2(_a) { var _b = _a, { store, focusable = true, autoSelect: autoSelectProp = false, getAutoSelectId, - showOnChange = true, - setValueOnChange = true, - showOnMouseDown = true, + setValueOnChange, + showMinLength = 0, + showOnChange, + showOnMouseDown, + showOnClick = showOnMouseDown, + showOnKeyDown, + showOnKeyPress = showOnKeyDown, + blurActiveItemOnClick, setValueOnClick = true, - showOnKeyDown = true, moveOnKeyPress = true, autoComplete = "list" } = _b, props = __objRest(_b, [ @@ -30112,11 +31600,15 @@ "focusable", "autoSelect", "getAutoSelectId", + "setValueOnChange", + "showMinLength", "showOnChange", - "setValueOnChange", "showOnMouseDown", + "showOnClick", + "showOnKeyDown", + "showOnKeyPress", + "blurActiveItemOnClick", "setValueOnClick", - "showOnKeyDown", "moveOnKeyPress", "autoComplete" ]); @@ -30131,45 +31623,54 @@ const canAutoSelectRef = (0,external_React_.useRef)(false); const composingRef = (0,external_React_.useRef)(false); const autoSelect = store.useState( - (state) => !!autoSelectProp && state.virtualFocus + (state) => state.virtualFocus && autoSelectProp ); const inline = autoComplete === "inline" || autoComplete === "both"; const [canInline, setCanInline] = (0,external_React_.useState)(inline); useUpdateLayoutEffect(() => { - if (!inline) - return; + if (!inline) return; setCanInline(true); }, [inline]); const storeValue = store.useState("value"); - const activeValue = store.useState( - (state) => inline && canInline ? state.activeValue : void 0 - ); + const prevSelectedValueRef = (0,external_React_.useRef)(); + (0,external_React_.useEffect)(() => { + return sync(store, ["selectedValue", "activeId"], (_, prev) => { + prevSelectedValueRef.current = prev.selectedValue; + }); + }, []); + const inlineActiveValue = store.useState((state) => { + var _a2; + if (!inline) return; + if (!canInline) return; + if (state.activeValue && Array.isArray(state.selectedValue)) { + if (state.selectedValue.includes(state.activeValue)) return; + if ((_a2 = prevSelectedValueRef.current) == null ? void 0 : _a2.includes(state.activeValue)) return; + } + return state.activeValue; + }); const items = store.useState("renderedItems"); const open = store.useState("open"); const contentElement = store.useState("contentElement"); const value = (0,external_React_.useMemo)(() => { - if (!inline) - return storeValue; - if (!canInline) - return storeValue; + if (!inline) return storeValue; + if (!canInline) return storeValue; const firstItemAutoSelected = isFirstItemAutoSelected( items, - activeValue, + inlineActiveValue, autoSelect ); if (firstItemAutoSelected) { - if (hasCompletionString(storeValue, activeValue)) { - const slice = (activeValue == null ? void 0 : activeValue.slice(storeValue.length)) || ""; + if (hasCompletionString(storeValue, inlineActiveValue)) { + const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || ""; return storeValue + slice; } return storeValue; } - return activeValue || storeValue; - }, [inline, canInline, items, activeValue, autoSelect, storeValue]); + return inlineActiveValue || storeValue; + }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]); (0,external_React_.useEffect)(() => { const element = ref.current; - if (!element) - return; + if (!element) return; const onCompositeItemMove = () => setCanInline(true); element.addEventListener("combobox-item-move", onCompositeItemMove); return () => { @@ -30177,32 +31678,38 @@ }; }, []); (0,external_React_.useEffect)(() => { - if (!inline) - return; - if (!canInline) - return; - if (!activeValue) - return; + if (!inline) return; + if (!canInline) return; + if (!inlineActiveValue) return; const firstItemAutoSelected = isFirstItemAutoSelected( items, - activeValue, + inlineActiveValue, autoSelect ); - if (!firstItemAutoSelected) - return; - if (!hasCompletionString(storeValue, activeValue)) - return; + if (!firstItemAutoSelected) return; + if (!hasCompletionString(storeValue, inlineActiveValue)) return; + let cleanup = PBFD2E7P_noop; queueMicrotask(() => { const element = ref.current; - if (!element) - return; - setSelectionRange(element, storeValue.length, activeValue.length); - }); + if (!element) return; + const { start: prevStart, end: prevEnd } = getTextboxSelection(element); + const nextStart = storeValue.length; + const nextEnd = inlineActiveValue.length; + setSelectionRange(element, nextStart, nextEnd); + cleanup = () => { + if (!hasFocus(element)) return; + const { start, end } = getTextboxSelection(element); + if (start !== nextStart) return; + if (end !== nextEnd) return; + setSelectionRange(element, prevStart, prevEnd); + }; + }); + return () => cleanup(); }, [ valueUpdated, inline, canInline, - activeValue, + inlineActiveValue, items, autoSelect, storeValue @@ -30211,60 +31718,50 @@ const getAutoSelectIdProp = useEvent(getAutoSelectId); const autoSelectIdRef = (0,external_React_.useRef)(null); (0,external_React_.useEffect)(() => { - if (!open) - return; - if (!contentElement) - return; + if (!open) return; + if (!contentElement) return; const scrollingElement = getScrollingElement(contentElement); - if (!scrollingElement) - return; + if (!scrollingElement) return; scrollingElementRef.current = scrollingElement; - const onWheel = () => { + const onUserScroll = () => { canAutoSelectRef.current = false; }; const onScroll = () => { - if (!store) - return; - if (!canAutoSelectRef.current) - return; + if (!store) return; + if (!canAutoSelectRef.current) return; const { activeId } = store.getState(); - if (activeId === null) - return; - if (activeId === autoSelectIdRef.current) - return; + if (activeId === null) return; + if (activeId === autoSelectIdRef.current) return; canAutoSelectRef.current = false; }; const options = { passive: true, capture: true }; - scrollingElement.addEventListener("wheel", onWheel, options); + scrollingElement.addEventListener("wheel", onUserScroll, options); + scrollingElement.addEventListener("touchmove", onUserScroll, options); scrollingElement.addEventListener("scroll", onScroll, options); return () => { - scrollingElement.removeEventListener("wheel", onWheel, true); + scrollingElement.removeEventListener("wheel", onUserScroll, true); + scrollingElement.removeEventListener("touchmove", onUserScroll, true); scrollingElement.removeEventListener("scroll", onScroll, true); }; }, [open, contentElement, store]); useSafeLayoutEffect(() => { - if (!storeValue) - return; - if (composingRef.current) - return; + if (!storeValue) return; + if (composingRef.current) return; canAutoSelectRef.current = true; }, [storeValue]); useSafeLayoutEffect(() => { - if (open) - return; - canAutoSelectRef.current = false; - }, [open]); + if (autoSelect !== "always" && open) return; + canAutoSelectRef.current = open; + }, [autoSelect, open]); const resetValueOnSelect = store.useState("resetValueOnSelect"); useUpdateEffect(() => { - var _a2; + var _a2, _b2; const canAutoSelect = canAutoSelectRef.current; - if (!store) - return; - if ((!autoSelect || !canAutoSelect) && !resetValueOnSelect) - return; + if (!store) return; + if (!open) return; + if (!canAutoSelect && !resetValueOnSelect) return; const { baseElement, contentElement: contentElement2, activeId } = store.getState(); - if (baseElement && !hasFocus(baseElement)) - return; + if (baseElement && !hasFocus(baseElement)) return; if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) { const observer = new MutationObserver(forceValueUpdate); observer.observe(contentElement2, { attributeFilter: ["data-placing"] }); @@ -30272,11 +31769,11 @@ } if (autoSelect && canAutoSelect) { const userAutoSelectId = getAutoSelectIdProp(items); - const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : store.first(); + const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a2 = getDefaultAutoSelectId(items)) != null ? _a2 : store.first(); autoSelectIdRef.current = autoSelectId; store.move(autoSelectId != null ? autoSelectId : null); } else { - const element = (_a2 = store.item(activeId)) == null ? void 0 : _a2.element; + const element = (_b2 = store.item(activeId || store.first())) == null ? void 0 : _b2.element; if (element && "scrollIntoView" in element) { element.scrollIntoView({ block: "nearest", inline: "nearest" }); } @@ -30284,6 +31781,7 @@ return; }, [ store, + open, valueUpdated, storeValue, autoSelect, @@ -30292,11 +31790,9 @@ items ]); (0,external_React_.useEffect)(() => { - if (!inline) - return; + if (!inline) return; const combobox = ref.current; - if (!combobox) - return; + if (!combobox) return; const elements = [combobox, contentElement].filter( (value2) => !!value2 ); @@ -30305,21 +31801,32 @@ store == null ? void 0 : store.setValue(value); } }; - elements.forEach((el) => el.addEventListener("focusout", onBlur2)); + for (const element of elements) { + element.addEventListener("focusout", onBlur2); + } return () => { - elements.forEach((el) => el.removeEventListener("focusout", onBlur2)); + for (const element of elements) { + element.removeEventListener("focusout", onBlur2); + } }; }, [inline, contentElement, store, value]); + const canShow = (event) => { + const currentTarget = event.currentTarget; + return currentTarget.value.length >= showMinLength; + }; const onChangeProp = props.onChange; - const showOnChangeProp = useBooleanEvent(showOnChange); - const setValueOnChangeProp = useBooleanEvent(setValueOnChange); + const showOnChangeProp = useBooleanEvent(showOnChange != null ? showOnChange : canShow); + const setValueOnChangeProp = useBooleanEvent( + // If the combobox is combined with tags, the value will be set by the tag + // input component. + setValueOnChange != null ? setValueOnChange : !store.tag + ); const onChange = useEvent((event) => { onChangeProp == null ? void 0 : onChangeProp(event); - if (event.defaultPrevented) - return; - if (!store) - return; - const { value: value2, selectionStart, selectionEnd } = event.target; + if (event.defaultPrevented) return; + if (!store) return; + const currentTarget = event.currentTarget; + const { value: value2, selectionStart, selectionEnd } = currentTarget; const nativeEvent = event.nativeEvent; canAutoSelectRef.current = true; if (isInputEvent(nativeEvent)) { @@ -30335,8 +31842,10 @@ } if (setValueOnChangeProp(event)) { const isSameValue = value2 === store.getState().value; - (0,external_ReactDOM_namespaceObject.flushSync)(() => store == null ? void 0 : store.setValue(value2)); - setSelectionRange(event.currentTarget, selectionStart, selectionEnd); + store.setValue(value2); + queueMicrotask(() => { + setSelectionRange(currentTarget, selectionStart, selectionEnd); + }); if (inline && autoSelect && isSameValue) { forceValueUpdate(); } @@ -30349,83 +31858,68 @@ } }); const onCompositionEndProp = props.onCompositionEnd; - const onCompositionEnd = useEvent( - (event) => { - canAutoSelectRef.current = true; - composingRef.current = false; - onCompositionEndProp == null ? void 0 : onCompositionEndProp(event); - if (event.defaultPrevented) - return; - if (!autoSelect) - return; - forceValueUpdate(); - } + const onCompositionEnd = useEvent((event) => { + canAutoSelectRef.current = true; + composingRef.current = false; + onCompositionEndProp == null ? void 0 : onCompositionEndProp(event); + if (event.defaultPrevented) return; + if (!autoSelect) return; + forceValueUpdate(); + }); + const onMouseDownProp = props.onMouseDown; + const blurActiveItemOnClickProp = useBooleanEvent( + blurActiveItemOnClick != null ? blurActiveItemOnClick : () => !!(store == null ? void 0 : store.getState().includesBaseElement) ); - const onMouseDownProp = props.onMouseDown; const setValueOnClickProp = useBooleanEvent(setValueOnClick); - const showOnMouseDownProp = useBooleanEvent(showOnMouseDown); + const showOnClickProp = useBooleanEvent(showOnClick != null ? showOnClick : canShow); const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); - if (event.defaultPrevented) - return; - if (event.button) - return; - if (event.ctrlKey) - return; - if (!store) - return; - store.setActiveId(null); + if (event.defaultPrevented) return; + if (event.button) return; + if (event.ctrlKey) return; + if (!store) return; + if (blurActiveItemOnClickProp(event)) { + store.setActiveId(null); + } if (setValueOnClickProp(event)) { store.setValue(value); } - if (showOnMouseDownProp(event)) { + if (showOnClickProp(event)) { queueBeforeEvent(event.currentTarget, "mouseup", store.show); } }); const onKeyDownProp = props.onKeyDown; - const showOnKeyDownProp = useBooleanEvent(showOnKeyDown); - const onKeyDown = useEvent( - (event) => { - onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (!event.repeat) { - canAutoSelectRef.current = false; - } - if (event.defaultPrevented) - return; - if (event.ctrlKey) - return; - if (event.altKey) - return; - if (event.shiftKey) - return; - if (event.metaKey) - return; - if (!store) - return; - const { open: open2, activeId } = store.getState(); - if (open2) - return; - if (activeId !== null) - return; - if (event.key === "ArrowUp" || event.key === "ArrowDown") { - if (showOnKeyDownProp(event)) { - event.preventDefault(); - store.show(); - } - } - } - ); + const showOnKeyPressProp = useBooleanEvent(showOnKeyPress != null ? showOnKeyPress : canShow); + const onKeyDown = useEvent((event) => { + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + if (!event.repeat) { + canAutoSelectRef.current = false; + } + if (event.defaultPrevented) return; + if (event.ctrlKey) return; + if (event.altKey) return; + if (event.shiftKey) return; + if (event.metaKey) return; + if (!store) return; + const { open: open2 } = store.getState(); + if (open2) return; + if (event.key === "ArrowUp" || event.key === "ArrowDown") { + if (showOnKeyPressProp(event)) { + event.preventDefault(); + store.show(); + } + } + }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { canAutoSelectRef.current = false; onBlurProp == null ? void 0 : onBlurProp(event); - if (event.defaultPrevented) - return; + if (event.defaultPrevented) return; }); const id = useId(props.id); const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0; const isActiveItem = store.useState((state) => state.activeId === null); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, role: "combobox", "aria-autocomplete": ariaAutoComplete, @@ -30442,32 +31936,29 @@ onKeyDown, onBlur }); - props = useComposite(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = useComposite(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store, focusable }, props), { // Enable inline autocomplete when the user moves from the combobox input // to an item. moveOnKeyPress: (event) => { - if (isFalsyBooleanCallback(moveOnKeyPress, event)) - return false; - if (inline) - setCanInline(true); + if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false; + if (inline) setCanInline(true); return true; } })); - props = usePopoverAnchor(_4R3V3JGP_spreadValues({ store }, props)); - return _4R3V3JGP_spreadValues({ autoComplete: "off" }, props); + props = usePopoverAnchor(_3YLGPPWQ_spreadValues({ store }, props)); + return _3YLGPPWQ_spreadValues({ autoComplete: "off" }, props); } ); -var Combobox = createComponent((props) => { +var Combobox = forwardRef2(function Combobox2(props) { const htmlProps = useCombobox(props); - return createElement("input", htmlProps); -}); -if (false) {} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CLE7NTOY.js + return createElement(combobox_TagName, htmlProps); +}); + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/VGCJ63VH.js "use client"; @@ -30480,11 +31971,13 @@ + +var VGCJ63VH_TagName = "div"; function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } -function CLE7NTOY_afterPaint(cb) { +function VGCJ63VH_afterPaint(cb) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); @@ -30492,117 +31985,154 @@ } function parseCSSTime(...times) { return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => { - const currentTime = parseFloat(currentTimeString || "0s") * 1e3; - if (currentTime > longestTime) - return currentTime; + const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3; + const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier; + if (currentTime > longestTime) return currentTime; return longestTime; }, 0); } function isHidden(mounted, hidden, alwaysVisible) { return !alwaysVisible && hidden !== false && (!mounted || !!hidden); } -var useDisclosureContent = createHook( - (_a) => { - var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); - const context = useDisclosureProviderContext(); - store = store || context; - invariant( - store, - false && 0 +var useDisclosureContent = createHook(function useDisclosureContent2(_a) { + var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); + const context = useDisclosureProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const ref = (0,external_React_.useRef)(null); + const id = useId(props.id); + const [transition, setTransition] = (0,external_React_.useState)(null); + const open = store.useState("open"); + const mounted = store.useState("mounted"); + const animated = store.useState("animated"); + const contentElement = store.useState("contentElement"); + const otherElement = useStoreState(store.disclosure, "contentElement"); + useSafeLayoutEffect(() => { + if (!ref.current) return; + store == null ? void 0 : store.setContentElement(ref.current); + }, [store]); + useSafeLayoutEffect(() => { + let previousAnimated; + store == null ? void 0 : store.setState("animated", (animated2) => { + previousAnimated = animated2; + return true; + }); + return () => { + if (previousAnimated === void 0) return; + store == null ? void 0 : store.setState("animated", previousAnimated); + }; + }, [store]); + useSafeLayoutEffect(() => { + if (!animated) return; + if (!(contentElement == null ? void 0 : contentElement.isConnected)) { + setTransition(null); + return; + } + return VGCJ63VH_afterPaint(() => { + setTransition(open ? "enter" : mounted ? "leave" : null); + }); + }, [animated, contentElement, open, mounted]); + useSafeLayoutEffect(() => { + if (!store) return; + if (!animated) return; + if (!transition) return; + if (!contentElement) return; + const stopAnimation = () => store == null ? void 0 : store.setState("animating", false); + const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation); + if (transition === "leave" && open) return; + if (transition === "enter" && !open) return; + if (typeof animated === "number") { + const timeout2 = animated; + return afterTimeout(timeout2, stopAnimationSync); + } + const { + transitionDuration, + animationDuration, + transitionDelay, + animationDelay + } = getComputedStyle(contentElement); + const { + transitionDuration: transitionDuration2 = "0", + animationDuration: animationDuration2 = "0", + transitionDelay: transitionDelay2 = "0", + animationDelay: animationDelay2 = "0" + } = otherElement ? getComputedStyle(otherElement) : {}; + const delay = parseCSSTime( + transitionDelay, + animationDelay, + transitionDelay2, + animationDelay2 ); - const id = useId(props.id); - const [transition, setTransition] = (0,external_React_.useState)(null); - const open = store.useState("open"); - const mounted = store.useState("mounted"); - const animated = store.useState("animated"); - const contentElement = store.useState("contentElement"); - useSafeLayoutEffect(() => { - if (!animated) - return; - if (!(contentElement == null ? void 0 : contentElement.isConnected)) { - setTransition(null); - return; - } - return CLE7NTOY_afterPaint(() => { - setTransition(open ? "enter" : "leave"); - }); - }, [animated, contentElement, open]); - useSafeLayoutEffect(() => { - if (!store) - return; - if (!animated) - return; - if (!contentElement) - return; - if (!transition) - return; - if (transition === "enter" && !open) - return; - if (transition === "leave" && open) - return; - if (typeof animated === "number") { - const timeoutMs2 = animated; - return afterTimeout(timeoutMs2, store.stopAnimation); - } - const { - transitionDuration, - animationDuration, - transitionDelay, - animationDelay - } = getComputedStyle(contentElement); - const delay = parseCSSTime(transitionDelay, animationDelay); - const duration = parseCSSTime(transitionDuration, animationDuration); - const timeoutMs = delay + duration; - if (!timeoutMs) - return; - return afterTimeout(timeoutMs, store.stopAnimation); - }, [store, animated, contentElement, open, transition]); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }), - [store] + const duration = parseCSSTime( + transitionDuration, + animationDuration, + transitionDuration2, + animationDuration2 ); - const hidden = isHidden(mounted, props.hidden, alwaysVisible); - const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ - id, - "data-enter": transition === "enter" ? "" : void 0, - "data-leave": transition === "leave" ? "" : void 0, - hidden - }, props), { - ref: useMergeRefs(id ? store.setContentElement : null, props.ref), - style - }); - return props; - } -); -var DisclosureContentImpl = createComponent( - (props) => { - const htmlProps = useDisclosureContent(props); - return createElement("div", htmlProps); - } -); -var DisclosureContent = createComponent( - (_a) => { - var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, ["unmountOnHide"]); - const context = useDisclosureProviderContext(); - const store = props.store || context; - const mounted = useStoreState( - store, - (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) - ); - if (mounted === false) - return null; - return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _4R3V3JGP_spreadValues({}, props)); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZEXNX5JH.js -"use client"; - + const timeout = delay + duration; + if (!timeout) { + if (transition === "enter") { + store.setState("animated", false); + } + stopAnimation(); + return; + } + const frameRate = 1e3 / 60; + const maxTimeout = Math.max(timeout - frameRate, 0); + return afterTimeout(maxTimeout, stopAnimationSync); + }, [store, animated, contentElement, otherElement, open, transition]); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }), + [store] + ); + const hidden = isHidden(mounted, props.hidden, alwaysVisible); + const styleProp = props.style; + const style = (0,external_React_.useMemo)(() => { + if (hidden) { + return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" }); + } + return styleProp; + }, [hidden, styleProp]); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + id, + "data-open": open || void 0, + "data-enter": transition === "enter" || void 0, + "data-leave": transition === "leave" || void 0, + hidden + }, props), { + ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref), + style + }); + return removeUndefinedValues(props); +}); +var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) { + const htmlProps = useDisclosureContent(props); + return createElement(VGCJ63VH_TagName, htmlProps); +}); +var DisclosureContent = forwardRef2(function DisclosureContent2(_a) { + var _b = _a, { + unmountOnHide + } = _b, props = __objRest(_b, [ + "unmountOnHide" + ]); + const context = useDisclosureProviderContext(); + const store = props.store || context; + const mounted = useStoreState( + store, + (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) + ); + if (mounted === false) return null; + return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _3YLGPPWQ_spreadValues({}, props)); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/HUWAI7RB.js +"use client"; @@ -30613,113 +32143,246 @@ - +var HUWAI7RB_TagName = "div"; var useComboboxList = createHook( - (_a) => { - var _b = _a, { store, focusable = true, alwaysVisible } = _b, props = __objRest(_b, ["store", "focusable", "alwaysVisible"]); - const context = useComboboxProviderContext(); + function useComboboxList2(_a) { + var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); + const scopedContext = useComboboxScopedContext(true); + const context = useComboboxContext(); store = store || context; + const scopedContextSameStore = !!store && store === scopedContext; invariant( store, false && 0 ); const ref = (0,external_React_.useRef)(null); const id = useId(props.id); - const onKeyDownProp = props.onKeyDown; - const onKeyDown = useEvent((event) => { - onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; - if (event.key === "Escape") { - store == null ? void 0 : store.move(null); - } - }); - const restoreVirtualFocus = (0,external_React_.useRef)(false); - const onFocusVisibleProp = props.onFocusVisible; - const onFocusVisible = useEvent((event) => { - onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event); - if (event.defaultPrevented) - return; - if (event.type !== "focus") - return; - if (!store) - return; - const { virtualFocus } = store.getState(); - if (!virtualFocus) - return; - const { relatedTarget, currentTarget } = event; - if (relatedTarget && currentTarget.contains(relatedTarget)) - return; - restoreVirtualFocus.current = true; - store.setState("virtualFocus", false); - }); - const onBlurProp = props.onBlur; - const onBlur = useEvent((event) => { - onBlurProp == null ? void 0 : onBlurProp(event); - if (event.defaultPrevented) - return; - if (!restoreVirtualFocus.current) - return; - if (!isFocusEventOutside(event)) - return; - restoreVirtualFocus.current = false; - store == null ? void 0 : store.setState("virtualFocus", true); - }); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxScopedContextProvider, { value: store, children: element }), - [store] - ); const mounted = store.useState("mounted"); const hidden = isHidden(mounted, props.hidden, alwaysVisible); - const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; + const style = hidden ? _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props.style), { display: "none" }) : props.style; const multiSelectable = store.useState( (state) => Array.isArray(state.selectedValue) ); const role = useAttribute(ref, "role", props.role); const isCompositeRole = role === "listbox" || role === "tree" || role === "grid"; const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0; - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + const [hasListboxInside, setHasListboxInside] = (0,external_React_.useState)(false); + const contentElement = store.useState("contentElement"); + useSafeLayoutEffect(() => { + if (!mounted) return; + const element = ref.current; + if (!element) return; + if (contentElement !== element) return; + const callback = () => { + setHasListboxInside(!!element.querySelector("[role='listbox']")); + }; + const observer = new MutationObserver(callback); + observer.observe(element, { + subtree: true, + childList: true, + attributeFilter: ["role"] + }); + callback(); + return () => observer.disconnect(); + }, [mounted, contentElement]); + if (!hasListboxInside) { + props = _3YLGPPWQ_spreadValues({ + role: "listbox", + "aria-multiselectable": ariaMultiSelectable + }, props); + } + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxListRoleContext.Provider, { value: role, children: element }) }), + [store, role] + ); + const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null; + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, - hidden, - role: "listbox", - tabIndex: focusable ? -1 : void 0, - "aria-multiselectable": ariaMultiSelectable + hidden }, props), { - ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref), - style, - onKeyDown, - onFocusVisible, - onBlur - }); - props = useFocusable(_4R3V3JGP_spreadValues({ focusable }, props)); - return props; + ref: useMergeRefs(setContentElement, ref, props.ref), + style + }); + return removeUndefinedValues(props); } ); -var ComboboxList = createComponent((props) => { +var ComboboxList = forwardRef2(function ComboboxList2(props) { const htmlProps = useComboboxList(props); - return createElement("div", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NWCBQ4CV.js -"use client"; - - - - - -// src/command/command.ts - - - - - + return createElement(HUWAI7RB_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/UQQRIHDV.js +"use client"; + + + + + +// src/composite/composite-hover.tsx + + + + +var UQQRIHDV_TagName = "div"; +function getMouseDestination(event) { + const relatedTarget = event.relatedTarget; + if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { + return relatedTarget; + } + return null; +} +function hoveringInside(event) { + const nextElement = getMouseDestination(event); + if (!nextElement) return false; + return contains(event.currentTarget, nextElement); +} +var UQQRIHDV_symbol = Symbol("composite-hover"); +function movingToAnotherItem(event) { + let dest = getMouseDestination(event); + if (!dest) return false; + do { + if (PBFD2E7P_hasOwnProperty(dest, UQQRIHDV_symbol) && dest[UQQRIHDV_symbol]) return true; + dest = dest.parentElement; + } while (dest); + return false; +} +var useCompositeHover = createHook( + function useCompositeHover2(_a) { + var _b = _a, { + store, + focusOnHover = true, + blurOnHoverEnd = !!focusOnHover + } = _b, props = __objRest(_b, [ + "store", + "focusOnHover", + "blurOnHoverEnd" + ]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const isMouseMoving = useIsMouseMoving(); + const onMouseMoveProp = props.onMouseMove; + const focusOnHoverProp = useBooleanEvent(focusOnHover); + const onMouseMove = useEvent((event) => { + onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); + if (event.defaultPrevented) return; + if (!isMouseMoving()) return; + if (!focusOnHoverProp(event)) return; + if (!hasFocusWithin(event.currentTarget)) { + const baseElement = store == null ? void 0 : store.getState().baseElement; + if (baseElement && !hasFocus(baseElement)) { + baseElement.focus(); + } + } + store == null ? void 0 : store.setActiveId(event.currentTarget.id); + }); + const onMouseLeaveProp = props.onMouseLeave; + const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd); + const onMouseLeave = useEvent((event) => { + var _a2; + onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); + if (event.defaultPrevented) return; + if (!isMouseMoving()) return; + if (hoveringInside(event)) return; + if (movingToAnotherItem(event)) return; + if (!focusOnHoverProp(event)) return; + if (!blurOnHoverEndProp(event)) return; + store == null ? void 0 : store.setActiveId(null); + (_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus(); + }); + const ref = (0,external_React_.useCallback)((element) => { + if (!element) return; + element[UQQRIHDV_symbol] = true; + }, []); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref), + onMouseMove, + onMouseLeave + }); + return removeUndefinedValues(props); + } +); +var CompositeHover = memo2( + forwardRef2(function CompositeHover2(props) { + const htmlProps = useCompositeHover(props); + return createElement(UQQRIHDV_TagName, htmlProps); + }) +); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/RZ4GPYOB.js +"use client"; + + + + + +// src/collection/collection-item.tsx + + +var RZ4GPYOB_TagName = "div"; +var useCollectionItem = createHook( + function useCollectionItem2(_a) { + var _b = _a, { + store, + shouldRegisterItem = true, + getItem = identity, + element: element + } = _b, props = __objRest(_b, [ + "store", + "shouldRegisterItem", + "getItem", + // @ts-expect-error This prop may come from a collection renderer. + "element" + ]); + const context = useCollectionContext(); + store = store || context; + const id = useId(props.id); + const ref = (0,external_React_.useRef)(element); + (0,external_React_.useEffect)(() => { + const element2 = ref.current; + if (!id) return; + if (!element2) return; + if (!shouldRegisterItem) return; + const item = getItem({ id, element: element2 }); + return store == null ? void 0 : store.renderItem(item); + }, [id, shouldRegisterItem, getItem, store]); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref) + }); + return removeUndefinedValues(props); + } +); +var CollectionItem = forwardRef2(function CollectionItem2(props) { + const htmlProps = useCollectionItem(props); + return createElement(RZ4GPYOB_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/KUU7WJ55.js +"use client"; + + + + + +// src/command/command.tsx + + + + + +var KUU7WJ55_TagName = "button"; function isNativeClick(event) { - if (!event.isTrusted) - return false; + if (!event.isTrusted) return false; const element = event.currentTarget; if (event.key === "Enter") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; @@ -30729,41 +32392,30 @@ } return false; } -var NWCBQ4CV_symbol = Symbol("command"); +var KUU7WJ55_symbol = Symbol("command"); var useCommand = createHook( - (_a) => { + function useCommand2(_a) { var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); const ref = (0,external_React_.useRef)(null); - const tagName = useTagName(ref, props.as); - const type = props.type; - const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( - () => !!tagName && isButton({ tagName, type }) - ); + const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { - if (!ref.current) - return; + if (!ref.current) return; setIsNativeButton(isButton(ref.current)); }, []); const [active, setActive] = (0,external_React_.useState)(false); const activeRef = (0,external_React_.useRef)(false); const disabled = disabledFromProps(props); - const [isDuplicate, metadataProps] = useMetadataProps(props, NWCBQ4CV_symbol, true); + const [isDuplicate, metadataProps] = useMetadataProps(props, KUU7WJ55_symbol, true); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); const element = event.currentTarget; - if (event.defaultPrevented) - return; - if (isDuplicate) - return; - if (disabled) - return; - if (!isSelfTarget(event)) - return; - if (DLOEKDPY_isTextField(element)) - return; - if (element.isContentEditable) - return; + if (event.defaultPrevented) return; + if (isDuplicate) return; + if (disabled) return; + if (!isSelfTarget(event)) return; + if (isTextField(element)) return; + if (element.isContentEditable) return; const isEnter = clickOnEnter && event.key === "Enter"; const isSpace = clickOnSpace && event.key === " "; const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; @@ -30797,14 +32449,10 @@ const onKeyUpProp = props.onKeyUp; const onKeyUp = useEvent((event) => { onKeyUpProp == null ? void 0 : onKeyUpProp(event); - if (event.defaultPrevented) - return; - if (isDuplicate) - return; - if (disabled) - return; - if (event.metaKey) - return; + if (event.defaultPrevented) return; + if (isDuplicate) return; + if (disabled) return; + if (event.metaKey) return; const isSpace = clickOnSpace && event.key === " "; if (activeRef.current && isSpace) { activeRef.current = false; @@ -30817,8 +32465,8 @@ } } }); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({ - "data-active": active ? "" : void 0, + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({ + "data-active": active || void 0, type: isNativeButton ? "button" : void 0 }, metadataProps), props), { ref: useMergeRefs(ref, props.ref), @@ -30829,70 +32477,14 @@ return props; } ); -var Command = createComponent((props) => { - props = useCommand(props); - return createElement("button", props); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UH3I23HL.js -"use client"; - - - - - -// src/collection/collection-item.ts - - -var useCollectionItem = createHook( - (_a) => { - var _b = _a, { - store, - shouldRegisterItem = true, - getItem = identity, - element: element - } = _b, props = __objRest(_b, [ - "store", - "shouldRegisterItem", - "getItem", - // @ts-expect-error This prop may come from a collection renderer. - "element" - ]); - const context = useCollectionContext(); - store = store || context; - const id = useId(props.id); - const ref = (0,external_React_.useRef)(element); - (0,external_React_.useEffect)(() => { - const element2 = ref.current; - if (!id) - return; - if (!element2) - return; - if (!shouldRegisterItem) - return; - const item = getItem({ id, element: element2 }); - return store == null ? void 0 : store.renderItem(item); - }, [id, shouldRegisterItem, getItem, store]); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { - ref: useMergeRefs(ref, props.ref) - }); - return props; - } -); -var CollectionItem = createComponent( - (props) => { - const htmlProps = useCollectionItem(props); - return createElement("div", htmlProps); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QZLXIDNP.js +var Command = forwardRef2(function Command2(props) { + const htmlProps = useCommand(props); + return createElement(KUU7WJ55_TagName, htmlProps); +}); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/P2CTZE2T.js "use client"; @@ -30909,11 +32501,10 @@ + +var P2CTZE2T_TagName = "button"; function isEditableElement(element) { - if (element.isContentEditable) - return true; - if (DLOEKDPY_isTextField(element)) - return true; + if (isTextbox(element)) return true; return element.tagName === "INPUT" && !isButton(element); } function getNextPageOffset(scrollingElement, pageUp = false) { @@ -30935,27 +32526,21 @@ } function findNextPageItemId(element, store, next, pageUp = false) { var _a; - if (!store) - return; - if (!next) - return; + if (!store) return; + if (!next) return; const { renderedItems } = store.getState(); const scrollingElement = getScrollingElement(element); - if (!scrollingElement) - return; + if (!scrollingElement) return; const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); let id; let prevDifference; for (let i = 0; i < renderedItems.length; i += 1) { const previousId = id; id = next(i); - if (!id) - break; - if (id === previousId) - continue; + if (!id) break; + if (id === previousId) continue; const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; - if (!itemElement) - continue; + if (!itemElement) continue; const itemOffset = getItemOffset(itemElement, pageUp); const difference = itemOffset - nextPageOffset; const absDifference = Math.abs(difference); @@ -30970,43 +32555,11 @@ return id; } function targetIsAnotherItem(event, store) { - if (isSelfTarget(event)) - return false; + if (isSelfTarget(event)) return false; return isItem(store, event.target); } -function useRole(ref, props) { - const roleProp = props.role; - const [role, setRole] = (0,external_React_.useState)(roleProp); - useSafeLayoutEffect(() => { - const element = ref.current; - if (!element) - return; - setRole(element.getAttribute("role") || roleProp); - }, [roleProp]); - return role; -} -function requiresAriaSelected(role) { - return role === "option" || role === "treeitem"; -} -function supportsAriaSelected(role) { - if (role === "option") - return true; - if (role === "tab") - return true; - if (role === "treeitem") - return true; - if (role === "gridcell") - return true; - if (role === "row") - return true; - if (role === "columnheader") - return true; - if (role === "rowheader") - return true; - return false; -} var useCompositeItem = createHook( - (_a) => { + function useCompositeItem2(_a) { var _b = _a, { store, rowId: rowIdProp, @@ -31031,25 +32584,65 @@ const id = useId(props.id); const ref = (0,external_React_.useRef)(null); const row = (0,external_React_.useContext)(CompositeRowContext); - const rowId = useStoreState(store, (state) => { - if (rowIdProp) - return rowIdProp; - if (!state) - return; - if (!(row == null ? void 0 : row.baseElement)) - return; - if (row.baseElement !== state.baseElement) - return; - return row.id; - }); const disabled = disabledFromProps(props); const trulyDisabled = disabled && !props.accessibleWhenDisabled; + const { + rowId, + baseElement, + isActiveItem, + ariaSetSize, + ariaPosInSet, + isTabbable + } = useStoreStateObject(store, { + rowId(state) { + if (rowIdProp) return rowIdProp; + if (!state) return; + if (!(row == null ? void 0 : row.baseElement)) return; + if (row.baseElement !== state.baseElement) return; + return row.id; + }, + baseElement(state) { + return (state == null ? void 0 : state.baseElement) || void 0; + }, + isActiveItem(state) { + return !!state && state.activeId === id; + }, + ariaSetSize(state) { + if (ariaSetSizeProp != null) return ariaSetSizeProp; + if (!state) return; + if (!(row == null ? void 0 : row.ariaSetSize)) return; + if (row.baseElement !== state.baseElement) return; + return row.ariaSetSize; + }, + ariaPosInSet(state) { + if (ariaPosInSetProp != null) return ariaPosInSetProp; + if (!state) return; + if (!(row == null ? void 0 : row.ariaPosInSet)) return; + if (row.baseElement !== state.baseElement) return; + const itemsInRow = state.renderedItems.filter( + (item) => item.rowId === rowId + ); + return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); + }, + isTabbable(state) { + if (!(state == null ? void 0 : state.renderedItems.length)) return true; + if (state.virtualFocus) return false; + if (tabbable) return true; + if (state.activeId === null) return false; + const item = store == null ? void 0 : store.item(state.activeId); + if (item == null ? void 0 : item.disabled) return true; + if (!(item == null ? void 0 : item.element)) return true; + return state.activeId === id; + } + }); const getItem = (0,external_React_.useCallback)( (item) => { - const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { + var _a2; + const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { id: id || item.id, rowId, - disabled: !!trulyDisabled + disabled: !!trulyDisabled, + children: (_a2 = item.element) == null ? void 0 : _a2.textContent }); if (getItemProp) { return getItemProp(nextItem); @@ -31062,28 +32655,26 @@ const hasFocusedComposite = (0,external_React_.useRef)(false); const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); - if (event.defaultPrevented) - return; - if (isPortalEvent(event)) - return; - if (!id) - return; - if (!store) - return; - const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState(); - if (targetIsAnotherItem(event, store)) - return; - if (activeId !== id) { - store.setActiveId(id); - } - if (!virtualFocus2) - return; - if (!isSelfTarget(event)) - return; - if (isEditableElement(event.currentTarget)) - return; - if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) - return; + if (event.defaultPrevented) return; + if (isPortalEvent(event)) return; + if (!id) return; + if (!store) return; + if (targetIsAnotherItem(event, store)) return; + const { virtualFocus, baseElement: baseElement2 } = store.getState(); + store.setActiveId(id); + if (isTextbox(event.currentTarget)) { + selectTextField(event.currentTarget); + } + if (!virtualFocus) return; + if (!isSelfTarget(event)) return; + if (isEditableElement(event.currentTarget)) return; + if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return; + if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) { + event.currentTarget.scrollIntoView({ + block: "nearest", + inline: "nearest" + }); + } hasFocusedComposite.current = true; const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget); if (fromComposite) { @@ -31095,8 +32686,7 @@ const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); - if (event.defaultPrevented) - return; + if (event.defaultPrevented) return; const state = store == null ? void 0 : store.getState(); if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { hasFocusedComposite.current = false; @@ -31109,12 +32699,9 @@ const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; - if (!isSelfTarget(event)) - return; - if (!store) - return; + if (event.defaultPrevented) return; + if (!isSelfTarget(event)) return; + if (!store) return; const { currentTarget } = event; const state = store.getState(); const item = store.item(id); @@ -31122,14 +32709,10 @@ const isVertical = state.orientation !== "horizontal"; const isHorizontal = state.orientation !== "vertical"; const canHomeEnd = () => { - if (isGrid) - return true; - if (isHorizontal) - return true; - if (!state.baseElement) - return true; - if (!DLOEKDPY_isTextField(state.baseElement)) - return true; + if (isGrid) return true; + if (isHorizontal) return true; + if (!state.baseElement) return true; + if (!isTextField(state.baseElement)) return true; return false; }; const keyMap = { @@ -31138,16 +32721,14 @@ ArrowDown: (isGrid || isVertical) && store.down, ArrowLeft: (isGrid || isHorizontal) && store.previous, Home: () => { - if (!canHomeEnd()) - return; + if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.first(); } return store == null ? void 0 : store.previous(-1); }, End: () => { - if (!canHomeEnd()) - return; + if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.last(); } @@ -31162,19 +32743,25 @@ }; const action = keyMap[event.key]; if (action) { + if (isTextbox(currentTarget)) { + const selection = getTextboxSelection(currentTarget); + const isLeft = isHorizontal && event.key === "ArrowLeft"; + const isRight = isHorizontal && event.key === "ArrowRight"; + const isUp = isVertical && event.key === "ArrowUp"; + const isDown = isVertical && event.key === "ArrowDown"; + if (isRight || isDown) { + const { length: valueLength } = getTextboxValue(currentTarget); + if (selection.end !== valueLength) return; + } else if ((isLeft || isUp) && selection.start !== 0) return; + } const nextId = action(); if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { - if (!moveOnKeyPressProp(event)) - return; + if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store.move(nextId); } } }); - const baseElement = useStoreState( - store, - (state) => (state == null ? void 0 : state.baseElement) || void 0 - ); const providerValue = (0,external_React_.useMemo)( () => ({ id, baseElement }), [id, baseElement] @@ -31184,58 +32771,9 @@ (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), [providerValue] ); - const isActiveItem = useStoreState( - store, - (state) => !!state && state.activeId === id - ); - const virtualFocus = useStoreState(store, "virtualFocus"); - const role = useRole(ref, props); - let ariaSelected; - if (isActiveItem) { - if (requiresAriaSelected(role)) { - ariaSelected = true; - } else if (virtualFocus && supportsAriaSelected(role)) { - ariaSelected = true; - } - } - const ariaSetSize = useStoreState(store, (state) => { - if (ariaSetSizeProp != null) - return ariaSetSizeProp; - if (!state) - return; - if (!(row == null ? void 0 : row.ariaSetSize)) - return; - if (row.baseElement !== state.baseElement) - return; - return row.ariaSetSize; - }); - const ariaPosInSet = useStoreState(store, (state) => { - if (ariaPosInSetProp != null) - return ariaPosInSetProp; - if (!state) - return; - if (!(row == null ? void 0 : row.ariaPosInSet)) - return; - if (row.baseElement !== state.baseElement) - return; - const itemsInRow = state.renderedItems.filter( - (item) => item.rowId === rowId - ); - return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); - }); - const isTabbable = useStoreState(store, (state) => { - if (!(state == null ? void 0 : state.renderedItems.length)) - return true; - if (state.virtualFocus) - return false; - if (tabbable) - return true; - return state.activeId === id; - }); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, - "aria-selected": ariaSelected, - "data-active-item": isActiveItem ? "" : void 0 + "data-active-item": isActiveItem || void 0 }, props), { ref: useMergeRefs(ref, props.ref), tabIndex: isTabbable ? props.tabIndex : -1, @@ -31244,41 +32782,29 @@ onKeyDown }); props = useCommand(props); - props = useCollectionItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store }, props), { getItem, - shouldRegisterItem: !!id ? props.shouldRegisterItem : false + shouldRegisterItem: id ? props.shouldRegisterItem : false })); - return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + return removeUndefinedValues(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet - }); - } -); -var QZLXIDNP_CompositeItem = createMemoComponent( - (props) => { - const htmlProps = useCompositeItem(props); - return createElement("button", htmlProps); + })); } ); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/combobox/combobox-item.js -"use client"; - - - - - - - - - - - +var CompositeItem = memo2( + forwardRef2(function CompositeItem2(props) { + const htmlProps = useCompositeItem(props); + return createElement(P2CTZE2T_TagName, htmlProps); + }) +); + + + +;// ./node_modules/@ariakit/react-core/esm/__chunks/ZTDSJLD6.js +"use client"; @@ -31294,24 +32820,34 @@ +var ZTDSJLD6_TagName = "div"; function isSelected(storeValue, itemValue) { - if (itemValue == null) - return; - if (storeValue == null) - return false; + if (itemValue == null) return; + if (storeValue == null) return false; if (Array.isArray(storeValue)) { return storeValue.includes(itemValue); } return storeValue === itemValue; } +function getItemRole(popupRole) { + var _a; + const itemRoleByPopupRole = { + menu: "menuitem", + listbox: "option", + tree: "treeitem" + }; + const key = popupRole; + return (_a = itemRoleByPopupRole[key]) != null ? _a : "option"; +} var useComboboxItem = createHook( - (_a) => { + function useComboboxItem2(_a) { var _b = _a, { store, value, hideOnClick, + setValueOnClick, selectValueOnClick = true, - setValueOnClick, + resetValueOnSelect, focusOnHover = false, moveOnKeyPress = true, getItem: getItemProp @@ -31319,21 +32855,32 @@ "store", "value", "hideOnClick", + "setValueOnClick", "selectValueOnClick", - "setValueOnClick", + "resetValueOnSelect", "focusOnHover", "moveOnKeyPress", "getItem" ]); + var _a2; const context = useComboboxScopedContext(); store = store || context; invariant( store, false && 0 ); + const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store, { + resetValueOnSelectState: "resetValueOnSelect", + multiSelectable(state) { + return Array.isArray(state.selectedValue); + }, + selected(state) { + return isSelected(state.selectedValue, value); + } + }); const getItem = (0,external_React_.useCallback)( (item) => { - const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { value }); + const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { value }); if (getItemProp) { return getItemProp(nextItem); } @@ -31341,28 +32888,27 @@ }, [value, getItemProp] ); - const multiSelectable = store.useState( - (state) => Array.isArray(state.selectedValue) - ); setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable; hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable; const onClickProp = props.onClick; const setValueOnClickProp = useBooleanEvent(setValueOnClick); const selectValueOnClickProp = useBooleanEvent(selectValueOnClick); + const resetValueOnSelectProp = useBooleanEvent( + (_a2 = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a2 : multiSelectable + ); const hideOnClickProp = useBooleanEvent(hideOnClick); const onClick = useEvent((event) => { onClickProp == null ? void 0 : onClickProp(event); - if (event.defaultPrevented) - return; - if (isDownloading(event)) - return; - if (isOpeningInNewTab(event)) - return; + if (event.defaultPrevented) return; + if (isDownloading(event)) return; + if (isOpeningInNewTab(event)) return; if (value != null) { if (selectValueOnClickProp(event)) { + if (resetValueOnSelectProp(event)) { + store == null ? void 0 : store.resetValue(); + } store == null ? void 0 : store.setSelectedValue((prevValue) => { - if (!Array.isArray(prevValue)) - return value; + if (!Array.isArray(prevValue)) return value; if (prevValue.includes(value)) { return prevValue.filter((v) => v !== value); } @@ -31374,33 +32920,26 @@ } } if (hideOnClickProp(event)) { - store == null ? void 0 : store.move(null); store == null ? void 0 : store.hide(); } }); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; + if (event.defaultPrevented) return; const baseElement = store == null ? void 0 : store.getState().baseElement; - if (!baseElement) - return; - if (hasFocus(baseElement)) - return; + if (!baseElement) return; + if (hasFocus(baseElement)) return; const printable = event.key.length === 1; if (printable || event.key === "Backspace" || event.key === "Delete") { queueMicrotask(() => baseElement.focus()); - if (DLOEKDPY_isTextField(baseElement)) { + if (isTextField(baseElement)) { store == null ? void 0 : store.setValue(baseElement.value); } } }); - const selected = store.useState( - (state) => isSelected(state.selectedValue, value) - ); if (multiSelectable && selected != null) { - props = _4R3V3JGP_spreadValues({ + props = _3YLGPPWQ_spreadValues({ "aria-selected": selected }, props); } @@ -31409,16 +32948,16 @@ (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }), [value, selected] ); - const contentElement = store.useState("contentElement"); - props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ - role: getPopupItemRole(contentElement), + const popupRole = (0,external_React_.useContext)(ComboboxListRoleContext); + props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ + role: getItemRole(popupRole), children: value }, props), { onClick, onKeyDown }); const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); - props = useCompositeItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + props = useCompositeItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store }, props), { getItem, @@ -31426,29 +32965,29 @@ // with the keyboard so the Combobox component can enable inline // autocompletion. moveOnKeyPress: (event) => { - if (!moveOnKeyPressProp(event)) - return false; + if (!moveOnKeyPressProp(event)) return false; const moveEvent = new Event("combobox-item-move"); const baseElement = store == null ? void 0 : store.getState().baseElement; baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent); return true; } })); - props = useCompositeHover(_4R3V3JGP_spreadValues({ store, focusOnHover }, props)); + props = useCompositeHover(_3YLGPPWQ_spreadValues({ store, focusOnHover }, props)); return props; } ); -var ComboboxItem = createMemoComponent( - (props) => { +var ComboboxItem = memo2( + forwardRef2(function ComboboxItem2(props) { const htmlProps = useComboboxItem(props); - return createElement("div", htmlProps); - } + return createElement(ZTDSJLD6_TagName, htmlProps); + }) ); -if (false) {} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js -"use client"; + + + +;// ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js +"use client"; + @@ -31464,84 +33003,101 @@ + +var combobox_item_value_TagName = "span"; function normalizeValue(value) { - return normalizeString(value).toLowerCase(); + return PBFD2E7P_normalizeString(value).toLowerCase(); +} +function getOffsets(string, values) { + const offsets = []; + for (const value of values) { + let pos = 0; + const length = value.length; + while (string.indexOf(value, pos) !== -1) { + const index = string.indexOf(value, pos); + if (index !== -1) { + offsets.push([index, length]); + } + pos = index + 1; + } + } + return offsets; +} +function filterOverlappingOffsets(offsets) { + return offsets.filter(([offset, length], i, arr) => { + return !arr.some( + ([o, l], j) => j !== i && o <= offset && o + l >= offset + length + ); + }); +} +function sortOffsets(offsets) { + return offsets.sort(([a], [b]) => a - b); } function splitValue(itemValue, userValue) { - userValue = normalizeValue(userValue); - let index = normalizeValue(itemValue).indexOf(userValue); + if (!itemValue) return itemValue; + if (!userValue) return itemValue; + const userValues = toArray(userValue).filter(Boolean).map(normalizeValue); const parts = []; - while (index !== -1) { - if (index !== 0) { - parts.push( - /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "data-autocomplete-value": "", children: itemValue.substr(0, index) }, parts.length) - ); - } - parts.push( - /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "data-user-value": "", children: itemValue.substr(index, userValue.length) }, parts.length) - ); - itemValue = itemValue.substr(index + userValue.length); - index = normalizeValue(itemValue).indexOf(userValue); - } - if (itemValue) { - parts.push( - /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "data-autocomplete-value": "", children: itemValue }, parts.length) - ); - } + const span = (value, autocomplete = false) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( + "span", + { + "data-autocomplete-value": autocomplete ? "" : void 0, + "data-user-value": autocomplete ? void 0 : "", + children: value + }, + parts.length + ); + const offsets = sortOffsets( + filterOverlappingOffsets( + // Convert userValues into a set to avoid duplicates + getOffsets(normalizeValue(itemValue), new Set(userValues)) + ) + ); + if (!offsets.length) { + parts.push(span(itemValue, true)); + return parts; + } + const [firstOffset] = offsets[0]; + const values = [ + itemValue.slice(0, firstOffset), + ...offsets.flatMap(([offset, length], i) => { + var _a; + const value = itemValue.slice(offset, offset + length); + const nextOffset = (_a = offsets[i + 1]) == null ? void 0 : _a[0]; + const nextValue = itemValue.slice(offset + length, nextOffset); + return [value, nextValue]; + }) + ]; + values.forEach((value, i) => { + if (!value) return; + parts.push(span(value, i % 2 === 0)); + }); return parts; } -var useComboboxItemValue = createHook( - (_a) => { - var _b = _a, { store, value } = _b, props = __objRest(_b, ["store", "value"]); - const context = useComboboxScopedContext(); - store = store || context; - const itemContext = (0,external_React_.useContext)(ComboboxItemValueContext); - const itemValue = value != null ? value : itemContext; - invariant( - store, - false && 0 - ); - const stateValue = store.useState( - (state) => itemValue && state.value ? state.value : void 0 - ); - const children = (0,external_React_.useMemo)( - () => itemValue && stateValue ? splitValue(itemValue, stateValue) : itemValue, - [itemValue, stateValue] - ); - props = _4R3V3JGP_spreadValues({ - children - }, props); - return props; - } -); -var ComboboxItemValue = createComponent( - (props) => { - const htmlProps = useComboboxItemValue(props); - return createElement("span", htmlProps); - } -); -if (false) {} - - -// EXTERNAL MODULE: ./node_modules/remove-accents/index.js -var remove_accents = __webpack_require__(9681); -var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js -/** - * WordPress dependencies - */ - - -const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" - }) -}); -/* harmony default export */ const library_check = (check); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/search-widget.js +var useComboboxItemValue = createHook(function useComboboxItemValue2(_a) { + var _b = _a, { store, value, userValue } = _b, props = __objRest(_b, ["store", "value", "userValue"]); + const context = useComboboxScopedContext(); + store = store || context; + const itemContext = (0,external_React_.useContext)(ComboboxItemValueContext); + const itemValue = value != null ? value : itemContext; + const inputValue = useStoreState(store, (state) => userValue != null ? userValue : state == null ? void 0 : state.value); + const children = (0,external_React_.useMemo)(() => { + if (!itemValue) return; + if (!inputValue) return itemValue; + return splitValue(itemValue, inputValue); + }, [itemValue, inputValue]); + props = _3YLGPPWQ_spreadValues({ + children + }, props); + return removeUndefinedValues(props); +}); +var ComboboxItemValue = forwardRef2(function ComboboxItemValue2(props) { + const htmlProps = useComboboxItemValue(props); + return createElement(combobox_item_value_TagName, htmlProps); +}); + + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js /** * External dependencies */ @@ -31558,17 +33114,11 @@ -/** - * Internal dependencies - */ - - - -const { - CompositeV2: search_widget_Composite, - CompositeItemV2: search_widget_CompositeItem, - useCompositeStoreV2: search_widget_useCompositeStore -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); + +/** + * Internal dependencies + */ + const radioCheck = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", @@ -31578,7 +33128,7 @@ r: 3 }) }); -function normalizeSearchInput(input = '') { +function search_widget_normalizeSearchInput(input = '') { return remove_accents_default()(input.trim().toLowerCase()); } const search_widget_EMPTY_ARRAY = []; @@ -31603,45 +33153,53 @@ } return [value]; }; +function generateFilterElementCompositeItemId(prefix, filterElementValue) { + return `${prefix}-${filterElementValue}`; +} function ListBox({ view, filter, onChangeView }) { - const compositeStore = search_widget_useCompositeStore({ + const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListBox, 'dataviews-filter-list-box'); + const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_namespaceObject.useState)( + // When there are one or less operators, the first item is set as active + // (by setting the initial `activeId` to `undefined`). + // With 2 or more operators, the focus is moved on the operators control + // (by setting the initial `activeId` to `null`), meaning that there won't + // be an active item initially. Focus is then managed via the + // `onFocusVisible` callback. + filter.operators?.length === 1 ? undefined : null); + const currentFilter = view.filters?.find(f => f.field === filter.field); + const currentValue = getCurrentValue(filter, currentFilter); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { virtualFocus: true, focusLoop: true, - // When we have no or just one operator, we can set the first item as active. - // We do that by passing `undefined` to `defaultActiveId`. Otherwise, we set it to `null`, - // so the first item is not selected, since the focus is on the operators control. - defaultActiveId: filter.operators?.length === 1 ? undefined : null - }); - const currentFilter = view.filters.find(f => f.field === filter.field); - const currentValue = getCurrentValue(filter, currentFilter); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_widget_Composite, { - store: compositeStore, + activeId: activeCompositeId, + setActiveId: setActiveCompositeId, role: "listbox", - className: "dataviews-search-widget-listbox", - "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ + className: "dataviews-filters__search-widget-listbox", + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ (0,external_wp_i18n_namespaceObject.__)('List of: %1$s'), filter.name), onFocusVisible: () => { - if (!compositeStore.getState().activeId) { - compositeStore.move(compositeStore.first()); - } - }, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeTypeahead, { - store: compositeStore - }), - children: filter.elements.map(element => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(CompositeHover, { - store: compositeStore, - render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_widget_CompositeItem, { + // `onFocusVisible` needs the `Composite` component to be focusable, + // which is implicitly achieved via the `virtualFocus` prop. + if (!activeCompositeId && filter.elements.length) { + setActiveCompositeId(generateFilterElementCompositeItemId(baseId, filter.elements[0].value)); + } + }, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Typeahead, {}), + children: filter.elements.map(element => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Hover, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: generateFilterElementCompositeItemId(baseId, element.value), render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-label": element.label, role: "option", - className: "dataviews-search-widget-listitem" + className: "dataviews-filters__search-widget-listitem" }), onClick: () => { - const newFilters = currentFilter ? [...view.filters.map(_filter => { + var _view$filters, _view$filters2; + const newFilters = currentFilter ? [...((_view$filters = view.filters) !== null && _view$filters !== void 0 ? _view$filters : []).map(_filter => { if (_filter.field === filter.field) { return { ..._filter, @@ -31650,7 +33208,7 @@ }; } return _filter; - })] : [...view.filters, { + })] : [...((_view$filters2 = view.filters) !== null && _view$filters2 !== void 0 ? _view$filters2 : []), { field: filter.field, operator: filter.operators[0], value: getNewValue(filter, currentFilter, element.value) @@ -31663,17 +33221,14 @@ } }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { - className: "dataviews-search-widget-listitem-check", + className: "dataviews-filters__search-widget-listitem-check", children: [filter.singleSelection && currentValue === element.value && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: radioCheck }), !filter.singleSelection && currentValue.includes(element.value) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: library_check })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { - children: [element.label, !!element.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-search-widget-listitem-description", - children: element.description - })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + children: element.label })] }, element.value)) }); @@ -31685,17 +33240,17 @@ }) { const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); const deferredSearchValue = (0,external_wp_element_namespaceObject.useDeferredValue)(searchValue); - const currentFilter = view.filters.find(_filter => _filter.field === filter.field); + const currentFilter = view.filters?.find(_filter => _filter.field === filter.field); const currentValue = getCurrentValue(filter, currentFilter); const matches = (0,external_wp_element_namespaceObject.useMemo)(() => { - const normalizedSearch = normalizeSearchInput(deferredSearchValue); - return filter.elements.filter(item => normalizeSearchInput(item.label).includes(normalizedSearch)); + const normalizedSearch = search_widget_normalizeSearchInput(deferredSearchValue); + return filter.elements.filter(item => search_widget_normalizeSearchInput(item.label).includes(normalizedSearch)); }, [filter.elements, deferredSearchValue]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComboboxProvider, { - resetValueOnSelect: false, selectedValue: currentValue, setSelectedValue: value => { - const newFilters = currentFilter ? [...view.filters.map(_filter => { + var _view$filters3, _view$filters4; + const newFilters = currentFilter ? [...((_view$filters3 = view.filters) !== null && _view$filters3 !== void 0 ? _view$filters3 : []).map(_filter => { if (_filter.field === filter.field) { return { ..._filter, @@ -31704,7 +33259,7 @@ }; } return _filter; - })] : [...view.filters, { + })] : [...((_view$filters4 = view.filters) !== null && _view$filters4 !== void 0 ? _view$filters4 : []), { field: filter.field, operator: filter.operators[0], value @@ -31717,7 +33272,7 @@ }, setValue: setSearchValue, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "dataviews-search-widget-filter-combobox__wrapper", + className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxLabel, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)('Search items') @@ -31726,25 +33281,26 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Combobox, { autoSelect: "always", placeholder: (0,external_wp_i18n_namespaceObject.__)('Search'), - className: "dataviews-search-widget-filter-combobox__input" + className: "dataviews-filters__search-widget-filter-combobox__input" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-search-widget-filter-combobox__icon", + className: "dataviews-filters__search-widget-filter-combobox__icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: library_search }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComboboxList, { - className: "dataviews-search-widget-filter-combobox-list", + className: "dataviews-filters__search-widget-filter-combobox-list", alwaysVisible: true, children: [matches.map(element => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComboboxItem, { + resetValueOnSelect: false, value: element.value, - className: "dataviews-search-widget-listitem", + className: "dataviews-filters__search-widget-listitem", hideOnClick: false, setValueOnClick: false, focusOnHover: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { - className: "dataviews-search-widget-listitem-check", + className: "dataviews-filters__search-widget-listitem-check", children: [filter.singleSelection && currentValue === element.value && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: radioCheck }), !filter.singleSelection && currentValue.includes(element.value) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { @@ -31752,10 +33308,10 @@ })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComboboxItemValue, { - className: "dataviews-search-widget-filter-combobox-item-value", + className: "dataviews-filters__search-widget-filter-combobox-item-value", value: element.label }), !!element.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-search-widget-listitem-description", + className: "dataviews-filters__search-widget-listitem-description", children: element.description })] })] @@ -31773,7 +33329,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/filter-summary.js +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter-summary.js /** * External dependencies */ @@ -31794,7 +33350,6 @@ - const FilterText = ({ activeElements, filterInView, @@ -31805,37 +33360,37 @@ } const filterTextWrappers = { Name: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-filter-summary__filter-text-name" + className: "dataviews-filters__summary-filter-text-name" }), Value: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "dataviews-filter-summary__filter-text-value" + className: "dataviews-filters__summary-filter-text-value" }) }; if (filterInView?.operator === constants_OPERATOR_IS_ANY) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is any: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is any: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is any: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS_NONE) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is none: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is none: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is none: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === OPERATOR_IS_ALL) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is all: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is all: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is all: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === OPERATOR_IS_NOT_ALL) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not all: Admin, Editor". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not all: Admin, Editor". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is not all: %2$s'), filter.name, activeElements.map(element => element.label).join(', ')), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is: Admin". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is: Admin". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is: %2$s'), filter.name, activeElements[0].label), filterTextWrappers); } if (filterInView?.operator === constants_OPERATOR_IS_NOT) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not: Admin". */ + return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. 3: Filter value. e.g.: "Author is not: Admin". */ (0,external_wp_i18n_namespaceObject.__)('%1$s is not: %2$s'), filter.name, activeElements[0].label), filterTextWrappers); } - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name e.g.: "Unknown status for Author". */ + return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name e.g.: "Unknown status for Author". */ (0,external_wp_i18n_namespaceObject.__)('Unknown status for %1$s'), filter.name); }; function OperatorSelector({ @@ -31847,22 +33402,23 @@ value: operator, label: OPERATORS[operator]?.label })); - const currentFilter = view.filters.find(_filter => _filter.field === filter.field); + const currentFilter = view.filters?.find(_filter => _filter.field === filter.field); const value = currentFilter?.operator || filter.operators[0]; return operatorOptions.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, justify: "flex-start", - className: "dataviews-filter-summary__operators-container", + className: "dataviews-filters__summary-operators-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "dataviews-filter-summary__operators-filter-name", + className: "dataviews-filters__summary-operators-filter-name", children: filter.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { label: (0,external_wp_i18n_namespaceObject.__)('Conditions'), value: value, options: operatorOptions, onChange: newValue => { + var _view$filters, _view$filters2; const operator = newValue; - const newFilters = currentFilter ? [...view.filters.map(_filter => { + const newFilters = currentFilter ? [...((_view$filters = view.filters) !== null && _view$filters !== void 0 ? _view$filters : []).map(_filter => { if (_filter.field === filter.field) { return { ..._filter, @@ -31870,7 +33426,7 @@ }; } return _filter; - })] : [...view.filters, { + })] : [...((_view$filters2 = view.filters) !== null && _view$filters2 !== void 0 ? _view$filters2 : []), { field: filter.field, operator, value: undefined @@ -31898,7 +33454,7 @@ view, onChangeView } = commonProps; - const filterInView = view.filters.find(f => f.field === filter.field); + const filterInView = view.filters?.find(f => f.field === filter.field); const activeElements = filter.elements.filter(element => { if (filter.singleSelection) { return element.value === filterInView?.value; @@ -31910,7 +33466,7 @@ const canResetOrRemove = !isPrimary || hasValues; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { defaultOpen: openedFilter === filter.field, - contentClassName: "dataviews-filter-summary__popover", + contentClassName: "dataviews-filters__summary-popover", popoverProps: { placement: 'bottom-start', role: 'dialog' @@ -31922,13 +33478,13 @@ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "dataviews-filter-summary__chip-container", + className: "dataviews-filters__summary-chip-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { - text: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: Filter name. */ + text: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Filter name. */ (0,external_wp_i18n_namespaceObject.__)('Filter by: %1$s'), filter.name.toLowerCase()), placement: "top", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('dataviews-filter-summary__chip', { + className: dist_clsx('dataviews-filters__summary-chip', { 'has-reset': canResetOrRemove, 'has-values': hasValues }), @@ -31954,14 +33510,14 @@ text: isPrimary ? (0,external_wp_i18n_namespaceObject.__)('Reset') : (0,external_wp_i18n_namespaceObject.__)('Remove'), placement: "top", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { - className: dist_clsx('dataviews-filter-summary__chip-remove', { + className: dist_clsx('dataviews-filters__summary-chip-remove', { 'has-values': hasValues }), onClick: () => { onChangeView({ ...view, page: 1, - filters: view.filters.filter(_filter => _filter.field !== filter.field) + filters: view.filters?.filter(_filter => _filter.field !== filter.field) }); // If the filter is not primary and can be removed, it will be added // back to the available filters from `Add filter` component. @@ -31992,7 +33548,17 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/add-filter.js +;// ./node_modules/@wordpress/dataviews/build-module/lock-unlock.js +/** + * WordPress dependencies + */ + +const { + lock: lock_unlock_lock, + unlock: lock_unlock_unlock +} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/dataviews'); + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js /** * External dependencies */ @@ -32010,10 +33576,42 @@ const { - DropdownMenuV2: add_filter_DropdownMenu, - DropdownMenuItemV2: add_filter_DropdownMenuItem, - DropdownMenuItemLabelV2: add_filter_DropdownMenuItemLabel -} = build_module_lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); + Menu: add_filter_Menu +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function AddFilterMenu({ + filters, + view, + onChangeView, + setOpenedFilter, + triggerProps +}) { + const inactiveFilters = filters.filter(filter => !filter.isVisible); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(add_filter_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.TriggerButton, { + ...triggerProps + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.Popover, { + children: inactiveFilters.map(filter => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.Item, { + onClick: () => { + setOpenedFilter(filter.field); + onChangeView({ + ...view, + page: 1, + filters: [...(view.filters || []), { + field: filter.field, + value: undefined, + operator: filter.operators[0] + }] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_Menu.ItemLabel, { + children: filter.name + }) + }, filter.field); + }) + })] + }); +} function AddFilter({ filters, view, @@ -32026,40 +33624,27 @@ return null; } const inactiveFilters = filters.filter(filter => !filter.isVisible); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenu, { - trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __experimentalIsFocusable: true, - size: "compact", - className: "dataviews-filters-button", - variant: "tertiary", - disabled: !inactiveFilters.length, - ref: ref, + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterMenu, { + triggerProps: { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + accessibleWhenDisabled: true, + size: "compact", + className: "dataviews-filters-button", + variant: "tertiary", + disabled: !inactiveFilters.length, + ref: ref + }), children: (0,external_wp_i18n_namespaceObject.__)('Add filter') - }), - children: inactiveFilters.map(filter => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenuItem, { - onClick: () => { - setOpenedFilter(filter.field); - onChangeView({ - ...view, - page: 1, - filters: [...(view.filters || []), { - field: filter.field, - value: undefined, - operator: filter.operators[0] - }] - }); - }, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter_DropdownMenuItemLabel, { - children: filter.name - }) - }, filter.field); - }) + }, + filters, + view, + onChangeView, + setOpenedFilter }); } /* harmony default export */ const add_filter = ((0,external_wp_element_namespaceObject.forwardRef)(AddFilter)); -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/reset-filters.js +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js /** * WordPress dependencies */ @@ -32079,7 +33664,7 @@ const isDisabled = !view.search && !view.filters?.some(_filter => _filter.value !== undefined || !isPrimary(_filter.field)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { disabled: isDisabled, - __experimentalIsFocusable: true, + accessibleWhenDisabled: true, size: "compact", variant: "tertiary", className: "dataviews-filters__reset-button", @@ -32095,61 +33680,169 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/filters.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -function _Filters({ - fields, +;// ./node_modules/@wordpress/dataviews/build-module/utils.js +/** + * Internal dependencies + */ + +function sanitizeOperators(field) { + let operators = field.filterBy?.operators; + + // Assign default values. + if (!operators || !Array.isArray(operators)) { + operators = [constants_OPERATOR_IS_ANY, constants_OPERATOR_IS_NONE]; + } + + // Make sure only valid operators are used. + operators = operators.filter(operator => ALL_OPERATORS.includes(operator)); + + // Do not allow mixing single & multiselection operators. + // Remove multiselection operators if any of the single selection ones is present. + if (operators.includes(constants_OPERATOR_IS) || operators.includes(constants_OPERATOR_IS_NOT)) { + operators = operators.filter(operator => [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT].includes(operator)); + } + return operators; +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + + + +function useFilters(fields, view) { + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const filters = []; + fields.forEach(field => { + if (!field.elements?.length) { + return; + } + const operators = sanitizeOperators(field); + if (operators.length === 0) { + return; + } + const isPrimary = !!field.filterBy?.isPrimary; + filters.push({ + field: field.id, + name: field.label, + elements: field.elements, + singleSelection: operators.some(op => [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT].includes(op)), + operators, + isVisible: isPrimary || !!view.filters?.some(f => f.field === field.id && ALL_OPERATORS.includes(f.operator)), + isPrimary + }); + }); + // Sort filters by primary property. We need the primary filters to be first. + // Then we sort by name. + filters.sort((a, b) => { + if (a.isPrimary && !b.isPrimary) { + return -1; + } + if (!a.isPrimary && b.isPrimary) { + return 1; + } + return a.name.localeCompare(b.name); + }); + return filters; + }, [fields, view]); +} +function FiltersToggle({ + filters, view, onChangeView, - openedFilter, - setOpenedFilter -}) { + setOpenedFilter, + isShowingFilter, + setIsShowingFilter +}) { + const buttonRef = (0,external_wp_element_namespaceObject.useRef)(null); + const onChangeViewWithFilterVisibility = (0,external_wp_element_namespaceObject.useCallback)(_view => { + onChangeView(_view); + setIsShowingFilter(true); + }, [onChangeView, setIsShowingFilter]); + const visibleFilters = filters.filter(filter => filter.isVisible); + const hasVisibleFilters = !!visibleFilters.length; + if (filters.length === 0) { + return null; + } + const addFilterButtonProps = { + label: (0,external_wp_i18n_namespaceObject.__)('Add filter'), + 'aria-expanded': false, + isPressed: false + }; + const toggleFiltersButtonProps = { + label: (0,external_wp_i18n_namespaceObject._x)('Filter', 'verb'), + 'aria-expanded': isShowingFilter, + isPressed: isShowingFilter, + onClick: () => { + if (!isShowingFilter) { + setOpenedFilter(null); + } + setIsShowingFilter(!isShowingFilter); + } + }; + const buttonComponent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + ref: buttonRef, + className: "dataviews-filters__visibility-toggle", + size: "compact", + icon: library_funnel, + ...(hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps) + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-filters__container-visibility-toggle", + children: !hasVisibleFilters ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddFilterMenu, { + filters: filters, + view: view, + onChangeView: onChangeViewWithFilterVisibility, + setOpenedFilter: setOpenedFilter, + triggerProps: { + render: buttonComponent + } + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FilterVisibilityToggle, { + buttonRef: buttonRef, + filtersCount: view.filters?.length, + children: buttonComponent + }) + }); +} +function FilterVisibilityToggle({ + buttonRef, + filtersCount, + children +}) { + // Focus the `add filter` button when unmounts. + (0,external_wp_element_namespaceObject.useEffect)(() => () => { + buttonRef.current?.focus(); + }, [buttonRef]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [children, !!filtersCount && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-filters-toggle__count", + children: filtersCount + })] + }); +} +function Filters() { + const { + fields, + view, + onChangeView, + openedFilter, + setOpenedFilter + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); const addFilterRef = (0,external_wp_element_namespaceObject.useRef)(null); - const filters = []; - fields.forEach(field => { - if (!field.elements?.length) { - return; - } - const operators = sanitizeOperators(field); - if (operators.length === 0) { - return; - } - const isPrimary = !!field.filterBy?.isPrimary; - filters.push({ - field: field.id, - name: field.header, - elements: field.elements, - singleSelection: operators.some(op => [constants_OPERATOR_IS, constants_OPERATOR_IS_NOT].includes(op)), - operators, - isVisible: isPrimary || view.filters.some(f => f.field === field.id && ALL_OPERATORS.includes(f.operator)), - isPrimary - }); - }); - // Sort filters by primary property. We need the primary filters to be first. - // Then we sort by name. - filters.sort((a, b) => { - if (a.isPrimary && !b.isPrimary) { - return -1; - } - if (!a.isPrimary && b.isPrimary) { - return 1; - } - return a.name.localeCompare(b.name); - }); + const filters = useFilters(fields, view); const addFilter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_filter, { filters: filters, view: view, @@ -32157,10 +33850,11 @@ ref: addFilterRef, setOpenedFilter: setOpenedFilter }, "add-filter"); - const filterComponents = [...filters.map(filter => { - if (!filter.isVisible) { - return null; - } + const visibleFilters = filters.filter(filter => filter.isVisible); + if (visibleFilters.length === 0) { + return null; + } + const filterComponents = [...visibleFilters.map(filter => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FilterSummary, { filter: filter, view: view, @@ -32169,45 +33863,2228 @@ openedFilter: openedFilter }, filter.field); }), addFilter]; - if (filterComponents.length > 1) { - filterComponents.push( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetFilter, { - filters: filters, - view: view, - onChangeView: onChangeView - }, "reset-filters")); - } + filterComponents.push(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetFilter, { + filters: filters, + view: view, + onChangeView: onChangeView + }, "reset-filters")); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", style: { width: 'fit-content' }, + className: "dataviews-filters__container", wrap: true, children: filterComponents }); } - -// A type assertion is used here to keep the type argument. -const Filters = (0,external_wp_element_namespaceObject.memo)(_Filters); -/* harmony default export */ const filters = (Filters); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/search.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - -const Search = (0,external_wp_element_namespaceObject.memo)(function Search({ - label, +/* harmony default export */ const dataviews_filters = ((0,external_wp_element_namespaceObject.memo)(Filters)); + +;// ./node_modules/@wordpress/icons/build-module/library/block-table.js +/** + * WordPress dependencies + */ + + +const blockTable = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" + }) +}); +/* harmony default export */ const block_table = (blockTable); + +;// ./node_modules/@wordpress/icons/build-module/library/category.js +/** + * WordPress dependencies + */ + + +const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", + fillRule: "evenodd", + clipRule: "evenodd" + }) +}); +/* harmony default export */ const library_category = (category); + +;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js +/** + * WordPress dependencies + */ + + +const formatListBulletsRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" + }) +}); +/* harmony default export */ const format_list_bullets_rtl = (formatListBulletsRTL); + +;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js +/** + * WordPress dependencies + */ + + +const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" + }) +}); +/* harmony default export */ const format_list_bullets = (formatListBullets); + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +function DataViewsSelectionCheckbox({ + selection, + onChangeSelection, + item, + getItemId, + titleField, + disabled +}) { + const id = getItemId(item); + const checked = !disabled && selection.includes(id); + + // Fallback label to ensure accessibility + const selectionLabel = titleField?.getValue?.({ + item + }) || (0,external_wp_i18n_namespaceObject.__)('(no title)'); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { + className: "dataviews-selection-checkbox", + __nextHasNoMarginBottom: true, + "aria-label": selectionLabel, + "aria-disabled": disabled, + checked: checked, + onChange: () => { + if (disabled) { + return; + } + onChangeSelection(selection.includes(id) ? selection.filter(itemId => id !== itemId) : [...selection, id]); + } + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + +const { + Menu: dataviews_item_actions_Menu, + kebabCase: dataviews_item_actions_kebabCase +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function ButtonTrigger({ + action, + onClick, + items +}) { + const label = typeof action.label === 'string' ? action.label : action.label(items); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: label, + icon: action.icon, + disabled: !!action.disabled, + accessibleWhenDisabled: true, + isDestructive: action.isDestructive, + size: "compact", + onClick: onClick + }); +} +function MenuItemTrigger({ + action, + onClick, + items +}) { + const label = typeof action.label === 'string' ? action.label : action.label(items); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Item, { + disabled: action.disabled, + onClick: onClick, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.ItemLabel, { + children: label + }) + }); +} +function ActionModal({ + action, + items, + closeModal +}) { + const label = typeof action.label === 'string' ? action.label : action.label(items); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: action.modalHeader || label, + __experimentalHideHeader: !!action.hideModalHeader, + onRequestClose: closeModal, + focusOnMount: "firstContentElement", + size: "medium", + overlayClassName: `dataviews-action-modal dataviews-action-modal__${dataviews_item_actions_kebabCase(action.id)}`, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action.RenderModal, { + items: items, + closeModal: closeModal + }) + }); +} +function ActionsMenuGroup({ + actions, + item, + registry, + setActiveModalAction +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Group, { + children: actions.map(action => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuItemTrigger, { + action: action, + onClick: () => { + if ('RenderModal' in action) { + setActiveModalAction(action); + return; + } + action.callback([item], { + registry + }); + }, + items: [item] + }, action.id)) + }); +} +function ItemActions({ + item, + actions, + isCompact +}) { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + primaryActions, + eligibleActions + } = (0,external_wp_element_namespaceObject.useMemo)(() => { + // If an action is eligible for all items, doesn't need + // to provide the `isEligible` function. + const _eligibleActions = actions.filter(action => !action.isEligible || action.isEligible(item)); + const _primaryActions = _eligibleActions.filter(action => action.isPrimary && !!action.icon); + return { + primaryActions: _primaryActions, + eligibleActions: _eligibleActions + }; + }, [actions, item]); + if (isCompact) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { + item: item, + actions: eligibleActions, + isSmall: true, + registry: registry + }); + } + + // If all actions are primary, there is no need to render the dropdown. + if (primaryActions.length === eligibleActions.length) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrimaryActions, { + item: item, + actions: primaryActions, + registry: registry + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 1, + justify: "flex-end", + className: "dataviews-item-actions", + style: { + flexShrink: '0', + width: 'auto' + }, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrimaryActions, { + item: item, + actions: primaryActions, + registry: registry + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompactItemActions, { + item: item, + actions: eligibleActions, + registry: registry + })] + }); +} +function CompactItemActions({ + item, + actions, + isSmall, + registry +}) { + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_item_actions_Menu, { + placement: "bottom-end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: isSmall ? 'small' : 'compact', + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + accessibleWhenDisabled: true, + disabled: !actions.length, + className: "dataviews-all-actions-button" + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_item_actions_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsMenuGroup, { + actions: actions, + item: item, + registry: registry, + setActiveModalAction: setActiveModalAction + }) + })] + }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] + }); +} +function PrimaryActions({ + item, + actions, + registry +}) { + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + if (!Array.isArray(actions) || actions.length === 0) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [actions.map(action => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ButtonTrigger, { + action: action, + onClick: () => { + if ('RenderModal' in action) { + setActiveModalAction(action); + return; + } + action.callback([item], { + registry + }); + }, + items: [item] + }, action.id)), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + + + +function ActionWithModal({ + action, + items, + ActionTriggerComponent +}) { + const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const actionTriggerProps = { + action, + onClick: () => { + setIsModalOpen(true); + }, + items + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTriggerComponent, { + ...actionTriggerProps + }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: action, + items: items, + closeModal: () => setIsModalOpen(false) + })] + }); +} +function useHasAPossibleBulkAction(actions, item) { + return (0,external_wp_element_namespaceObject.useMemo)(() => { + return actions.some(action => { + return action.supportsBulk && (!action.isEligible || action.isEligible(item)); + }); + }, [actions, item]); +} +function useSomeItemHasAPossibleBulkAction(actions, data) { + return (0,external_wp_element_namespaceObject.useMemo)(() => { + return data.some(item => { + return actions.some(action => { + return action.supportsBulk && (!action.isEligible || action.isEligible(item)); + }); + }); + }, [actions, data]); +} +function BulkSelectionCheckbox({ + selection, + onChangeSelection, + data, + actions, + getItemId +}) { + const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return data.filter(item => { + return actions.some(action => action.supportsBulk && (!action.isEligible || action.isEligible(item))); + }); + }, [data, actions]); + const selectedItems = data.filter(item => selection.includes(getItemId(item)) && selectableItems.includes(item)); + const areAllSelected = selectedItems.length === selectableItems.length; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { + className: "dataviews-view-table-selection-checkbox", + __nextHasNoMarginBottom: true, + checked: areAllSelected, + indeterminate: !areAllSelected && !!selectedItems.length, + onChange: () => { + if (areAllSelected) { + onChangeSelection([]); + } else { + onChangeSelection(selectableItems.map(item => getItemId(item))); + } + }, + "aria-label": areAllSelected ? (0,external_wp_i18n_namespaceObject.__)('Deselect all') : (0,external_wp_i18n_namespaceObject.__)('Select all') + }); +} +function ActionTrigger({ + action, + onClick, + isBusy, + items +}) { + const label = typeof action.label === 'string' ? action.label : action.label(items); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + disabled: isBusy, + accessibleWhenDisabled: true, + label: label, + icon: action.icon, + isDestructive: action.isDestructive, + size: "compact", + onClick: onClick, + isBusy: isBusy, + tooltipPosition: "top" + }); +} +const dataviews_bulk_actions_EMPTY_ARRAY = []; +function ActionButton({ + action, + selectedItems, + actionInProgress, + setActionInProgress +}) { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const selectedEligibleItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return selectedItems.filter(item => { + return !action.isEligible || action.isEligible(item); + }); + }, [action, selectedItems]); + if ('RenderModal' in action) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { + action: action, + items: selectedEligibleItems, + ActionTriggerComponent: ActionTrigger + }, action.id); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { + action: action, + onClick: async () => { + setActionInProgress(action.id); + await action.callback(selectedItems, { + registry + }); + setActionInProgress(null); + }, + items: selectedEligibleItems, + isBusy: actionInProgress === action.id + }, action.id); +} +function renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection) { + const message = selectedItems.length > 0 ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of items. */ + (0,external_wp_i18n_namespaceObject._n)('%d Item selected', '%d Items selected', selectedItems.length), selectedItems.length) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of items. */ + (0,external_wp_i18n_namespaceObject._n)('%d Item', '%d Items', data.length), data.length); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + className: "dataviews-bulk-actions-footer__container", + spacing: 3, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkSelectionCheckbox, { + selection: selection, + onChangeSelection: onChangeSelection, + data: data, + actions: actions, + getItemId: getItemId + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-bulk-actions-footer__item-count", + children: message + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataviews-bulk-actions-footer__action-buttons", + expanded: false, + spacing: 1, + children: [actionsToShow.map(action => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionButton, { + action: action, + selectedItems: selectedItems, + actionInProgress: actionInProgress, + setActionInProgress: setActionInProgress + }, action.id); + }), selectedItems.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + icon: close_small, + showTooltip: true, + tooltipPosition: "top", + size: "compact", + label: (0,external_wp_i18n_namespaceObject.__)('Cancel'), + disabled: !!actionInProgress, + accessibleWhenDisabled: false, + onClick: () => { + onChangeSelection(dataviews_bulk_actions_EMPTY_ARRAY); + } + })] + })] + }); +} +function FooterContent({ + selection, + actions, + onChangeSelection, + data, + getItemId +}) { + const [actionInProgress, setActionInProgress] = (0,external_wp_element_namespaceObject.useState)(null); + const footerContentRef = (0,external_wp_element_namespaceObject.useRef)(null); + const bulkActions = (0,external_wp_element_namespaceObject.useMemo)(() => actions.filter(action => action.supportsBulk), [actions]); + const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return data.filter(item => { + return bulkActions.some(action => !action.isEligible || action.isEligible(item)); + }); + }, [data, bulkActions]); + const selectedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { + return data.filter(item => selection.includes(getItemId(item)) && selectableItems.includes(item)); + }, [selection, data, getItemId, selectableItems]); + const actionsToShow = (0,external_wp_element_namespaceObject.useMemo)(() => actions.filter(action => { + return action.supportsBulk && action.icon && selectedItems.some(item => !action.isEligible || action.isEligible(item)); + }), [actions, selectedItems]); + if (!actionInProgress) { + if (footerContentRef.current) { + footerContentRef.current = null; + } + return renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection); + } else if (!footerContentRef.current) { + footerContentRef.current = renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection); + } + return footerContentRef.current; +} +function BulkActionsFooter() { + const { + data, + selection, + actions = dataviews_bulk_actions_EMPTY_ARRAY, + onChangeSelection, + getItemId + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FooterContent, { + selection: selection, + onChangeSelection: onChangeSelection, + data: data, + actions: actions, + getItemId: getItemId + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js +/** + * WordPress dependencies + */ + + +const arrowLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" + }) +}); +/* harmony default export */ const arrow_left = (arrowLeft); + +;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js +/** + * WordPress dependencies + */ + + +const arrowRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" + }) +}); +/* harmony default export */ const arrow_right = (arrowRight); + +;// ./node_modules/@wordpress/icons/build-module/library/unseen.js +/** + * WordPress dependencies + */ + + +const unseen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" + }) +}); +/* harmony default export */ const library_unseen = (unseen); + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + +const { + Menu: column_header_menu_Menu +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function WithMenuSeparators({ + children +}) { + return external_wp_element_namespaceObject.Children.toArray(children).filter(Boolean).map((child, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { + children: [i > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Separator, {}), child] + }, i)); +} +const _HeaderMenu = (0,external_wp_element_namespaceObject.forwardRef)(function HeaderMenu({ + fieldId, + view, + fields, + onChangeView, + onHide, + setOpenedFilter, + canMove = true +}, ref) { + var _view$fields; + const visibleFieldIds = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const index = visibleFieldIds?.indexOf(fieldId); + const isSorted = view.sort?.field === fieldId; + let isHidable = false; + let isSortable = false; + let canAddFilter = false; + let operators = []; + const field = fields.find(f => f.id === fieldId); + if (!field) { + // No combined or regular field found. + return null; + } + isHidable = field.enableHiding !== false; + isSortable = field.enableSorting !== false; + const header = field.header; + operators = sanitizeOperators(field); + // Filter can be added: + // 1. If the field is not already part of a view's filters. + // 2. If the field meets the type and operator requirements. + // 3. If it's not primary. If it is, it should be already visible. + canAddFilter = !view.filters?.some(_filter => fieldId === _filter.field) && !!field.elements?.length && !!operators.length && !field.filterBy?.isPrimary; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + className: "dataviews-view-table-header-button", + ref: ref, + variant: "tertiary" + }), + children: [header, view.sort && isSorted && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + "aria-hidden": "true", + children: sortArrows[view.sort.direction] + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Popover, { + style: { + minWidth: '240px' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WithMenuSeparators, { + children: [isSortable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { + children: SORTING_DIRECTIONS.map(direction => { + const isChecked = view.sort && isSorted && view.sort.direction === direction; + const value = `${fieldId}-${direction}`; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.RadioItem, { + // All sorting radio items share the same name, so that + // selecting a sorting option automatically deselects the + // previously selected one, even if it is displayed in + // another submenu. The field and direction are passed via + // the `value` prop. + name: "view-table-sorting", + value: value, + checked: isChecked, + onChange: () => { + onChangeView({ + ...view, + sort: { + field: fieldId, + direction + }, + showLevels: false + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: sortLabels[direction] + }) + }, value); + }) + }), canAddFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Group, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_funnel + }), + onClick: () => { + setOpenedFilter(fieldId); + onChangeView({ + ...view, + page: 1, + filters: [...(view.filters || []), { + field: fieldId, + value: undefined, + operator: operators[0] + }] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Add filter') + }) + }) + }), (canMove || isHidable) && field && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(column_header_menu_Menu.Group, { + children: [canMove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: arrow_left + }), + disabled: index < 1, + onClick: () => { + var _visibleFieldIds$slic; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), fieldId, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Move left') + }) + }), canMove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: arrow_right + }), + disabled: index >= visibleFieldIds.length - 1, + onClick: () => { + var _visibleFieldIds$slic2; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], fieldId, ...visibleFieldIds.slice(index + 2)] + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Move right') + }) + }), isHidable && field && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.Item, { + prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_unseen + }), + onClick: () => { + onHide(field); + onChangeView({ + ...view, + fields: visibleFieldIds.filter(id => id !== fieldId) + }); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu_Menu.ItemLabel, { + children: (0,external_wp_i18n_namespaceObject.__)('Hide column') + }) + })] + })] + }) + })] + }); +}); + +// @ts-expect-error Lift the `Item` type argument through the forwardRef. +const ColumnHeaderMenu = _HeaderMenu; +/* harmony default export */ const column_header_menu = (ColumnHeaderMenu); + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-clickable-item-props.js +function getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className +}) { + if (!isItemClickable(item) || !onClickItem) { + return { + className + }; + } + return { + className: className ? `${className} ${className}--clickable` : undefined, + role: 'button', + tabIndex: 0, + onClick: event => { + // Prevents onChangeSelection from triggering. + event.stopPropagation(); + onClickItem(item); + }, + onKeyDown: event => { + if (event.key === 'Enter' || event.key === '' || event.key === ' ') { + // Prevents onChangeSelection from triggering. + event.stopPropagation(); + onClickItem(item); + } + } + }; +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function ColumnPrimary({ + item, + level, + titleField, + mediaField, + descriptionField, + onClickItem, + isItemClickable +}) { + const clickableProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-table__cell-content-wrapper dataviews-title-field' + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + justify: "flex-start", + children: [mediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { + item: item + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 0, + children: [titleField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + ...clickableProps, + children: [level !== undefined && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: "dataviews-view-table__level", + children: ['—'.repeat(level), "\xA0"] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { + item: item + })] + }), descriptionField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + })] + })] + }); +} +/* harmony default export */ const column_primary = (ColumnPrimary); + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + +function TableColumnField({ + item, + fields, + column +}) { + const field = fields.find(f => f.id === column); + if (!field) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-table__cell-content-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item + }) + }); +} +function TableRow({ + hasBulkActions, + item, + level, + actions, + fields, + id, view, - onChangeView -}) { + titleField, + mediaField, + descriptionField, + selection, + getItemId, + isItemClickable, + onClickItem, + onChangeSelection +}) { + var _view$fields; + const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item); + const isSelected = hasPossibleBulkAction && selection.includes(id); + const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; + const handleMouseEnter = () => { + setIsHovered(true); + }; + const handleMouseLeave = () => { + setIsHovered(false); + }; + + // Will be set to true if `onTouchStart` fires. This happens before + // `onClick` and can be used to exclude touchscreen devices from certain + // behaviours. + const isTouchDeviceRef = (0,external_wp_element_namespaceObject.useRef)(false); + const columns = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { + className: dist_clsx('dataviews-view-table__row', { + 'is-selected': hasPossibleBulkAction && isSelected, + 'is-hovered': isHovered, + 'has-bulk-actions': hasPossibleBulkAction + }), + onMouseEnter: handleMouseEnter, + onMouseLeave: handleMouseLeave, + onTouchStart: () => { + isTouchDeviceRef.current = true; + }, + onClick: () => { + if (!hasPossibleBulkAction) { + return; + } + if (!isTouchDeviceRef.current && document.getSelection()?.type !== 'Range') { + onChangeSelection(selection.includes(id) ? selection.filter(itemId => id !== itemId) : [id]); + } + }, + children: [hasBulkActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { + className: "dataviews-view-table__checkbox-column", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-table__cell-content-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSelectionCheckbox, { + item: item, + selection: selection, + onChangeSelection: onChangeSelection, + getItemId: getItemId, + titleField: titleField, + disabled: !hasPossibleBulkAction + }) + }) + }), hasPrimaryColumn && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_primary, { + item: item, + level: level, + titleField: showTitle ? titleField : undefined, + mediaField: showMedia ? mediaField : undefined, + descriptionField: showDescription ? descriptionField : undefined, + isItemClickable: isItemClickable, + onClickItem: onClickItem + }) + }), columns.map(column => { + var _view$layout$styles$c; + // Explicit picks the supported styles. + const { + width, + maxWidth, + minWidth + } = (_view$layout$styles$c = view.layout?.styles?.[column]) !== null && _view$layout$styles$c !== void 0 ? _view$layout$styles$c : {}; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { + style: { + width, + maxWidth, + minWidth + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableColumnField, { + fields: fields, + item: item, + column: column + }) + }, column); + }), !!actions?.length && + /*#__PURE__*/ + // Disable reason: we are not making the element interactive, + // but preventing any click events from bubbling up to the + // table row. This allows us to add a click handler to the row + // itself (to toggle row selection) without erroneously + // intercepting click events from ItemActions. + /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ + (0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { + className: "dataviews-view-table__actions-column", + onClick: e => e.stopPropagation(), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { + item: item, + actions: actions + }) + }) + /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */] + }); +} +function ViewTable({ + actions, + data, + fields, + getItemId, + getItemLevel, + isLoading = false, + onChangeView, + onChangeSelection, + selection, + setOpenedFilter, + onClickItem, + isItemClickable, + view +}) { + var _view$fields2; + const headerMenuRefs = (0,external_wp_element_namespaceObject.useRef)(new Map()); + const headerMenuToFocusRef = (0,external_wp_element_namespaceObject.useRef)(); + const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,external_wp_element_namespaceObject.useState)(); + const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (headerMenuToFocusRef.current) { + headerMenuToFocusRef.current.focus(); + headerMenuToFocusRef.current = undefined; + } + }); + const tableNoticeId = (0,external_wp_element_namespaceObject.useId)(); + if (nextHeaderMenuToFocus) { + // If we need to force focus, we short-circuit rendering here + // to prevent any additional work while we handle that. + // Clearing out the focus directive is necessary to make sure + // future renders don't cause unexpected focus jumps. + headerMenuToFocusRef.current = nextHeaderMenuToFocus; + setNextHeaderMenuToFocus(undefined); + return; + } + const onHide = field => { + const hidden = headerMenuRefs.current.get(field.id); + const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : undefined; + setNextHeaderMenuToFocus(fallback?.node); + }; + const hasData = !!data?.length; + const titleField = fields.find(field => field.id === view.titleField); + const mediaField = fields.find(field => field.id === view.mediaField); + const descriptionField = fields.find(field => field.id === view.descriptionField); + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; + const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription; + const columns = (_view$fields2 = view.fields) !== null && _view$fields2 !== void 0 ? _view$fields2 : []; + const headerMenuRef = (column, index) => node => { + if (node) { + headerMenuRefs.current.set(column, { + node, + fallback: columns[index > 0 ? index - 1 : 1] + }); + } else { + headerMenuRefs.current.delete(column); + } + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { + className: dist_clsx('dataviews-view-table', { + [`has-${view.layout?.density}-density`]: view.layout?.density && ['compact', 'comfortable'].includes(view.layout.density) + }), + "aria-busy": isLoading, + "aria-describedby": tableNoticeId, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("thead", { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("tr", { + className: "dataviews-view-table__row", + children: [hasBulkActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { + className: "dataviews-view-table__checkbox-column", + scope: "col", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkSelectionCheckbox, { + selection: selection, + onChangeSelection: onChangeSelection, + data: data, + actions: actions, + getItemId: getItemId + }) + }), hasPrimaryColumn && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { + scope: "col", + children: titleField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu, { + ref: headerMenuRef(titleField.id, 0), + fieldId: titleField.id, + view: view, + fields: fields, + onChangeView: onChangeView, + onHide: onHide, + setOpenedFilter: setOpenedFilter, + canMove: false + }) + }), columns.map((column, index) => { + var _view$layout$styles$c2; + // Explicit picks the supported styles. + const { + width, + maxWidth, + minWidth + } = (_view$layout$styles$c2 = view.layout?.styles?.[column]) !== null && _view$layout$styles$c2 !== void 0 ? _view$layout$styles$c2 : {}; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { + style: { + width, + maxWidth, + minWidth + }, + "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : undefined, + scope: "col", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(column_header_menu, { + ref: headerMenuRef(column, index), + fieldId: column, + view: view, + fields: fields, + onChangeView: onChangeView, + onHide: onHide, + setOpenedFilter: setOpenedFilter + }) + }, column); + }), !!actions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("th", { + className: "dataviews-view-table__actions-column", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-view-table-header", + children: (0,external_wp_i18n_namespaceObject.__)('Actions') + }) + })] + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tbody", { + children: hasData && data.map((item, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableRow, { + item: item, + level: view.showLevels && typeof getItemLevel === 'function' ? getItemLevel(item) : undefined, + hasBulkActions: hasBulkActions, + actions: actions, + fields: fields, + id: getItemId(item) || index.toString(), + view: view, + titleField: titleField, + mediaField: mediaField, + descriptionField: descriptionField, + selection: selection, + getItemId: getItemId, + onChangeSelection: onChangeSelection, + onClickItem: onClickItem, + isItemClickable: isItemClickable + }, getItemId(item))) + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx({ + 'dataviews-loading': isLoading, + 'dataviews-no-results': !hasData && !isLoading + }), + id: tableNoticeId, + children: !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') + }) + })] + }); +} +/* harmony default export */ const table = (ViewTable); + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/preview-size-picker.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +const viewportBreaks = { + xhuge: { + min: 3, + max: 6, + default: 5 + }, + huge: { + min: 2, + max: 4, + default: 4 + }, + xlarge: { + min: 2, + max: 3, + default: 3 + }, + large: { + min: 1, + max: 2, + default: 2 + }, + mobile: { + min: 1, + max: 2, + default: 2 + } +}; + +/** + * Breakpoints were adjusted from media queries breakpoints to account for + * the sidebar width. This was done to match the existing styles we had. + */ +const BREAKPOINTS = { + xhuge: 1520, + huge: 1140, + xlarge: 780, + large: 480, + mobile: 0 +}; +function useViewPortBreakpoint() { + const containerWidth = (0,external_wp_element_namespaceObject.useContext)(dataviews_context).containerWidth; + for (const [key, value] of Object.entries(BREAKPOINTS)) { + if (containerWidth >= value) { + return key; + } + } + return 'mobile'; +} +function useUpdatedPreviewSizeOnViewportChange() { + const view = (0,external_wp_element_namespaceObject.useContext)(dataviews_context).view; + const viewport = useViewPortBreakpoint(); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + const previewSize = view.layout?.previewSize; + let newPreviewSize; + if (!previewSize) { + return; + } + const breakValues = viewportBreaks[viewport]; + if (previewSize < breakValues.min) { + newPreviewSize = breakValues.min; + } + if (previewSize > breakValues.max) { + newPreviewSize = breakValues.max; + } + return newPreviewSize; + }, [viewport, view]); +} +function PreviewSizePicker() { + const viewport = useViewPortBreakpoint(); + const context = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const view = context.view; + const breakValues = viewportBreaks[viewport]; + const previewSizeToUse = view.layout?.previewSize || breakValues.default; + const marks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.from({ + length: breakValues.max - breakValues.min + 1 + }, (_, i) => { + return { + value: breakValues.min + i + }; + }), [breakValues]); + if (viewport === 'mobile') { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + showTooltip: false, + label: (0,external_wp_i18n_namespaceObject.__)('Preview size'), + value: breakValues.max + breakValues.min - previewSizeToUse, + marks: marks, + min: breakValues.min, + max: breakValues.max, + withInputField: false, + onChange: (value = 0) => { + context.onChangeView({ + ...view, + layout: { + ...view.layout, + previewSize: breakValues.max + breakValues.min - value + } + }); + }, + step: 1 + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + Badge +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function GridItem({ + view, + selection, + onChangeSelection, + onClickItem, + isItemClickable, + getItemId, + item, + actions, + mediaField, + titleField, + descriptionField, + regularFields, + badgeFields, + hasBulkActions +}) { + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; + const hasBulkAction = useHasAPossibleBulkAction(actions, item); + const id = getItemId(item); + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(GridItem); + const isSelected = selection.includes(id); + const renderedMediaField = mediaField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { + item: item + }) : null; + const renderedTitleField = showTitle && titleField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { + item: item + }) : null; + const clickableMediaItemProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-grid__media' + }); + const clickableTitleItemProps = getClickableItemProps({ + item, + isItemClickable, + onClickItem, + className: 'dataviews-view-grid__title-field dataviews-title-field' + }); + let mediaA11yProps; + let titleA11yProps; + if (isItemClickable(item) && onClickItem) { + if (renderedTitleField) { + mediaA11yProps = { + 'aria-labelledby': `dataviews-view-grid__title-field-${instanceId}` + }; + titleA11yProps = { + id: `dataviews-view-grid__title-field-${instanceId}` + }; + } else { + mediaA11yProps = { + 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Navigate to item') + }; + } + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 0, + className: dist_clsx('dataviews-view-grid__card', { + 'is-selected': hasBulkAction && isSelected + }), + onClickCapture: event => { + if (event.ctrlKey || event.metaKey) { + event.stopPropagation(); + event.preventDefault(); + if (!hasBulkAction) { + return; + } + onChangeSelection(selection.includes(id) ? selection.filter(itemId => id !== itemId) : [...selection, id]); + } + }, + children: [showMedia && renderedMediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...clickableMediaItemProps, + ...mediaA11yProps, + children: renderedMediaField + }), hasBulkActions && showMedia && renderedMediaField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSelectionCheckbox, { + item: item, + selection: selection, + onChangeSelection: onChangeSelection, + getItemId: getItemId, + titleField: titleField, + disabled: !hasBulkAction + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "space-between", + className: "dataviews-view-grid__title-actions", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + ...clickableTitleItemProps, + ...titleA11yProps, + children: renderedTitleField + }), !!actions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemActions, { + item: item, + actions: actions, + isCompact: true + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 1, + children: [showDescription && descriptionField?.render && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + }), !!badgeFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataviews-view-grid__badge-fields", + spacing: 2, + wrap: true, + alignment: "top", + justify: "flex-start", + children: badgeFields.map(field => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { + className: "dataviews-view-grid__field-value", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item: item + }) + }, field.id); + }) + }), !!regularFields?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-grid__fields", + spacing: 1, + children: regularFields.map(field => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { + className: "dataviews-view-grid__field", + gap: 1, + justify: "flex-start", + expanded: true, + style: { + height: 'auto' + }, + direction: "row", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "dataviews-view-grid__field-name", + children: field.header + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { + className: "dataviews-view-grid__field-value", + style: { + maxHeight: 'none' + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item: item + }) + })] + }) + }, field.id); + }) + })] + })] + }, id); +} +function ViewGrid({ + actions, + data, + fields, + getItemId, + isLoading, + onChangeSelection, + onClickItem, + isItemClickable, + selection, + view +}) { + var _view$fields; + const titleField = fields.find(field => field.id === view?.titleField); + const mediaField = fields.find(field => field.id === view?.mediaField); + const descriptionField = fields.find(field => field.id === view?.descriptionField); + const otherFields = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const { + regularFields, + badgeFields + } = otherFields.reduce((accumulator, fieldId) => { + const field = fields.find(f => f.id === fieldId); + if (!field) { + return accumulator; + } + // If the field is a badge field, add it to the badgeFields array + // otherwise add it to the rest visibleFields array. + const key = view.layout?.badgeFields?.includes(fieldId) ? 'badgeFields' : 'regularFields'; + accumulator[key].push(field); + return accumulator; + }, { + regularFields: [], + badgeFields: [] + }); + const hasData = !!data?.length; + const updatedPreviewSize = useUpdatedPreviewSizeOnViewportChange(); + const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); + const usedPreviewSize = updatedPreviewSize || view.layout?.previewSize; + const gridStyle = usedPreviewSize ? { + gridTemplateColumns: `repeat(${usedPreviewSize}, minmax(0, 1fr))` + } : {}; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + gap: 8, + columns: 2, + alignment: "top", + className: "dataviews-view-grid", + style: gridStyle, + "aria-busy": isLoading, + children: data.map(item => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItem, { + view: view, + selection: selection, + onChangeSelection: onChangeSelection, + onClickItem: onClickItem, + isItemClickable: isItemClickable, + getItemId: getItemId, + item: item, + actions: actions, + mediaField: mediaField, + titleField: titleField, + descriptionField: descriptionField, + regularFields: regularFields, + badgeFields: badgeFields, + hasBulkActions: hasBulkActions + }, getItemId(item)); + }) + }), !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx({ + 'dataviews-loading': isLoading, + 'dataviews-no-results': !isLoading + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') + }) + })] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + +const { + Menu: list_Menu +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +function generateItemWrapperCompositeId(idPrefix) { + return `${idPrefix}-item-wrapper`; +} +function generatePrimaryActionCompositeId(idPrefix, primaryActionId) { + return `${idPrefix}-primary-action-${primaryActionId}`; +} +function generateDropdownTriggerCompositeId(idPrefix) { + return `${idPrefix}-dropdown`; +} +function PrimaryActionGridCell({ + idPrefix, + primaryAction, + item +}) { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); + const compositeItemId = generatePrimaryActionCompositeId(idPrefix, primaryAction.id); + const label = typeof primaryAction.label === 'string' ? primaryAction.label : primaryAction.label([item]); + return 'RenderModal' in primaryAction ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + role: "gridcell", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: compositeItemId, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: label, + disabled: !!primaryAction.disabled, + accessibleWhenDisabled: true, + icon: primaryAction.icon, + isDestructive: primaryAction.isDestructive, + size: "small", + onClick: () => setIsModalOpen(true) + }), + children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: primaryAction, + items: [item], + closeModal: () => setIsModalOpen(false) + }) + }) + }, primaryAction.id) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + role: "gridcell", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: compositeItemId, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: label, + disabled: !!primaryAction.disabled, + accessibleWhenDisabled: true, + icon: primaryAction.icon, + isDestructive: primaryAction.isDestructive, + size: "small", + onClick: () => { + primaryAction.callback([item], { + registry + }); + } + }) + }) + }, primaryAction.id); +} +function ListItem({ + view, + actions, + idPrefix, + isSelected, + item, + titleField, + mediaField, + descriptionField, + onSelect, + otherFields, + onDropdownTriggerKeyDown +}) { + const { + showTitle = true, + showMedia = true, + showDescription = true + } = view; + const itemRef = (0,external_wp_element_namespaceObject.useRef)(null); + const labelId = `${idPrefix}-label`; + const descriptionId = `${idPrefix}-description`; + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); + const [activeModalAction, setActiveModalAction] = (0,external_wp_element_namespaceObject.useState)(null); + const handleHover = ({ + type + }) => { + const isHover = type === 'mouseenter'; + setIsHovered(isHover); + }; + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isSelected) { + itemRef.current?.scrollIntoView({ + behavior: 'auto', + block: 'nearest', + inline: 'nearest' + }); + } + }, [isSelected]); + const { + primaryAction, + eligibleActions + } = (0,external_wp_element_namespaceObject.useMemo)(() => { + // If an action is eligible for all items, doesn't need + // to provide the `isEligible` function. + const _eligibleActions = actions.filter(action => !action.isEligible || action.isEligible(item)); + const _primaryActions = _eligibleActions.filter(action => action.isPrimary && !!action.icon); + return { + primaryAction: _primaryActions[0], + eligibleActions: _eligibleActions + }; + }, [actions, item]); + const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1; + const renderedMediaField = showMedia && mediaField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-list__media-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(mediaField.render, { + item: item + }) + }) : null; + const renderedTitleField = showTitle && titleField?.render ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(titleField.render, { + item: item + }) : null; + const usedActions = eligibleActions?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + className: "dataviews-view-list__item-actions", + children: [primaryAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrimaryActionGridCell, { + idPrefix: idPrefix, + primaryAction: primaryAction, + item: item + }), !hasOnlyOnePrimaryAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + role: "gridcell", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(list_Menu, { + placement: "bottom-end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(list_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: generateDropdownTriggerCompositeId(idPrefix), + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "small", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Actions'), + accessibleWhenDisabled: true, + disabled: !actions.length, + onKeyDown: onDropdownTriggerKeyDown + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(list_Menu.Popover, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsMenuGroup, { + actions: eligibleActions, + item: item, + registry: registry, + setActiveModalAction: setActiveModalAction + }) + })] + }), !!activeModalAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionModal, { + action: activeModalAction, + items: [item], + closeModal: () => setActiveModalAction(null) + })] + })] + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Row, { + ref: itemRef, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), + role: "row", + className: dist_clsx({ + 'is-selected': isSelected, + 'is-hovered': isHovered + }), + onMouseEnter: handleHover, + onMouseLeave: handleHover, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataviews-view-list__item-wrapper", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + role: "gridcell", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { + id: generateItemWrapperCompositeId(idPrefix), + "aria-pressed": isSelected, + "aria-labelledby": labelId, + "aria-describedby": descriptionId, + className: "dataviews-view-list__item", + onClick: () => onSelect(item) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 3, + justify: "start", + alignment: "flex-start", + children: [renderedMediaField, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 1, + className: "dataviews-view-list__field-wrapper", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-title-field", + id: labelId, + children: renderedTitleField + }), usedActions] + }), showDescription && descriptionField?.render && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-list__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(descriptionField.render, { + item: item + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataviews-view-list__fields", + id: descriptionId, + children: otherFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "dataviews-view-list__field", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { + as: "span", + className: "dataviews-view-list__field-label", + children: field.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-view-list__field-value", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.render, { + item: item + }) + })] + }, field.id)) + })] + })] + })] + }) + }); +} +function isDefined(item) { + return !!item; +} +function ViewList(props) { + var _view$fields; + const { + actions, + data, + fields, + getItemId, + isLoading, + onChangeSelection, + selection, + view + } = props; + const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ViewList, 'view-list'); + const selectedItem = data?.findLast(item => selection.includes(getItemId(item))); + const titleField = fields.find(field => field.id === view.titleField); + const mediaField = fields.find(field => field.id === view.mediaField); + const descriptionField = fields.find(field => field.id === view.descriptionField); + const otherFields = ((_view$fields = view?.fields) !== null && _view$fields !== void 0 ? _view$fields : []).map(fieldId => fields.find(f => fieldId === f.id)).filter(isDefined); + const onSelect = item => onChangeSelection([getItemId(item)]); + const generateCompositeItemIdPrefix = (0,external_wp_element_namespaceObject.useCallback)(item => `${baseId}-${getItemId(item)}`, [baseId, getItemId]); + const isActiveCompositeItem = (0,external_wp_element_namespaceObject.useCallback)((item, idToCheck) => { + // All composite items use the same prefix in their IDs. + return idToCheck.startsWith(generateCompositeItemIdPrefix(item)); + }, [generateCompositeItemIdPrefix]); + + // Controlled state for the active composite item. + const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_namespaceObject.useState)(undefined); + + // Update the active composite item when the selected item changes. + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (selectedItem) { + setActiveCompositeId(generateItemWrapperCompositeId(generateCompositeItemIdPrefix(selectedItem))); + } + }, [selectedItem, generateCompositeItemIdPrefix]); + const activeItemIndex = data.findIndex(item => isActiveCompositeItem(item, activeCompositeId !== null && activeCompositeId !== void 0 ? activeCompositeId : '')); + const previousActiveItemIndex = (0,external_wp_compose_namespaceObject.usePrevious)(activeItemIndex); + const isActiveIdInList = activeItemIndex !== -1; + const selectCompositeItem = (0,external_wp_element_namespaceObject.useCallback)((targetIndex, generateCompositeId) => { + // Clamping between 0 and data.length - 1 to avoid out of bounds. + const clampedIndex = Math.min(data.length - 1, Math.max(0, targetIndex)); + if (!data[clampedIndex]) { + return; + } + const itemIdPrefix = generateCompositeItemIdPrefix(data[clampedIndex]); + const targetCompositeItemId = generateCompositeId(itemIdPrefix); + setActiveCompositeId(targetCompositeItemId); + document.getElementById(targetCompositeItemId)?.focus(); + }, [data, generateCompositeItemIdPrefix]); + + // Select a new active composite item when the current active item + // is removed from the list. + (0,external_wp_element_namespaceObject.useEffect)(() => { + const wasActiveIdInList = previousActiveItemIndex !== undefined && previousActiveItemIndex !== -1; + if (!isActiveIdInList && wasActiveIdInList) { + // By picking `previousActiveItemIndex` as the next item index, we are + // basically picking the item that would have been after the deleted one. + // If the previously active (and removed) item was the last of the list, + // we will select the item before it — which is the new last item. + selectCompositeItem(previousActiveItemIndex, generateItemWrapperCompositeId); + } + }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]); + + // Prevent the default behavior (open dropdown menu) and instead select the + // dropdown menu trigger on the previous/next row. + // https://github.com/ariakit/ariakit/issues/3768 + const onDropdownTriggerKeyDown = (0,external_wp_element_namespaceObject.useCallback)(event => { + if (event.key === 'ArrowDown') { + // Select the dropdown menu trigger item in the next row. + event.preventDefault(); + selectCompositeItem(activeItemIndex + 1, generateDropdownTriggerCompositeId); + } + if (event.key === 'ArrowUp') { + // Select the dropdown menu trigger item in the previous row. + event.preventDefault(); + selectCompositeItem(activeItemIndex - 1, generateDropdownTriggerCompositeId); + } + }, [selectCompositeItem, activeItemIndex]); + const hasData = data?.length; + if (!hasData) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx({ + 'dataviews-loading': isLoading, + 'dataviews-no-results': !hasData && !isLoading + }), + children: !hasData && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: isLoading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No results') + }) + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { + id: baseId, + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {}), + className: "dataviews-view-list", + role: "grid", + activeId: activeCompositeId, + setActiveId: setActiveCompositeId, + children: data.map(item => { + const id = generateCompositeItemIdPrefix(item); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListItem, { + view: view, + idPrefix: id, + actions: actions, + item: item, + isSelected: item === selectedItem, + onSelect: onSelect, + mediaField: mediaField, + titleField: titleField, + descriptionField: descriptionField, + otherFields: otherFields, + onDropdownTriggerKeyDown: onDropdownTriggerKeyDown + }, id); + }) + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +function DensityPicker() { + const context = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const view = context.view; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + __nextHasNoMarginBottom: true, + size: "__unstable-large", + label: (0,external_wp_i18n_namespaceObject.__)('Density'), + value: view.layout?.density || 'balanced', + onChange: value => { + context.onChangeView({ + ...view, + layout: { + ...view.layout, + density: value + } + }); + }, + isBlock: true, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "comfortable", + label: (0,external_wp_i18n_namespaceObject._x)('Comfortable', 'Density option for DataView layout') + }, "comfortable"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "balanced", + label: (0,external_wp_i18n_namespaceObject._x)('Balanced', 'Density option for DataView layout') + }, "balanced"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: "compact", + label: (0,external_wp_i18n_namespaceObject._x)('Compact', 'Density option for DataView layout') + }, "compact")] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +const VIEW_LAYOUTS = [{ + type: constants_LAYOUT_TABLE, + label: (0,external_wp_i18n_namespaceObject.__)('Table'), + component: table, + icon: block_table, + viewConfigOptions: DensityPicker +}, { + type: constants_LAYOUT_GRID, + label: (0,external_wp_i18n_namespaceObject.__)('Grid'), + component: ViewGrid, + icon: library_category, + viewConfigOptions: PreviewSizePicker +}, { + type: constants_LAYOUT_LIST, + label: (0,external_wp_i18n_namespaceObject.__)('List'), + component: ViewList, + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets +}]; + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function DataViewsLayout() { + const { + actions = [], + data, + fields, + getItemId, + getItemLevel, + isLoading, + view, + onChangeView, + selection, + onChangeSelection, + setOpenedFilter, + onClickItem, + isItemClickable + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const ViewComponent = VIEW_LAYOUTS.find(v => v.type === view.type)?.component; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewComponent, { + actions: actions, + data: data, + fields: fields, + getItemId: getItemId, + getItemLevel: getItemLevel, + isLoading: isLoading, + onChangeView: onChangeView, + onChangeSelection: onChangeSelection, + selection: selection, + setOpenedFilter: setOpenedFilter, + onClickItem: onClickItem, + isItemClickable: isItemClickable, + view: view + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +function DataViewsPagination() { + var _view$page; + const { + view, + onChangeView, + paginationInfo: { + totalItems = 0, + totalPages + } + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + if (!totalItems || !totalPages) { + return null; + } + const currentPage = (_view$page = view.page) !== null && _view$page !== void 0 ? _view$page : 1; + const pageSelectOptions = Array.from(Array(totalPages)).map((_, i) => { + const page = i + 1; + return { + value: page.toString(), + label: page.toString(), + 'aria-label': currentPage === page ? (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: Current page number in total number of pages + (0,external_wp_i18n_namespaceObject.__)('Page %1$s of %2$s'), currentPage, totalPages) : page.toString() + }; + }); + return !!totalItems && totalPages !== 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + className: "dataviews-pagination", + justify: "end", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "flex-start", + expanded: false, + spacing: 1, + className: "dataviews-pagination__page-select", + children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: Current page number, 2: Total number of pages. + (0,external_wp_i18n_namespaceObject._x)('
Page
%1$s
of %2$s
', 'paging'), '', totalPages), { + div: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + "aria-hidden": true + }), + CurrentPage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + "aria-label": (0,external_wp_i18n_namespaceObject.__)('Current page'), + value: currentPage.toString(), + options: pageSelectOptions, + onChange: newValue => { + onChangeView({ + ...view, + page: +newValue + }); + }, + size: "small", + __nextHasNoMarginBottom: true, + variant: "minimal" + }) + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + spacing: 1, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => onChangeView({ + ...view, + page: currentPage - 1 + }), + disabled: currentPage === 1, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Previous page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_next : library_previous, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + onClick: () => onChangeView({ + ...view, + page: currentPage + 1 + }), + disabled: currentPage >= totalPages, + accessibleWhenDisabled: true, + label: (0,external_wp_i18n_namespaceObject.__)('Next page'), + icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? library_previous : library_next, + showTooltip: true, + size: "compact", + tooltipPosition: "top" + })] + })] + }); +} +/* harmony default export */ const dataviews_pagination = ((0,external_wp_element_namespaceObject.memo)(DataViewsPagination)); + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +const dataviews_footer_EMPTY_ARRAY = []; +function DataViewsFooter() { + const { + view, + paginationInfo: { + totalItems = 0, + totalPages + }, + data, + actions = dataviews_footer_EMPTY_ARRAY + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data) && [constants_LAYOUT_TABLE, constants_LAYOUT_GRID].includes(view.type); + if (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions) { + return null; + } + return !!totalItems && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: false, + justify: "end", + className: "dataviews-footer", + children: [hasBulkActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkActionsFooter, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_pagination, {})] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const DataViewsSearch = (0,external_wp_element_namespaceObject.memo)(function Search({ + label +}) { + const { + view, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(view.search); (0,external_wp_element_namespaceObject.useEffect)(() => { var _view$search; @@ -32220,14 +36097,17 @@ viewRef.current = view; }, [onChangeView, view]); (0,external_wp_element_namespaceObject.useEffect)(() => { - onChangeViewRef.current({ - ...viewRef.current, - page: 1, - search: debouncedSearch - }); + if (debouncedSearch !== viewRef.current?.search) { + onChangeViewRef.current({ + ...viewRef.current, + page: 1, + search: debouncedSearch + }); + } }, [debouncedSearch]); const searchLabel = label || (0,external_wp_i18n_namespaceObject.__)('Search'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { + className: "dataviews-search", __nextHasNoMarginBottom: true, onChange: setSearch, value: search, @@ -32236,233 +36116,683 @@ size: "compact" }); }); -/* harmony default export */ const build_module_search = (Search); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/normalize-fields.js -/** - * Internal dependencies - */ - -/** - * Apply default values and normalize the fields config. - * - * @param fields Fields config. - * @return Normalized fields config. - */ -function normalizeFields(fields) { - return fields.map(field => { - const getValue = field.getValue || (({ - item - }) => item[field.id]); - return { - ...field, - header: field.header || field.id, - getValue, - render: field.render || getValue - }; - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/bulk-actions-toolbar.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -const SNACKBAR_VARIANTS = { - init: { - bottom: -48 - }, - open: { - bottom: 24, - transition: { - bottom: { - type: 'tween', - duration: 0.2, - ease: [0, 0, 0.2, 1] - } - } - }, - exit: { - opacity: 0, - bottom: 24, - transition: { - opacity: { - type: 'tween', - duration: 0.2, - ease: [0, 0, 0.2, 1] - } - } - } -}; -function ActionTrigger({ - action, - onClick, - isBusy, - items -}) { - const label = typeof action.label === 'string' ? action.label : action.label(items); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { - disabled: isBusy, - label: label, - icon: action.icon, - isDestructive: action.isDestructive, - size: "compact", - onClick: onClick, - isBusy: isBusy, - __experimentalIsFocusable: true, - tooltipPosition: "top" - }); -} -const bulk_actions_toolbar_EMPTY_ARRAY = []; -function ActionButton({ - action, - selectedItems, - actionInProgress, - setActionInProgress -}) { - const selectedEligibleItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return selectedItems.filter(item => { - return !action.isEligible || action.isEligible(item); - }); - }, [action, selectedItems]); - if ('RenderModal' in action) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, { - action: action, - items: selectedEligibleItems, - ActionTrigger: ActionTrigger - }, action.id); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, { - action: action, - onClick: () => { - setActionInProgress(action.id); - action.callback(selectedItems); - }, - items: selectedEligibleItems, - isBusy: actionInProgress === action.id - }, action.id); -} -function renderToolbarContent(selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onSelectionChange) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-bulk-actions__selection-count", - children: selection.length === 1 ? (0,external_wp_i18n_namespaceObject.__)('1 item selected') : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Total number of selected items. - (0,external_wp_i18n_namespaceObject._n)('%s item selected', '%s items selected', selection.length), selection.length) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { - children: actionsToShow.map(action => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionButton, { - action: action, - selectedItems: selectedItems, - actionInProgress: actionInProgress, - setActionInProgress: setActionInProgress - }, action.id); - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { - icon: close_small, - showTooltip: true, - tooltipPosition: "top", - label: (0,external_wp_i18n_namespaceObject.__)('Cancel'), - disabled: !!actionInProgress, - onClick: () => { - onSelectionChange(bulk_actions_toolbar_EMPTY_ARRAY); - } - }) - })] - }); -} -function ToolbarContent({ - selection, - actionsToShow, - selectedItems, - onSelectionChange -}) { - const [actionInProgress, setActionInProgress] = (0,external_wp_element_namespaceObject.useState)(null); - const buttons = (0,external_wp_element_namespaceObject.useRef)(null); - if (!actionInProgress) { - if (buttons.current) { - buttons.current = null; - } - return renderToolbarContent(selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onSelectionChange); - } else if (!buttons.current) { - buttons.current = renderToolbarContent(selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onSelectionChange); - } - return buttons.current; -} -function BulkActionsToolbar({ - data, - selection, - actions = bulk_actions_toolbar_EMPTY_ARRAY, - onSelectionChange, - getItemId -}) { - const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); - const selectedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.filter(item => selection.includes(getItemId(item))); - }, [selection, data, getItemId]); - const actionsToShow = (0,external_wp_element_namespaceObject.useMemo)(() => actions.filter(action => { - return action.supportsBulk && action.icon && selectedItems.some(item => !action.isEligible || action.isEligible(item)); - }), [actions, selectedItems]); - if (selection && selection.length === 0 || actionsToShow.length === 0) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { - layout: !isReducedMotion // See https://www.framer.com/docs/animation/#layout-animations - , - initial: "init", - animate: "open", - exit: "exit", - variants: isReducedMotion ? undefined : SNACKBAR_VARIANTS, - className: "dataviews-bulk-actions", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Toolbar, { - label: (0,external_wp_i18n_namespaceObject.__)('Bulk actions'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "dataviews-bulk-actions-toolbar-wrapper", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarContent, { - selection: selection, - actionsToShow: actionsToShow, - selectedItems: selectedItems, - onSelectionChange: onSelectionChange - }) - }) - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/dataviews.js +/* harmony default export */ const dataviews_search = (DataViewsSearch); + +;// ./node_modules/@wordpress/icons/build-module/library/lock.js +/** + * WordPress dependencies + */ + + +const lock_lock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" + }) +}); +/* harmony default export */ const library_lock = (lock_lock); + +;// ./node_modules/@wordpress/icons/build-module/library/cog.js +/** + * WordPress dependencies + */ + + +const cog = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z", + clipRule: "evenodd" + }) +}); +/* harmony default export */ const library_cog = (cog); + +;// external ["wp","warning"] +const external_wp_warning_namespaceObject = window["wp"]["warning"]; +var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js /** * External dependencies */ -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - + + +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + +const { + Menu: dataviews_view_config_Menu +} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +const DATAVIEWS_CONFIG_POPOVER_PROPS = { + className: 'dataviews-config__popover', + placement: 'bottom-end', + offset: 9 +}; +function ViewTypeMenu({ + defaultLayouts = { + list: {}, + grid: {}, + table: {} + } +}) { + const { + view, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const availableLayouts = Object.keys(defaultLayouts); + if (availableLayouts.length <= 1) { + return null; + } + const activeView = VIEW_LAYOUTS.find(v => view.type === v.type); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + icon: activeView?.icon, + label: (0,external_wp_i18n_namespaceObject.__)('Layout') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { + children: availableLayouts.map(layout => { + const config = VIEW_LAYOUTS.find(v => v.type === layout); + if (!config) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.RadioItem, { + value: layout, + name: "view-actions-available-view", + checked: layout === view.type, + hideOnClick: true, + onChange: e => { + switch (e.target.value) { + case 'list': + case 'grid': + case 'table': + const viewWithoutLayout = { + ...view + }; + if ('layout' in viewWithoutLayout) { + delete viewWithoutLayout.layout; + } + // @ts-expect-error + return onChangeView({ + ...viewWithoutLayout, + type: e.target.value, + ...defaultLayouts[e.target.value] + }); + } + true ? external_wp_warning_default()('Invalid dataview') : 0; + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { + children: config.label + }) + }, layout); + }) + })] + }); +} +function SortFieldControl() { + const { + view, + fields, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const orderOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { + const sortableFields = fields.filter(field => field.enableSorting !== false); + return sortableFields.map(field => { + return { + label: field.label, + value: field.id + }; + }); + }, [fields]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + label: (0,external_wp_i18n_namespaceObject.__)('Sort by'), + value: view.sort?.field, + options: orderOptions, + onChange: value => { + onChangeView({ + ...view, + sort: { + direction: view?.sort?.direction || 'desc', + field: value + }, + showLevels: false + }); + } + }); +} +function SortDirectionControl() { + const { + view, + fields, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const sortableFields = fields.filter(field => field.enableSorting !== false); + if (sortableFields.length === 0) { + return null; + } + let value = view.sort?.direction; + if (!value && view.sort?.field) { + value = 'desc'; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + className: "dataviews-view-config__sort-direction", + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + isBlock: true, + label: (0,external_wp_i18n_namespaceObject.__)('Order'), + value: value, + onChange: newDirection => { + if (newDirection === 'asc' || newDirection === 'desc') { + onChangeView({ + ...view, + sort: { + direction: newDirection, + field: view.sort?.field || + // If there is no field assigned as the sorting field assign the first sortable field. + fields.find(field => field.enableSorting !== false)?.id || '' + }, + showLevels: false + }); + return; + } + true ? external_wp_warning_default()('Invalid direction') : 0; + }, + children: SORTING_DIRECTIONS.map(direction => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { + value: direction, + icon: sortIcons[direction], + label: sortLabels[direction] + }, direction); + }) + }); +} +const PAGE_SIZE_VALUES = [10, 20, 50, 100]; +function ItemsPerPageControl() { + const { + view, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + isBlock: true, + label: (0,external_wp_i18n_namespaceObject.__)('Items per page'), + value: view.perPage || 10, + disabled: !view?.sort?.field, + onChange: newItemsPerPage => { + const newItemsPerPageNumber = typeof newItemsPerPage === 'number' || newItemsPerPage === undefined ? newItemsPerPage : parseInt(newItemsPerPage, 10); + onChangeView({ + ...view, + perPage: newItemsPerPageNumber, + page: 1 + }); + }, + children: PAGE_SIZE_VALUES.map(value => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { + value: value, + label: value.toString() + }, value); + }) + }); +} +function PreviewOptions({ + previewOptions, + onChangePreviewOption, + onMenuOpenChange, + activeOption +}) { + const focusPreviewOptionsField = id => { + // Focus the visibility button to avoid focus loss. + // Our code is safe against the component being unmounted, so we don't need to worry about cleaning the timeout. + // eslint-disable-next-line @wordpress/react-no-unsafe-timeout + setTimeout(() => { + const element = document.querySelector(`.dataviews-field-control__field-${id} .dataviews-field-control__field-preview-options-button`); + if (element instanceof HTMLElement) { + element.focus(); + } + }, 50); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(dataviews_view_config_Menu, { + onOpenChange: onMenuOpenChange, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.TriggerButton, { + render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataviews-field-control__field-preview-options-button", + size: "compact", + icon: more_vertical, + label: (0,external_wp_i18n_namespaceObject.__)('Preview') + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.Popover, { + children: previewOptions?.map(({ + id, + label + }) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.RadioItem, { + value: id, + checked: id === activeOption, + onChange: () => { + onChangePreviewOption?.(id); + focusPreviewOptionsField(id); + }, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config_Menu.ItemLabel, { + children: label + }) + }, id); + }) + })] + }); +} +function FieldItem({ + field, + label, + description, + isVisible, + isFirst, + isLast, + canMove = true, + onToggleVisibility, + onMoveUp, + onMoveDown, + previewOptions, + onChangePreviewOption +}) { + const [isChangingPreviewOption, setIsChangingPreviewOption] = (0,external_wp_element_namespaceObject.useState)(false); + const focusVisibilityField = () => { + // Focus the visibility button to avoid focus loss. + // Our code is safe against the component being unmounted, so we don't need to worry about cleaning the timeout. + // eslint-disable-next-line @wordpress/react-no-unsafe-timeout + setTimeout(() => { + const element = document.querySelector(`.dataviews-field-control__field-${field.id} .dataviews-field-control__field-visibility-button`); + if (element instanceof HTMLElement) { + element.focus(); + } + }, 50); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: true, + className: dist_clsx('dataviews-field-control__field', `dataviews-field-control__field-${field.id}`, + // The actions are hidden when the mouse is not hovering the item, or focus + // is outside the item. + // For actions that require a popover, a menu etc, that would mean that when the interactive element + // opens and the focus goes there the actions would be hidden. + // To avoid that we add a class to the item, that makes sure actions are visible while there is some + // interaction with the item. + { + 'is-interacting': isChangingPreviewOption + }), + justify: "flex-start", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-field-control__icon", + children: !canMove && !field.enableHiding && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: library_lock + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { + className: "dataviews-field-control__label-sub-label-container", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-field-control__label", + children: label || field.label + }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "dataviews-field-control__sub-label", + children: description + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "flex-end", + expanded: false, + className: "dataviews-field-control__actions", + children: [isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + disabled: isFirst || !canMove, + accessibleWhenDisabled: true, + size: "compact", + onClick: onMoveUp, + icon: chevron_up, + label: isFirst || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved up") : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject.__)('Move %s up'), field.label) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + disabled: isLast || !canMove, + accessibleWhenDisabled: true, + size: "compact", + onClick: onMoveDown, + icon: chevron_down, + label: isLast || !canMove ? (0,external_wp_i18n_namespaceObject.__)("This field can't be moved down") : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject.__)('Move %s down'), field.label) + })] + }), onToggleVisibility && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataviews-field-control__field-visibility-button", + disabled: !field.enableHiding, + accessibleWhenDisabled: true, + size: "compact", + onClick: () => { + onToggleVisibility(); + focusVisibilityField(); + }, + icon: isVisible ? library_unseen : library_seen, + label: isVisible ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject._x)('Hide %s', 'field'), field.label) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: field label */ + (0,external_wp_i18n_namespaceObject._x)('Show %s', 'field'), field.label) + }), previewOptions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewOptions, { + previewOptions: previewOptions, + onChangePreviewOption: onChangePreviewOption, + onMenuOpenChange: setIsChangingPreviewOption, + activeOption: field.id + })] + })] + }) + }); +} +function RegularFieldItem({ + index, + field, + view, + onChangeView +}) { + var _view$fields; + const visibleFieldIds = (_view$fields = view.fields) !== null && _view$fields !== void 0 ? _view$fields : []; + const isVisible = index !== undefined && visibleFieldIds.includes(field.id); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: isVisible, + isFirst: index !== undefined && index < 1, + isLast: index !== undefined && index === visibleFieldIds.length - 1, + onToggleVisibility: () => { + onChangeView({ + ...view, + fields: isVisible ? visibleFieldIds.filter(fieldId => fieldId !== field.id) : [...visibleFieldIds, field.id] + }); + }, + onMoveUp: index !== undefined ? () => { + var _visibleFieldIds$slic; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic = visibleFieldIds.slice(0, index - 1)) !== null && _visibleFieldIds$slic !== void 0 ? _visibleFieldIds$slic : []), field.id, visibleFieldIds[index - 1], ...visibleFieldIds.slice(index + 1)] + }); + } : undefined, + onMoveDown: index !== undefined ? () => { + var _visibleFieldIds$slic2; + onChangeView({ + ...view, + fields: [...((_visibleFieldIds$slic2 = visibleFieldIds.slice(0, index)) !== null && _visibleFieldIds$slic2 !== void 0 ? _visibleFieldIds$slic2 : []), visibleFieldIds[index + 1], field.id, ...visibleFieldIds.slice(index + 2)] + }); + } : undefined + }); +} +function dataviews_view_config_isDefined(item) { + return !!item; +} +function FieldControl() { + var _view$fields2; + const { + view, + fields, + onChangeView + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const togglableFields = [view?.titleField, view?.mediaField, view?.descriptionField].filter(Boolean); + const visibleFieldIds = (_view$fields2 = view.fields) !== null && _view$fields2 !== void 0 ? _view$fields2 : []; + const hiddenFields = fields.filter(f => !visibleFieldIds.includes(f.id) && !togglableFields.includes(f.id) && f.type !== 'media'); + const visibleFields = visibleFieldIds.map(fieldId => fields.find(f => f.id === fieldId)).filter(dataviews_view_config_isDefined); + if (!visibleFields?.length && !hiddenFields?.length) { + return null; + } + const titleField = fields.find(f => f.id === view.titleField); + const previewField = fields.find(f => f.id === view.mediaField); + const descriptionField = fields.find(f => f.id === view.descriptionField); + const previewFields = fields.filter(f => f.type === 'media'); + let previewFieldUI; + if (previewFields.length > 1) { + var _view$showMedia; + const isPreviewFieldVisible = dataviews_view_config_isDefined(previewField) && ((_view$showMedia = view.showMedia) !== null && _view$showMedia !== void 0 ? _view$showMedia : true); + previewFieldUI = dataviews_view_config_isDefined(previewField) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: previewField, + label: (0,external_wp_i18n_namespaceObject.__)('Preview'), + description: previewField.label, + isVisible: isPreviewFieldVisible, + onToggleVisibility: () => { + onChangeView({ + ...view, + showMedia: !isPreviewFieldVisible + }); + }, + canMove: false, + previewOptions: previewFields.map(field => ({ + label: field.label, + id: field.id + })), + onChangePreviewOption: newPreviewId => onChangeView({ + ...view, + mediaField: newPreviewId + }) + }, previewField.id); + } + const lockedFields = [{ + field: titleField, + isVisibleFlag: 'showTitle' + }, { + field: previewField, + isVisibleFlag: 'showMedia', + ui: previewFieldUI + }, { + field: descriptionField, + isVisibleFlag: 'showDescription' + }].filter(({ + field + }) => dataviews_view_config_isDefined(field)); + const visibleLockedFields = lockedFields.filter(({ + field, + isVisibleFlag + }) => { + var _view$isVisibleFlag; + return ( + // @ts-expect-error + dataviews_view_config_isDefined(field) && ((_view$isVisibleFlag = view[isVisibleFlag]) !== null && _view$isVisibleFlag !== void 0 ? _view$isVisibleFlag : true) + ); + }); + const hiddenLockedFields = lockedFields.filter(({ + field, + isVisibleFlag + }) => { + var _view$isVisibleFlag2; + return ( + // @ts-expect-error + dataviews_view_config_isDefined(field) && !((_view$isVisibleFlag2 = view[isVisibleFlag]) !== null && _view$isVisibleFlag2 !== void 0 ? _view$isVisibleFlag2 : true) + ); + }); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-field-control", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config__properties", + spacing: 0, + children: (visibleLockedFields.length > 0 || !!visibleFields?.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + children: [visibleLockedFields.map(({ + field, + isVisibleFlag, + ui + }) => { + return ui !== null && ui !== void 0 ? ui : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: true, + onToggleVisibility: () => { + onChangeView({ + ...view, + [isVisibleFlag]: false + }); + }, + canMove: false + }, field.id); + }), visibleFields.map((field, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegularFieldItem, { + field: field, + view: view, + onChangeView: onChangeView, + index: index + }, field.id))] + }) + }), (!!hiddenFields?.length || !!hiddenLockedFields.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { + style: { + margin: 0 + }, + children: (0,external_wp_i18n_namespaceObject.__)('Hidden') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config__properties", + spacing: 0, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + isBordered: true, + isSeparated: true, + children: [hiddenLockedFields.length > 0 && hiddenLockedFields.map(({ + field, + isVisibleFlag, + ui + }) => { + return ui !== null && ui !== void 0 ? ui : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldItem, { + field: field, + isVisible: false, + onToggleVisibility: () => { + onChangeView({ + ...view, + [isVisibleFlag]: true + }); + }, + canMove: false + }, field.id); + }), hiddenFields.map(field => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegularFieldItem, { + field: field, + view: view, + onChangeView: onChangeView + }, field.id))] + }) + })] + })] + }); +} +function SettingsSection({ + title, + description, + children +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { + columns: 12, + className: "dataviews-settings-section", + gap: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "dataviews-settings-section__sidebar", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + className: "dataviews-settings-section__title", + children: title + }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { + variant: "muted", + className: "dataviews-settings-section__description", + children: description + })] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalGrid, { + columns: 8, + gap: 4, + className: "dataviews-settings-section__content", + children: children + })] + }); +} +function DataviewsViewConfigDropdown() { + const { + view + } = (0,external_wp_element_namespaceObject.useContext)(dataviews_context); + const popoverId = (0,external_wp_compose_namespaceObject.useInstanceId)(_DataViewsViewConfig, 'dataviews-view-config-dropdown'); + const activeLayout = VIEW_LAYOUTS.find(layout => layout.type === view.type); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + expandOnMobile: true, + popoverProps: { + ...DATAVIEWS_CONFIG_POPOVER_PROPS, + id: popoverId + }, + renderToggle: ({ + onToggle, + isOpen + }) => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + icon: library_cog, + label: (0,external_wp_i18n_namespaceObject._x)('View options', 'View is used as a noun'), + onClick: onToggle, + "aria-expanded": isOpen ? 'true' : 'false', + "aria-controls": popoverId + }); + }, + renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { + paddingSize: "medium", + className: "dataviews-config__popover-content-wrapper", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataviews-view-config", + spacing: 6, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SettingsSection, { + title: (0,external_wp_i18n_namespaceObject.__)('Appearance'), + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + expanded: true, + className: "is-divided-in-two", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortFieldControl, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SortDirectionControl, {})] + }), !!activeLayout?.viewConfigOptions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(activeLayout.viewConfigOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemsPerPageControl, {})] + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SettingsSection, { + title: (0,external_wp_i18n_namespaceObject.__)('Properties'), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldControl, {}) + })] + }) + }) + }); +} +function _DataViewsViewConfig({ + defaultLayouts = { + list: {}, + grid: {}, + table: {} + } +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewTypeMenu, { + defaultLayouts: defaultLayouts + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsViewConfigDropdown, {})] + }); +} +const DataViewsViewConfig = (0,external_wp_element_namespaceObject.memo)(_DataViewsViewConfig); +/* harmony default export */ const dataviews_view_config = (DataViewsViewConfig); + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ @@ -32472,1291 +36802,109 @@ const defaultGetItemId = item => item.id; -const defaultOnSelectionChange = () => {}; -function dataviews_useSomeItemHasAPossibleBulkAction(actions, data) { - return (0,external_wp_element_namespaceObject.useMemo)(() => { - return data.some(item => { - return actions.some(action => { - return action.supportsBulk && (!action.isEligible || action.isEligible(item)); - }); - }); - }, [actions, data]); -} +const defaultIsItemClickable = () => true; +const dataviews_EMPTY_ARRAY = []; function DataViews({ view, onChangeView, fields, search = true, searchLabel = undefined, - actions = [], + actions = dataviews_EMPTY_ARRAY, data, getItemId = defaultGetItemId, + getItemLevel, isLoading = false, paginationInfo, - supportedLayouts, + defaultLayouts, selection: selectionProperty, - setSelection: setSelectionProperty, - onSelectionChange = defaultOnSelectionChange -}) { + onChangeSelection, + onClickItem, + isItemClickable = defaultIsItemClickable, + header +}) { + const [containerWidth, setContainerWidth] = (0,external_wp_element_namespaceObject.useState)(0); + const containerRef = (0,external_wp_compose_namespaceObject.useResizeObserver)(resizeObserverEntries => { + setContainerWidth(resizeObserverEntries[0].borderBoxSize[0].inlineSize); + }, { + box: 'border-box' + }); const [selectionState, setSelectionState] = (0,external_wp_element_namespaceObject.useState)([]); - let selection, setSelection; - if (selectionProperty !== undefined && setSelectionProperty !== undefined) { - selection = selectionProperty; - setSelection = setSelectionProperty; - } else { - selection = selectionState; - setSelection = setSelectionState; - } + const isUncontrolled = selectionProperty === undefined || onChangeSelection === undefined; + const selection = isUncontrolled ? selectionState : selectionProperty; const [openedFilter, setOpenedFilter] = (0,external_wp_element_namespaceObject.useState)(null); - const onSetSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { - setSelection(items.map(item => getItemId(item))); - onSelectionChange(items); - }, [setSelection, getItemId, onSelectionChange]); - const ViewComponent = VIEW_LAYOUTS.find(v => v.type === view.type)?.component; + function setSelectionWithChange(value) { + const newValue = typeof value === 'function' ? value(selection) : value; + if (isUncontrolled) { + setSelectionState(newValue); + } + if (onChangeSelection) { + onChangeSelection(newValue); + } + } const _fields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFields(fields), [fields]); - const hasPossibleBulkAction = dataviews_useSomeItemHasAPossibleBulkAction(actions, data); const _selection = (0,external_wp_element_namespaceObject.useMemo)(() => { return selection.filter(id => data.some(item => getItemId(item) === id)); }, [selection, data, getItemId]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "dataviews-wrapper", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "top", - justify: "start", - className: "dataviews-filters__view-actions", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "start", - className: "dataviews-filters__container", - wrap: true, - children: [search && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_search, { - label: searchLabel, - view: view, - onChangeView: onChangeView - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(filters, { - fields: _fields, - view: view, - onChangeView: onChangeView, - openedFilter: openedFilter, - setOpenedFilter: setOpenedFilter - })] - }), [constants_LAYOUT_TABLE, constants_LAYOUT_GRID].includes(view.type) && hasPossibleBulkAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkActions, { - actions: actions, - data: data, - onSelectionChange: onSetSelection, - selection: _selection, - getItemId: getItemId - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(view_actions, { - fields: _fields, - view: view, - onChangeView: onChangeView, - supportedLayouts: supportedLayouts - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewComponent, { - actions: actions, - data: data, + const filters = useFilters(_fields, view); + const [isShowingFilter, setIsShowingFilter] = (0,external_wp_element_namespaceObject.useState)(() => (filters || []).some(filter => filter.isPrimary)); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_context.Provider, { + value: { + view, + onChangeView, fields: _fields, - getItemId: getItemId, - isLoading: isLoading, - onChangeView: onChangeView, - onSelectionChange: onSetSelection, - selection: _selection, - setOpenedFilter: setOpenedFilter, - view: view - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pagination, { - view: view, - onChangeView: onChangeView, - paginationInfo: paginationInfo - }), [constants_LAYOUT_TABLE, constants_LAYOUT_GRID].includes(view.type) && hasPossibleBulkAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BulkActionsToolbar, { - data: data, - actions: actions, + actions, + data, + isLoading, + paginationInfo, selection: _selection, - onSelectionChange: onSetSelection, - getItemId: getItemId - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page/header.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - -function Header({ - title, - subTitle, - actions -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - className: "edit-site-page-header", - as: "header", - spacing: 0, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "edit-site-page-header__page-title", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - as: "h2", - level: 3, - weight: 500, - className: "edit-site-page-header__title", - children: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { - className: "edit-site-page-header__actions", - children: actions - })] - }), subTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - variant: "muted", - as: "p", - className: "edit-site-page-header__sub-title", - children: subTitle - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - -const { - NavigableRegion: page_NavigableRegion -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -function Page({ - title, - subTitle, - actions, - children, - className, - hideTitleFromUI = false -}) { - const classes = dist_clsx('edit-site-page', className); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_NavigableRegion, { - className: classes, - ariaLabel: title, + onChangeSelection: setSelectionWithChange, + openedFilter, + setOpenedFilter, + getItemId, + getItemLevel, + isItemClickable, + onClickItem, + containerWidth + }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-page-content", - children: [!hideTitleFromUI && title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Header, { - title: title, - subTitle: subTitle, - actions: actions - }), children] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js -/** - * WordPress dependencies - */ - - - -const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" - })] -}); -/* harmony default export */ const library_pages = (pages); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/published.js -/** - * WordPress dependencies - */ - - -const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" - }) -}); -/* harmony default export */ const library_published = (published); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/scheduled.js -/** - * WordPress dependencies - */ - - -const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" - }) -}); -/* harmony default export */ const library_scheduled = (scheduled); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drafts.js -/** - * WordPress dependencies - */ - - -const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" - }) -}); -/* harmony default export */ const library_drafts = (drafts); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pending.js -/** - * WordPress dependencies - */ - - -const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" - }) -}); -/* harmony default export */ const library_pending = (pending); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/not-allowed.js -/** - * WordPress dependencies - */ - - -const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" - }) -}); -/* harmony default export */ const not_allowed = (notAllowed); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/default-views.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -const DEFAULT_CONFIG_PER_VIEW_TYPE = { - [LAYOUT_TABLE]: { - primaryField: 'title' - }, - [LAYOUT_GRID]: { - mediaField: 'featured-image', - primaryField: 'title' - }, - [LAYOUT_LIST]: { - primaryField: 'title', - mediaField: 'featured-image' - } -}; -const DEFAULT_PAGE_BASE = { - type: LAYOUT_LIST, - search: '', - filters: [], - page: 1, - perPage: 20, - sort: { - field: 'date', - direction: 'desc' - }, - // All fields are visible by default, so it's - // better to keep track of the hidden ones. - hiddenFields: ['date', 'featured-image'], - layout: { - ...DEFAULT_CONFIG_PER_VIEW_TYPE[LAYOUT_LIST] - } -}; -const DEFAULT_VIEWS = { - page: [{ - title: (0,external_wp_i18n_namespaceObject.__)('All pages'), - slug: 'all', - icon: library_pages, - view: DEFAULT_PAGE_BASE - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Published'), - slug: 'published', - icon: library_published, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'publish' - }] - } - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), - slug: 'future', - icon: library_scheduled, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'future' - }] - } - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Drafts'), - slug: 'drafts', - icon: library_drafts, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'draft' - }] - } - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Pending'), - slug: 'pending', - icon: library_pending, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'pending' - }] - } - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Private'), - slug: 'private', - icon: not_allowed, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'private' - }] - } - }, { - title: (0,external_wp_i18n_namespaceObject.__)('Trash'), - slug: 'trash', - icon: library_trash, - view: { - ...DEFAULT_PAGE_BASE, - filters: [{ - field: 'status', - operator: OPERATOR_IS_ANY, - value: 'trash' - }] - } - }] -}; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-page/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - -function AddNewPageModal({ - onSave, - onClose -}) { - const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false); - const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createErrorNotice, - createSuccessNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - resolveSelect - } = (0,external_wp_data_namespaceObject.useRegistry)(); - async function createPage(event) { - event.preventDefault(); - if (isCreatingPage) { - return; - } - setIsCreatingPage(true); - try { - const pagePostType = await resolveSelect(external_wp_coreData_namespaceObject.store).getPostType('page'); - const newPage = await saveEntityRecord('postType', 'page', { - status: 'draft', - title, - slug: title || (0,external_wp_i18n_namespaceObject.__)('No title'), - content: !!pagePostType.template && pagePostType.template.length ? (0,external_wp_blocks_namespaceObject.serialize)((0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)([], pagePostType.template)) : undefined - }, { - throwOnError: true - }); - onSave(newPage); - createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Title of the created template e.g: "Category". - (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newPage.title?.rendered || title)), { - type: 'snackbar' - }); - } catch (error) { - const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the page.'); - createErrorNotice(errorMessage, { - type: 'snackbar' - }); - } finally { - setIsCreatingPage(false); - } - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: (0,external_wp_i18n_namespaceObject.__)('Draft a new page'), - onRequestClose: onClose, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - onSubmit: createPage, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 3, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __next40pxDefaultSize: true, - label: (0,external_wp_i18n_namespaceObject.__)('Page title'), - onChange: setTitle, - placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), - value: title - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 2, - justify: "end", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: onClose, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "primary", - type: "submit", - isBusy: isCreatingPage, - "aria-disabled": isCreatingPage, - children: (0,external_wp_i18n_namespaceObject.__)('Create draft') + className: "dataviews-wrapper", + ref: containerRef, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "top", + justify: "space-between", + className: "dataviews__view-actions", + spacing: 1, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + justify: "start", + expanded: false, + className: "dataviews__search", + children: [search && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_search, { + label: searchLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FiltersToggle, { + filters: filters, + view: view, + onChangeView: onChangeView, + setOpenedFilter: setOpenedFilter, + setIsShowingFilter: setIsShowingFilter, + isShowingFilter: isShowingFilter })] - })] - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/media/index.js -/** - * WordPress dependencies - */ - - -function Media({ - id, - size = ['large', 'medium', 'thumbnail'], - ...props -}) { - const { - record: media - } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('root', 'media', id); - const currentSize = size.find(s => !!media?.media_details?.sizes[s]); - const mediaUrl = media?.media_details?.sizes[currentSize]?.source_url || media?.source_url; - if (!mediaUrl) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { - ...props, - src: mediaUrl, - alt: media.alt_text - }); -} -/* harmony default export */ const components_media = (Media); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js -/** - * WordPress dependencies - */ - - -const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" - }) -}); -/* harmony default export */ const library_pencil = (pencil); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js -/** - * Internal dependencies - */ - - -/* harmony default export */ const edit = (library_pencil); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/dataviews-actions/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -const { - useHistory: dataviews_actions_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const useEditPostAction = () => { - const history = dataviews_actions_useHistory(); - return (0,external_wp_element_namespaceObject.useMemo)(() => ({ - id: 'edit-post', - label: (0,external_wp_i18n_namespaceObject.__)('Edit'), - isPrimary: true, - icon: edit, - isEligible(post) { - if (post.status === 'trash') { - return false; - } - // It's eligible for all post types except theme patterns. - return post.type !== PATTERN_TYPES.theme; - }, - callback(items) { - const post = items[0]; - history.push({ - postId: post.id, - postType: post.type, - canvas: 'edit' - }); - } - }), [history]); -}; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-pages/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - -const { - usePostActions -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const { - useLocation: page_pages_useLocation, - useHistory: page_pages_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const page_pages_EMPTY_ARRAY = []; -const getFormattedDate = dateToDisplay => (0,external_wp_date_namespaceObject.dateI18n)((0,external_wp_date_namespaceObject.getSettings)().formats.datetimeAbbreviated, (0,external_wp_date_namespaceObject.getDate)(dateToDisplay)); -function useView(postType) { - const { - params: { - activeView = 'all', - isCustom = 'false', - layout - } - } = page_pages_useLocation(); - const history = page_pages_useHistory(); - const selectedDefaultView = (0,external_wp_element_namespaceObject.useMemo)(() => { - const defaultView = isCustom === 'false' && DEFAULT_VIEWS[postType].find(({ - slug - }) => slug === activeView)?.view; - if (isCustom === 'false' && layout) { - return { - ...defaultView, - type: layout, - layout: { - ...(DEFAULT_CONFIG_PER_VIEW_TYPE[layout] || {}) - } - }; - } - return defaultView; - }, [isCustom, activeView, layout, postType]); - const [view, setView] = (0,external_wp_element_namespaceObject.useState)(selectedDefaultView); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (selectedDefaultView) { - setView(selectedDefaultView); - } - }, [selectedDefaultView]); - const editedViewRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { - if (isCustom !== 'true') { - return; - } - const { - getEditedEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - const dataviewRecord = getEditedEntityRecord('postType', 'wp_dataviews', Number(activeView)); - return dataviewRecord; - }, [activeView, isCustom]); - const { - editEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const customView = (0,external_wp_element_namespaceObject.useMemo)(() => { - const storedView = editedViewRecord?.content && JSON.parse(editedViewRecord?.content); - if (!storedView) { - return storedView; - } - return { - ...storedView, - layout: { - ...(DEFAULT_CONFIG_PER_VIEW_TYPE[storedView?.type] || {}) - } - }; - }, [editedViewRecord?.content]); - const setCustomView = (0,external_wp_element_namespaceObject.useCallback)(viewToSet => { - editEntityRecord('postType', 'wp_dataviews', editedViewRecord?.id, { - content: JSON.stringify(viewToSet) - }); - }, [editEntityRecord, editedViewRecord?.id]); - const setDefaultViewAndUpdateUrl = (0,external_wp_element_namespaceObject.useCallback)(viewToSet => { - if (viewToSet.type !== view?.type) { - const { - params - } = history.getLocationWithParams(); - history.push({ - ...params, - layout: viewToSet.type - }); - } - setView(viewToSet); - }, [history, view?.type]); - if (isCustom === 'false') { - return [view, setDefaultViewAndUpdateUrl]; - } else if (isCustom === 'true' && customView) { - return [customView, setCustomView]; - } - // Loading state where no the view was not found on custom views or default views. - return [DEFAULT_VIEWS[postType][0].view, setDefaultViewAndUpdateUrl]; -} - -// See https://github.com/WordPress/gutenberg/issues/55886 -// We do not support custom statutes at the moment. -const STATUSES = [{ - value: 'draft', - label: (0,external_wp_i18n_namespaceObject.__)('Draft') -}, { - value: 'future', - label: (0,external_wp_i18n_namespaceObject.__)('Scheduled') -}, { - value: 'pending', - label: (0,external_wp_i18n_namespaceObject.__)('Pending Review') -}, { - value: 'private', - label: (0,external_wp_i18n_namespaceObject.__)('Private') -}, { - value: 'publish', - label: (0,external_wp_i18n_namespaceObject.__)('Published') -}, { - value: 'trash', - label: (0,external_wp_i18n_namespaceObject.__)('Trash') -}]; -const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'. - -function FeaturedImage({ - item, - viewType -}) { - const isDisabled = item.status === 'trash'; - const { - onClick - } = useLink({ - postId: item.id, - postType: item.type, - canvas: 'edit' - }); - const hasMedia = !!item.featured_media; - const size = viewType === LAYOUT_GRID ? ['large', 'full', 'medium', 'thumbnail'] : ['thumbnail', 'medium', 'large', 'full']; - const media = hasMedia ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_media, { - className: "edit-site-page-pages__featured-image", - id: item.featured_media, - size: size - }) : null; - const renderButton = viewType !== LAYOUT_LIST && !isDisabled; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: `edit-site-page-pages__featured-image-wrapper is-layout-${viewType}`, - children: renderButton ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { - className: "page-pages-preview-field__button", - type: "button", - onClick: onClick, - "aria-label": item.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)'), - children: media - }) : media - }); -} -function getItemId(item) { - return item.id.toString(); -} -function PagePages() { - var _pages$map, _usePrevious; - const postType = 'page'; - const [view, setView] = useView(postType); - const history = page_pages_useHistory(); - const { - params: { - postId - } - } = page_pages_useLocation(); - const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)([postId]); - const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)(items => { - var _params$isCustom; - const { - params - } = history.getLocationWithParams(); - if (((_params$isCustom = params.isCustom) !== null && _params$isCustom !== void 0 ? _params$isCustom : 'false') === 'false' && view?.type === LAYOUT_LIST) { - history.push({ - ...params, - postId: items.length === 1 ? items[0].id : undefined - }); - } - }, [history, view?.type]); - const queryArgs = (0,external_wp_element_namespaceObject.useMemo)(() => { - const filters = {}; - view.filters.forEach(filter => { - if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { - filters.status = filter.value; - } - if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { - filters.author = filter.value; - } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { - filters.author_exclude = filter.value; - } - }); - // We want to provide a different default item for the status filter - // than the REST API provides. - if (!filters.status || filters.status === '') { - filters.status = DEFAULT_STATUSES; - } - return { - per_page: view.perPage, - page: view.page, - _embed: 'author', - order: view.sort?.direction, - orderby: view.sort?.field, - search: view.search, - ...filters - }; - }, [view]); - const { - records: pages, - isResolving: isLoadingPages, - totalItems, - totalPages - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', postType, queryArgs); - const ids = (_pages$map = pages?.map(page => getItemId(page))) !== null && _pages$map !== void 0 ? _pages$map : []; - const prevIds = (_usePrevious = (0,external_wp_compose_namespaceObject.usePrevious)(ids)) !== null && _usePrevious !== void 0 ? _usePrevious : []; - const deletedIds = prevIds.filter(id => !ids.includes(id)); - const postIdWasDeleted = deletedIds.includes(postId); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (postIdWasDeleted) { - history.push({ - ...history.getLocationWithParams().params, - postId: undefined - }); - } - }, [postIdWasDeleted, history]); - const { - records: authors, - isResolving: isLoadingAuthors - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'user', { - per_page: -1 - }); - const paginationInfo = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - totalItems, - totalPages - }), [totalItems, totalPages]); - const { - frontPageId, - postsPageId, - addNewLabel, - canCreatePage - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEntityRecord, - getPostType, - canUser - } = select(external_wp_coreData_namespaceObject.store); - const siteSettings = getEntityRecord('root', 'site'); - return { - frontPageId: siteSettings?.page_on_front, - postsPageId: siteSettings?.page_for_posts, - addNewLabel: getPostType('page')?.labels?.add_new_item, - canCreatePage: canUser('create', 'pages') - }; - }); - const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [{ - id: 'featured-image', - header: (0,external_wp_i18n_namespaceObject.__)('Featured Image'), - getValue: ({ - item - }) => item.featured_media, - render: ({ - item - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FeaturedImage, { - item: item, - viewType: view.type - }), - enableSorting: false, - width: '1%' - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Title'), - id: 'title', - getValue: ({ - item - }) => item.title?.rendered, - render: ({ - item - }) => { - const addLink = [LAYOUT_TABLE, LAYOUT_GRID].includes(view.type) && item.status !== 'trash'; - const title = addLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Link, { - params: { - postId: item.id, - postType: item.type, - canvas: 'edit' - }, - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }); - let suffix = ''; - if (item.id === frontPageId) { - suffix = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "edit-site-page-pages__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Front Page') - }); - } else if (item.id === postsPageId) { - suffix = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "edit-site-page-pages__title-badge", - children: (0,external_wp_i18n_namespaceObject.__)('Posts Page') - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "edit-site-page-pages-title", - alignment: "center", - justify: "flex-start", - children: [title, suffix] - }); - }, - maxWidth: 300, - enableHiding: false - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Author'), - id: 'author', - getValue: ({ - item - }) => item._embedded?.author[0]?.name, - elements: authors?.map(({ - id, - name - }) => ({ - value: id, - label: name - })) || [] - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Status'), - id: 'status', - getValue: ({ - item - }) => { - var _STATUSES$find$label; - return (_STATUSES$find$label = STATUSES.find(({ - value - }) => value === item.status)?.label) !== null && _STATUSES$find$label !== void 0 ? _STATUSES$find$label : item.status; - }, - elements: STATUSES, - enableSorting: false, - filterBy: { - operators: [OPERATOR_IS_ANY] - } - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Date'), - id: 'date', - render: ({ - item - }) => { - const isDraftOrPrivate = ['draft', 'private'].includes(item.status); - if (isDraftOrPrivate) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation date */ - (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate(item.date)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - const isScheduled = item.status === 'future'; - if (isScheduled) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: page creation date */ - (0,external_wp_i18n_namespaceObject.__)('Scheduled: '), getFormattedDate(item.date)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - - // Pending & Published posts show the modified date if it's newer. - const dateToDisplay = (0,external_wp_date_namespaceObject.getDate)(item.modified) > (0,external_wp_date_namespaceObject.getDate)(item.date) ? item.modified : item.date; - const isPending = item.status === 'pending'; - if (isPending) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the newest of created or modified date for the page */ - (0,external_wp_i18n_namespaceObject.__)('Modified: '), getFormattedDate(dateToDisplay)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - const isPublished = item.status === 'publish'; - if (isPublished) { - return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: the newest of created or modified date for the page */ - (0,external_wp_i18n_namespaceObject.__)('Published: '), getFormattedDate(dateToDisplay)), { - span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {}), - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", {}) - }); - } - - // Unknow status. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { - children: getFormattedDate(item.date) - }); - } - }], [authors, view.type, frontPageId, postsPageId]); - const postTypeActions = usePostActions({ - postType: 'page', - context: 'list' - }); - const editAction = useEditPostAction(); - const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); - const onChangeView = (0,external_wp_element_namespaceObject.useCallback)(newView => { - if (newView.type !== view.type) { - newView = { - ...newView, - layout: { - ...DEFAULT_CONFIG_PER_VIEW_TYPE[newView.type] - } - }; - } - setView(newView); - }, [view.type, setView]); - const [showAddPageModal, setShowAddPageModal] = (0,external_wp_element_namespaceObject.useState)(false); - const openModal = () => setShowAddPageModal(true); - const closeModal = () => setShowAddPageModal(false); - const handleNewPage = ({ - type, - id - }) => { - history.push({ - postId: id, - postType: type, - canvas: 'edit' - }); - closeModal(); - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { - title: (0,external_wp_i18n_namespaceObject.__)('Pages'), - actions: addNewLabel && canCreatePage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "primary", - onClick: openModal, - __next40pxDefaultSize: true, - children: addNewLabel - }), showAddPageModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddNewPageModal, { - onSave: handleNewPage, - onClose: closeModal - })] - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { - paginationInfo: paginationInfo, - fields: fields, - actions: actions, - data: pages || page_pages_EMPTY_ARRAY, - isLoading: isLoadingPages || isLoadingAuthors, - view: view, - onChangeView: onChangeView, - selection: selection, - setSelection: setSelection, - onSelectionChange: onSelectionChange, - getItemId: getItemId - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/filter-and-sort-data-view.js -/** - * External dependencies - */ - - -/** - * Internal dependencies - */ - - -function filter_and_sort_data_view_normalizeSearchInput(input = '') { - return remove_accents_default()(input.trim().toLowerCase()); -} -const filter_and_sort_data_view_EMPTY_ARRAY = []; - -/** - * Applies the filtering, sorting and pagination to the raw data based on the view configuration. - * - * @param data Raw data. - * @param view View config. - * @param fields Fields config. - * - * @return Filtered, sorted and paginated data. - */ -function filterSortAndPaginate(data, view, fields) { - if (!data) { - return { - data: filter_and_sort_data_view_EMPTY_ARRAY, - paginationInfo: { - totalItems: 0, - totalPages: 0 - } - }; - } - const _fields = normalizeFields(fields); - let filteredData = [...data]; - // Handle global search. - if (view.search) { - const normalizedSearch = filter_and_sort_data_view_normalizeSearchInput(view.search); - filteredData = filteredData.filter(item => { - return _fields.filter(field => field.enableGlobalSearch).map(field => { - return filter_and_sort_data_view_normalizeSearchInput(field.getValue({ - item - })); - }).some(field => field.includes(normalizedSearch)); - }); - } - if (view.filters.length > 0) { - view.filters.forEach(filter => { - const field = _fields.find(_field => _field.id === filter.field); - if (field) { - if (filter.operator === constants_OPERATOR_IS_ANY && filter?.value?.length > 0) { - filteredData = filteredData.filter(item => { - const fieldValue = field.getValue({ - item - }); - if (Array.isArray(fieldValue)) { - return filter.value.some(filterValue => fieldValue.includes(filterValue)); - } else if (typeof fieldValue === 'string') { - return filter.value.includes(fieldValue); - } - return false; - }); - } else if (filter.operator === constants_OPERATOR_IS_NONE && filter?.value?.length > 0) { - filteredData = filteredData.filter(item => { - const fieldValue = field.getValue({ - item - }); - if (Array.isArray(fieldValue)) { - return !filter.value.some(filterValue => fieldValue.includes(filterValue)); - } else if (typeof fieldValue === 'string') { - return !filter.value.includes(fieldValue); - } - return false; - }); - } else if (filter.operator === OPERATOR_IS_ALL && filter?.value?.length > 0) { - filteredData = filteredData.filter(item => { - return filter.value.every(value => { - return field.getValue({ - item - })?.includes(value); - }); - }); - } else if (filter.operator === OPERATOR_IS_NOT_ALL && filter?.value?.length > 0) { - filteredData = filteredData.filter(item => { - return filter.value.every(value => { - return !field.getValue({ - item - })?.includes(value); - }); - }); - } else if (filter.operator === constants_OPERATOR_IS) { - filteredData = filteredData.filter(item => { - return filter.value === field.getValue({ - item - }); - }); - } else if (filter.operator === constants_OPERATOR_IS_NOT) { - filteredData = filteredData.filter(item => { - return filter.value !== field.getValue({ - item - }); - }); - } - } - }); - } - - // Handle sorting. - if (view.sort) { - const fieldId = view.sort.field; - const fieldToSort = _fields.find(field => { - return field.id === fieldId; - }); - if (fieldToSort) { - filteredData.sort((a, b) => { - var _fieldToSort$getValue, _fieldToSort$getValue2; - const valueA = (_fieldToSort$getValue = fieldToSort.getValue({ - item: a - })) !== null && _fieldToSort$getValue !== void 0 ? _fieldToSort$getValue : ''; - const valueB = (_fieldToSort$getValue2 = fieldToSort.getValue({ - item: b - })) !== null && _fieldToSort$getValue2 !== void 0 ? _fieldToSort$getValue2 : ''; - return view.sort?.direction === 'asc' ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA); - }); - } - } - - // Handle pagination. - let totalItems = filteredData.length; - let totalPages = 1; - if (view.page !== undefined && view.perPage !== undefined) { - const start = (view.page - 1) * view.perPage; - totalItems = filteredData?.length || 0; - totalPages = Math.ceil(totalItems / view.perPage); - filteredData = filteredData?.slice(start, start + view.perPage); - } - return { - data: filteredData, - paginationInfo: { - totalItems, - totalPages - } - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lock-small.js -/** - * WordPress dependencies - */ - - -const lockSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" - }) -}); -/* harmony default export */ const lock_small = (lockSmall); - -;// CONCATENATED MODULE: external ["wp","priorityQueue"] -const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/async/index.js -/** - * WordPress dependencies - */ - - -const blockPreviewQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); - -/** - * Renders a component at the next idle time. - * @param {*} props - */ -function Async({ - children, - placeholder -}) { - const [shouldRender, setShouldRender] = (0,external_wp_element_namespaceObject.useState)(false); - - // In the future, we could try to use startTransition here, but currently - // react will batch all transitions, which means all previews will be - // rendered at the same time. - // https://react.dev/reference/react/startTransition#caveats - // > If there are multiple ongoing Transitions, React currently batches them - // > together. This is a limitation that will likely be removed in a future - // > release. - - (0,external_wp_element_namespaceObject.useEffect)(() => { - const context = {}; - blockPreviewQueue.add(context, () => { - // Synchronously run all renders so it consumes timeRemaining. - // See https://github.com/WordPress/gutenberg/pull/48238 - (0,external_wp_element_namespaceObject.flushSync)(() => { - setShouldRender(true); - }); - }); - return () => { - blockPreviewQueue.cancel(context); - }; - }, []); - if (!shouldRender) { - return placeholder; - } - return children; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/utils.js -const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-pattern-settings.js + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 1, + expanded: false, + style: { + flexShrink: 0 + }, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_view_config, { + defaultLayouts: defaultLayouts + }), header] + })] + }), isShowingFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dataviews_filters, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsLayout, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsFooter, {})] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-pattern-settings.js /** * WordPress dependencies */ @@ -33775,7 +36923,7 @@ const storedSettings = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings - } = lock_unlock_unlock(select(store)); + } = unlock(select(store)); return getSettings(); }, []); const settingsBlockPatterns = (_storedSettings$__exp = storedSettings.__experimentalAdditionalBlockPatterns) !== null && _storedSettings$__exp !== void 0 ? _storedSettings$__exp : @@ -33792,358 +36940,28 @@ return { ...restStoredSettings, __experimentalBlockPatterns: blockPatterns, - __unstableIsPreviewMode: true + isPreviewMode: true }; }, [storedSettings, blockPatterns]); return settings; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/search-items.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const { - extractWords, - getNormalizedSearchTerms, - normalizeString: search_items_normalizeString -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); - -/** - * Internal dependencies - */ - - -// Default search helpers. -const defaultGetName = item => item.name || ''; -const defaultGetTitle = item => item.title; -const defaultGetDescription = item => item.description || ''; -const defaultGetKeywords = item => item.keywords || []; -const defaultHasCategory = () => false; -const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { - return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term))); -}; - -/** - * Filters an item list given a search term. - * - * @param {Array} items Item list - * @param {string} searchInput Search input. - * @param {Object} config Search Config. - * - * @return {Array} Filtered item list. - */ -const searchItems = (items = [], searchInput = '', config = {}) => { - const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); - - // Filter patterns by category: the default category indicates that all patterns will be shown. - const onlyFilterByCategory = config.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length; - const searchRankConfig = { - ...config, - onlyFilterByCategory - }; - - // If we aren't filtering on search terms, matching on category is satisfactory. - // If we are, then we need more than a category match. - const threshold = onlyFilterByCategory ? 0 : 1; - const rankedItems = items.map(item => { - return [item, getItemSearchRank(item, searchInput, searchRankConfig)]; - }).filter(([, rank]) => rank > threshold); - - // If we didn't have terms to search on, there's no point sorting. - if (normalizedSearchTerms.length === 0) { - return rankedItems.map(([item]) => item); - } - rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); - return rankedItems.map(([item]) => item); -}; - -/** - * Get the search rank for a given item and a specific search term. - * The better the match, the higher the rank. - * If the rank equals 0, it should be excluded from the results. - * - * @param {Object} item Item to filter. - * @param {string} searchTerm Search term. - * @param {Object} config Search Config. - * - * @return {number} Search Rank. - */ -function getItemSearchRank(item, searchTerm, config) { - const { - categoryId, - getName = defaultGetName, - getTitle = defaultGetTitle, - getDescription = defaultGetDescription, - getKeywords = defaultGetKeywords, - hasCategory = defaultHasCategory, - onlyFilterByCategory - } = config; - let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0; - - // If an item doesn't belong to the current category or we don't have - // search terms to filter by, return the initial rank value. - if (!rank || onlyFilterByCategory) { - return rank; - } - const name = getName(item); - const title = getTitle(item); - const description = getDescription(item); - const keywords = getKeywords(item); - const normalizedSearchInput = search_items_normalizeString(searchTerm); - const normalizedTitle = search_items_normalizeString(title); - - // Prefers exact matches - // Then prefers if the beginning of the title matches the search term - // name, keywords, description matches come later. - if (normalizedSearchInput === normalizedTitle) { - rank += 30; - } else if (normalizedTitle.startsWith(normalizedSearchInput)) { - rank += 20; - } else { - const terms = [name, title, description, ...keywords].join(' '); - const normalizedSearchTerms = extractWords(normalizedSearchInput); - const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); - if (unmatchedTerms.length === 0) { - rank += 10; - } - } - return rank; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/use-patterns.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const EMPTY_PATTERN_LIST = []; -const createTemplatePartId = (theme, slug) => theme && slug ? theme + '//' + slug : null; -const templatePartToPattern = templatePart => ({ - blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw, { - __unstableSkipMigrationLogs: true - }), - categories: [templatePart.area], - description: templatePart.description || '', - isCustom: templatePart.source === TEMPLATE_ORIGINS.custom, - keywords: templatePart.keywords || [], - id: createTemplatePartId(templatePart.theme, templatePart.slug), - name: createTemplatePartId(templatePart.theme, templatePart.slug), - title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(templatePart.title.rendered), - type: templatePart.type, - _links: templatePart._links, - templatePart -}); -const selectTemplatePartsAsPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, search = '') => { - var _getEntityRecords; - const { - getEntityRecords, - isResolving: isResolvingSelector - } = select(external_wp_coreData_namespaceObject.store); - const { - __experimentalGetDefaultTemplatePartAreas - } = select(external_wp_editor_namespaceObject.store); - const query = { - per_page: -1 - }; - const rawTemplateParts = (_getEntityRecords = getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, query)) !== null && _getEntityRecords !== void 0 ? _getEntityRecords : EMPTY_PATTERN_LIST; - const templateParts = rawTemplateParts.map(templatePart => templatePartToPattern(templatePart)); - - // In the case where a custom template part area has been removed we need - // the current list of areas to cross check against so orphaned template - // parts can be treated as uncategorized. - const knownAreas = __experimentalGetDefaultTemplatePartAreas() || []; - const templatePartAreas = knownAreas.map(area => area.area); - const templatePartHasCategory = (item, category) => { - if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) { - return item.templatePart.area === category; - } - return item.templatePart.area === category || !templatePartAreas.includes(item.templatePart.area); - }; - const isResolving = isResolvingSelector('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, query]); - const patterns = searchItems(templateParts, search, { - categoryId, - hasCategory: templatePartHasCategory - }); - return { - patterns, - isResolving - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 -}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 -}]), select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas()]); -const selectThemePatterns = (0,external_wp_data_namespaceObject.createSelector)(select => { - var _settings$__experimen; - const { - getSettings - } = lock_unlock_unlock(select(store)); - const { - isResolving: isResolvingSelector - } = select(external_wp_coreData_namespaceObject.store); - const settings = getSettings(); - const blockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns; - const restBlockPatterns = select(external_wp_coreData_namespaceObject.store).getBlockPatterns(); - const patterns = [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false).map(pattern => ({ - ...pattern, - keywords: pattern.keywords || [], - type: PATTERN_TYPES.theme, - blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { - __unstableSkipMigrationLogs: true - }) - })); - return { - patterns, - isResolving: isResolvingSelector('getBlockPatterns') - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), select(external_wp_coreData_namespaceObject.store).isResolving('getBlockPatterns'), lock_unlock_unlock(select(store)).getSettings()]); -const selectPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, categoryId, syncStatus, search = '') => { - const { - patterns: themePatterns, - isResolving: isResolvingThemePatterns - } = selectThemePatterns(select); - const { - patterns: userPatterns, - isResolving: isResolvingUserPatterns - } = selectUserPatterns(select); - let patterns = [...(themePatterns || []), ...(userPatterns || [])]; - if (syncStatus) { - // User patterns can have their sync statuses checked directly - // Non-user patterns are all unsynced for the time being. - patterns = patterns.filter(pattern => { - return pattern.type === PATTERN_TYPES.user ? pattern.syncStatus === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced; - }); - } - if (categoryId) { - patterns = searchItems(patterns, search, { - categoryId, - hasCategory: (item, currentCategory) => item.categories?.includes(currentCategory) - }); - } else { - patterns = searchItems(patterns, search, { - hasCategory: item => !item.hasOwnProperty('categories') - }); - } - return { - patterns, - isResolving: isResolvingThemePatterns || isResolvingUserPatterns - }; -}, select => [selectThemePatterns(select), selectUserPatterns(select)]); - -/** - * Converts a post of type `wp_block` to a 'pattern item' that more closely - * matches the structure of theme provided patterns. - * - * @param {Object} patternPost The `wp_block` record being normalized. - * @param {Map} categories A Map of user created categories. - * - * @return {Object} The normalized item. - */ -const convertPatternPostToItem = (patternPost, categories) => ({ - blocks: (0,external_wp_blocks_namespaceObject.parse)(patternPost.content.raw, { - __unstableSkipMigrationLogs: true - }), - ...(patternPost.wp_pattern_category.length > 0 && { - categories: patternPost.wp_pattern_category.map(patternCategoryId => categories && categories.get(patternCategoryId) ? categories.get(patternCategoryId).slug : patternCategoryId) - }), - termLabels: patternPost.wp_pattern_category.map(patternCategoryId => categories?.get(patternCategoryId) ? categories.get(patternCategoryId).label : patternCategoryId), - id: patternPost.id, - name: patternPost.slug, - syncStatus: patternPost.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full, - title: patternPost.title.raw, - type: patternPost.type, - description: patternPost.excerpt.raw, - patternPost -}); -const selectUserPatterns = (0,external_wp_data_namespaceObject.createSelector)((select, syncStatus, search = '') => { - const { - getEntityRecords, - isResolving: isResolvingSelector, - getUserPatternCategories - } = select(external_wp_coreData_namespaceObject.store); - const query = { - per_page: -1 - }; - const patternPosts = getEntityRecords('postType', PATTERN_TYPES.user, query); - const userPatternCategories = getUserPatternCategories(); - const categories = new Map(); - userPatternCategories.forEach(userCategory => categories.set(userCategory.id, userCategory)); - let patterns = patternPosts ? patternPosts.map(record => convertPatternPostToItem(record, categories)) : EMPTY_PATTERN_LIST; - const isResolving = isResolvingSelector('getEntityRecords', ['postType', PATTERN_TYPES.user, query]); - if (syncStatus) { - patterns = patterns.filter(pattern => pattern.syncStatus === syncStatus); - } - patterns = searchItems(patterns, search, { - // We exit user pattern retrieval early if we aren't in the - // catch-all category for user created patterns, so it has - // to be in the category. - hasCategory: () => true - }); - return { - patterns, - isResolving, - categories: userPatternCategories - }; -}, select => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', PATTERN_TYPES.user, { - per_page: -1 -}), select(external_wp_coreData_namespaceObject.store).isResolving('getEntityRecords', ['postType', PATTERN_TYPES.user, { - per_page: -1 -}]), select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()]); -const usePatterns = (postType, categoryId, { - search = '', - syncStatus -} = {}) => { - return (0,external_wp_data_namespaceObject.useSelect)(select => { - if (postType === TEMPLATE_PART_POST_TYPE) { - return selectTemplatePartsAsPatterns(select, categoryId, search); - } else if (postType === PATTERN_TYPES.user && !!categoryId) { - const appliedCategory = categoryId === 'uncategorized' ? '' : categoryId; - return selectPatterns(select, appliedCategory, syncStatus, search); - } else if (postType === PATTERN_TYPES.user) { - return selectUserPatterns(select, syncStatus, search); - } - return { - patterns: EMPTY_PATTERN_LIST, - isResolving: false - }; - }, [categoryId, postType, search, syncStatus]); -}; -/* harmony default export */ const use_patterns = (usePatterns); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js -/** - * WordPress dependencies - */ - - -const symbol_symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" - }) -}); -/* harmony default export */ const library_symbol = (symbol_symbol); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js +;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js +/** + * WordPress dependencies + */ + + +const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" + }) +}); +/* harmony default export */ const symbol_filled = (symbolFilled); + +;// ./node_modules/@wordpress/icons/build-module/library/upload.js /** * WordPress dependencies */ @@ -34158,47 +36976,47 @@ }); /* harmony default export */ const library_upload = (upload); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-pattern/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - -const { - useHistory: add_new_pattern_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-pattern/index.js +/** + * WordPress dependencies + */ + + + + + + + + + + + +/** + * Internal dependencies + */ + + + +const { + useHistory: add_new_pattern_useHistory, + useLocation: add_new_pattern_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); const { CreatePatternModal, useAddPatternCategory -} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); -const { - CreateTemplatePartModal: add_new_pattern_CreateTemplatePartModal -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_patterns_namespaceObject.privateApis); +const { + CreateTemplatePartModal +} = unlock(external_wp_editor_namespaceObject.privateApis); function AddNewPattern() { const history = add_new_pattern_useHistory(); + const location = add_new_pattern_useLocation(); const [showPatternModal, setShowPatternModal] = (0,external_wp_element_namespaceObject.useState)(false); const [showTemplatePartModal, setShowTemplatePartModal] = (0,external_wp_element_namespaceObject.useState)(false); // eslint-disable-next-line @wordpress/no-unused-vars-before-return const { createPatternFromFile - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_patterns_namespaceObject.store)); + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_patterns_namespaceObject.store)); const { createSuccessNotice, createErrorNotice @@ -34220,29 +37038,26 @@ isBlockBasedTheme: getCurrentTheme()?.is_block_theme, addNewPatternLabel: getPostType(PATTERN_TYPES.user)?.labels?.add_new_item, addNewTemplatePartLabel: getPostType(TEMPLATE_PART_POST_TYPE)?.labels?.add_new_item, - canCreatePattern: canUser('create', 'blocks'), - canCreateTemplatePart: canUser('create', 'template-parts') + // Blocks refers to the wp_block post type, this checks the ability to create a post of that type. + canCreatePattern: canUser('create', { + kind: 'postType', + name: PATTERN_TYPES.user + }), + canCreateTemplatePart: canUser('create', { + kind: 'postType', + name: TEMPLATE_PART_POST_TYPE + }) }; }, []); function handleCreatePattern({ pattern }) { setShowPatternModal(false); - history.push({ - postId: pattern.id, - postType: PATTERN_TYPES.user, - canvas: 'edit' - }); + history.navigate(`/${PATTERN_TYPES.user}/${pattern.id}?canvas=edit`); } function handleCreateTemplatePart(templatePart) { setShowTemplatePartModal(false); - - // Navigate to the created template part editor. - history.push({ - postId: templatePart.id, - postType: TEMPLATE_PART_POST_TYPE, - canvas: 'edit' - }); + history.navigate(`/${TEMPLATE_PART_POST_TYPE}/${templatePart.id}?canvas=edit`); } function handleError() { setShowPatternModal(false); @@ -34294,7 +37109,7 @@ onClose: () => setShowPatternModal(false), onSuccess: handleCreatePattern, onError: handleError - }), showTemplatePartModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_new_pattern_CreateTemplatePartModal, { + }), showTemplatePartModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateTemplatePartModal, { closeModal: () => setShowTemplatePartModal(false), blocks: [], onCreate: handleCreateTemplatePart, @@ -34310,17 +37125,16 @@ return; } try { - const { - params: { - postType, - categoryId - } - } = history.getLocationWithParams(); let currentCategoryId; // When we're not handling template parts, we should // add or create the proper pattern category. - if (postType !== TEMPLATE_PART_POST_TYPE) { - const currentCategory = categoryMap.values().find(term => term.name === categoryId); + if (location.query.postType !== TEMPLATE_PART_POST_TYPE) { + /* + * categoryMap.values() returns an iterator. + * Iterator.prototype.find() is not yet widely supported. + * Convert to array to use the Array.prototype.find method. + */ + const currentCategory = Array.from(categoryMap.values()).find(term => term.name === location.query.categoryId); if (currentCategory) { currentCategoryId = currentCategory.id || (await findOrCreateTerm(currentCategory.label)); } @@ -34330,11 +37144,8 @@ // Navigate to the All patterns category for the newly created pattern // if we're not on that page already and if we're not in the `my-patterns` // category. - if (!currentCategoryId && categoryId !== 'my-patterns') { - history.push({ - postType: PATTERN_TYPES.user, - categoryId: PATTERN_DEFAULT_CATEGORY - }); + if (!currentCategoryId && location.query.categoryId !== 'my-patterns') { + history.navigate(`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`); } createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The imported pattern's title. @@ -34355,181 +37166,27 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - -function useDefaultPatternCategories() { - const blockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _settings$__experimen; - const { - getSettings - } = lock_unlock_unlock(select(store)); - const settings = getSettings(); - return (_settings$__experimen = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatternCategories; - }); - const restBlockPatternCategories = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatternCategories()); - return [...(blockPatternCategories || []), ...(restBlockPatternCategories || [])]; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - -function useThemePatterns() { - const blockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _getSettings$__experi; - const { - getSettings - } = lock_unlock_unlock(select(store)); - return (_getSettings$__experi = getSettings().__experimentalAdditionalBlockPatterns) !== null && _getSettings$__experi !== void 0 ? _getSettings$__experi : getSettings().__experimentalBlockPatterns; - }); - const restBlockPatterns = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getBlockPatterns()); - const patterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(blockPatterns || []), ...(restBlockPatterns || [])].filter(pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source)).filter(filterOutDuplicatesByName).filter(pattern => pattern.inserter !== false), [blockPatterns, restBlockPatterns]); - return patterns; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function usePatternCategories() { - const defaultCategories = useDefaultPatternCategories(); - defaultCategories.push({ - name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') - }); - const themePatterns = useThemePatterns(); - const { - patterns: userPatterns, - categories: userPatternCategories - } = use_patterns(PATTERN_TYPES.user); - const patternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { - const categoryMap = {}; - const categoriesWithCounts = []; - - // Create a map for easier counting of patterns in categories. - defaultCategories.forEach(category => { - if (!categoryMap[category.name]) { - categoryMap[category.name] = { - ...category, - count: 0 - }; - } - }); - userPatternCategories.forEach(category => { - if (!categoryMap[category.name]) { - categoryMap[category.name] = { - ...category, - count: 0 - }; - } - }); - - // Update the category counts to reflect theme registered patterns. - themePatterns.forEach(pattern => { - pattern.categories?.forEach(category => { - if (categoryMap[category]) { - categoryMap[category].count += 1; - } - }); - // If the pattern has no categories, add it to uncategorized. - if (!pattern.categories?.length) { - categoryMap.uncategorized.count += 1; - } - }); - - // Update the category counts to reflect user registered patterns. - userPatterns.forEach(pattern => { - pattern.categories?.forEach(category => { - if (categoryMap[category]) { - categoryMap[category].count += 1; - } - }); - // If the pattern has no categories, add it to uncategorized. - if (!pattern.categories?.length) { - categoryMap.uncategorized.count += 1; - } - }); - - // Filter categories so we only have those containing patterns. - [...defaultCategories, ...userPatternCategories].forEach(category => { - if (categoryMap[category.name].count && !categoriesWithCounts.find(cat => cat.name === category.name)) { - categoriesWithCounts.push(categoryMap[category.name]); - } - }); - const sortedCategories = categoriesWithCounts.sort((a, b) => a.label.localeCompare(b.label)); - sortedCategories.unshift({ - name: PATTERN_USER_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('My patterns'), - count: userPatterns.length - }); - sortedCategories.unshift({ - name: PATTERN_DEFAULT_CATEGORY, - label: (0,external_wp_i18n_namespaceObject.__)('All patterns'), - description: (0,external_wp_i18n_namespaceObject.__)('A list of all patterns from all sources.'), - count: themePatterns.length + userPatterns.length - }); - return sortedCategories; - }, [defaultCategories, themePatterns, userPatternCategories, userPatterns]); - return { - patternCategories, - hasPatterns: !!patternCategories.length - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/rename-category-menu-item.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - -/** - * Internal dependencies - */ - - +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/rename-category-menu-item.js +/** + * WordPress dependencies + */ + + + + +/** + * Internal dependencies + */ + + +/** + * Internal dependencies + */ const { RenamePatternCategoryModal -} = lock_unlock_unlock(external_wp_patterns_namespaceObject.privateApis); +} = unlock(external_wp_patterns_namespaceObject.privateApis); function RenameCategoryMenuItem({ category, onClose @@ -34539,7 +37196,7 @@ children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => setIsModalOpen(true), children: (0,external_wp_i18n_namespaceObject.__)('Rename') - }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenameModal, { + }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rename_category_menu_item_RenameModal, { category: category, onClose: () => { setIsModalOpen(false); @@ -34548,7 +37205,7 @@ })] }); } -function RenameModal({ +function rename_category_menu_item_RenameModal({ category, onClose }) { @@ -34567,34 +37224,34 @@ category: normalizedCategory, existingCategories: existingCategories, onClose: onClose, - overlayClassName: "edit-site-list__rename-modal" - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/delete-category-menu-item.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - + overlayClassName: "edit-site-list__rename-modal", + focusOnMount: "firstContentElement", + size: "small" + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/delete-category-menu-item.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ const { useHistory: delete_category_menu_item_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); function DeleteCategoryMenuItem({ category, onClose @@ -34623,16 +37280,13 @@ invalidateResolution('getEntityRecords', ['postType', PATTERN_TYPES.user, { per_page: -1 }]); - createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The pattern category's name */ - (0,external_wp_i18n_namespaceObject.__)('"%s" deleted.'), category.label), { + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The pattern category's name */ + (0,external_wp_i18n_namespaceObject._x)('"%s" deleted.', 'pattern category'), category.label), { type: 'snackbar', id: 'pattern-category-delete' }); onClose?.(); - history.push({ - postType: PATTERN_TYPES.user, - categoryId: PATTERN_DEFAULT_CATEGORY - }); + history.navigate(`/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}`); } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the pattern category.'); createErrorNotice(errorMessage, { @@ -34654,7 +37308,7 @@ className: "edit-site-patterns__delete-modal", title: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The pattern category's name. - (0,external_wp_i18n_namespaceObject.__)('Delete "%s"?'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.label)), + (0,external_wp_i18n_namespaceObject._x)('Delete "%s"?', 'pattern category'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.label)), size: "medium", __experimentalHideHeader: false, children: (0,external_wp_i18n_namespaceObject.sprintf)( @@ -34664,20 +37318,19 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/header.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/header.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ @@ -34693,7 +37346,7 @@ const { patternCategories } = usePatternCategories(); - const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); + const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [], []); let title, description, patternCategory; if (type === TEMPLATE_PART_POST_TYPE) { const templatePartArea = templatePartAreas.find(area => area.area === categoryId); @@ -34709,7 +37362,7 @@ } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "edit-site-patterns__section-header", - spacing: 0, + spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", className: "edit-site-patterns__title", @@ -34718,6 +37371,7 @@ level: 3, id: titleId, weight: 500, + truncate: true, children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, @@ -34726,7 +37380,7 @@ label: (0,external_wp_i18n_namespaceObject.__)('Actions'), toggleProps: { className: 'edit-site-patterns__button', - describedBy: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: pattern category name */ + description: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: pattern category name */ (0,external_wp_i18n_namespaceObject.__)('Action menu for %s pattern category'), title), size: 'compact' }, @@ -34753,7 +37407,68 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js +;// ./node_modules/@wordpress/icons/build-module/library/pencil.js +/** + * WordPress dependencies + */ + + +const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" + }) +}); +/* harmony default export */ const library_pencil = (pencil); + +;// ./node_modules/@wordpress/icons/build-module/library/edit.js +/** + * Internal dependencies + */ + + +/* harmony default export */ const edit = (library_pencil); + +;// ./node_modules/@wordpress/edit-site/build-module/components/dataviews-actions/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + +const { + useHistory: dataviews_actions_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const useEditPostAction = () => { + const history = dataviews_actions_useHistory(); + return (0,external_wp_element_namespaceObject.useMemo)(() => ({ + id: 'edit-post', + label: (0,external_wp_i18n_namespaceObject.__)('Edit'), + isPrimary: true, + icon: edit, + isEligible(post) { + if (post.status === 'trash') { + return false; + } + // It's eligible for all post types except theme patterns. + return post.type !== PATTERN_TYPES.theme; + }, + callback(items) { + const post = items[0]; + history.navigate(`/${post.type}/${post.id}?canvas=edit`); + } + }), [history]); +}; + +;// ./node_modules/@wordpress/icons/build-module/library/plugins.js /** * WordPress dependencies */ @@ -34768,7 +37483,7 @@ }); /* harmony default export */ const library_plugins = (plugins); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js +;// ./node_modules/@wordpress/icons/build-module/library/globe.js /** * WordPress dependencies */ @@ -34783,7 +37498,7 @@ }); /* harmony default export */ const library_globe = (globe); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js +;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js /** * WordPress dependencies */ @@ -34800,7 +37515,7 @@ }); /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-templates/hooks.js +;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/hooks.js /** * WordPress dependencies */ @@ -34886,7 +37601,7 @@ }, [postType, postId]); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/fields.js /** * External dependencies */ @@ -34902,56 +37617,53 @@ - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - -const { - ExperimentalBlockEditorProvider: page_patterns_ExperimentalBlockEditorProvider, - useGlobalStyle: page_patterns_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - usePostActions: page_patterns_usePostActions -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const { - useLocation: page_patterns_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const page_patterns_EMPTY_ARRAY = []; -const defaultConfigPerViewType = { - [LAYOUT_TABLE]: { - primaryField: 'title' - }, - [LAYOUT_GRID]: { - mediaField: 'preview', - primaryField: 'title', - badgeFields: ['sync-status'] - } -}; -const DEFAULT_VIEW = { - type: LAYOUT_GRID, - search: '', - page: 1, - perPage: 20, - hiddenFields: [], - layout: { - ...defaultConfigPerViewType[LAYOUT_GRID] - }, - filters: [] +/** + * Internal dependencies + */ + + + + +const { + useGlobalStyle: fields_useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function PreviewField({ + item +}) { + const descriptionId = (0,external_wp_element_namespaceObject.useId)(); + const description = item.description || item?.excerpt?.raw; + const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE; + const [backgroundColor] = fields_useGlobalStyle('color.background'); + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + var _item$blocks; + return (_item$blocks = item.blocks) !== null && _item$blocks !== void 0 ? _item$blocks : (0,external_wp_blocks_namespaceObject.parse)(item.content.raw, { + __unstableSkipMigrationLogs: true + }); + }, [item?.content?.raw, item.blocks]); + const isEmpty = !blocks?.length; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "page-patterns-preview-field", + style: { + backgroundColor + }, + "aria-describedby": !!description ? descriptionId : undefined, + children: [isEmpty && isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty template part'), isEmpty && !isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty pattern'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { + blocks: blocks, + viewportWidth: item.viewportWidth + }) + }), !!description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + hidden: true, + id: descriptionId, + children: description + })] + }); +} +const previewField = { + label: (0,external_wp_i18n_namespaceObject.__)('Preview'), + id: 'preview', + render: PreviewField, + enableSorting: false }; const SYNC_FILTERS = [{ value: PATTERN_SYNC_TYPES.full, @@ -34962,63 +37674,31 @@ label: (0,external_wp_i18n_namespaceObject._x)('Not synced', 'pattern (singular)'), description: (0,external_wp_i18n_namespaceObject.__)('Patterns that can be changed freely without affecting the site.') }]; -function PreviewWrapper({ - item, - onClick, - ariaDescribedBy, - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { - className: "page-patterns-preview-field__button", - type: "button", - onClick: item.type !== PATTERN_TYPES.theme ? onClick : undefined, - "aria-label": item.title, - "aria-describedby": ariaDescribedBy, - "aria-disabled": item.type === PATTERN_TYPES.theme, - children: children - }); -} -function Preview({ - item, - viewType -}) { - const descriptionId = (0,external_wp_element_namespaceObject.useId)(); - const isUserPattern = item.type === PATTERN_TYPES.user; - const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE; - const isEmpty = !item.blocks?.length; - const [backgroundColor] = page_patterns_useGlobalStyle('color.background'); - const { - onClick - } = useLink({ - postType: item.type, - postId: isUserPattern ? item.id : item.name, - canvas: 'edit' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: `page-patterns-preview-field is-viewtype-${viewType}`, - style: { - backgroundColor - }, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreviewWrapper, { - item: item, - onClick: onClick, - ariaDescribedBy: item.description ? descriptionId : undefined, - children: [isEmpty && isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty template part'), isEmpty && !isTemplatePart && (0,external_wp_i18n_namespaceObject.__)('Empty pattern'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Async, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { - blocks: item.blocks, - viewportWidth: item.viewportWidth - }) - })] - }), item.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - hidden: true, - id: descriptionId, - children: item.description - })] - }); -} -function Author({ - item, - viewType +const patternStatusField = { + label: (0,external_wp_i18n_namespaceObject.__)('Sync status'), + id: 'sync-status', + render: ({ + item + }) => { + const syncStatus = 'wp_pattern_sync_status' in item ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full : PATTERN_SYNC_TYPES.unsynced; + // User patterns can have their sync statuses checked directly. + // Non-user patterns are all unsynced for the time being. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: `edit-site-patterns__field-sync-status-${syncStatus}`, + children: SYNC_FILTERS.find(({ + value + }) => value === syncStatus).label + }); + }, + elements: SYNC_FILTERS, + filterBy: { + operators: [OPERATOR_IS], + isPrimary: true + }, + enableSorting: false +}; +function AuthorField({ + item }) { const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); const { @@ -35026,11 +37706,10 @@ icon, imageUrl } = useAddedBy(item.type, item.id); - const withIcon = viewType !== LAYOUT_LIST; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "left", - spacing: 1, - children: [withIcon && imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + spacing: 0, + children: [imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('page-templates-author-field__avatar', { 'is-loaded': isImageLoaded }), @@ -35039,7 +37718,7 @@ alt: "", src: imageUrl }) - }), withIcon && !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + }), !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "page-templates-author-field__icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: icon @@ -35050,64 +37729,101 @@ })] }); } -function Title({ - item -}) { - const isUserPattern = item.type === PATTERN_TYPES.user; - const { - onClick - } = useLink({ - postType: item.type, - postId: isUserPattern ? item.id : item.name, - canvas: 'edit' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "center", - justify: "flex-start", - spacing: 2, - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { - as: "div", - gap: 0, - justify: "left", - className: "edit-site-patterns__pattern-title", - children: item.type === PATTERN_TYPES.theme ? item.title : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - variant: "link", - onClick: onClick - // Required for the grid's roving tab index system. - // See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243. - , - tabIndex: "-1", - children: item.title || item.name - }) - }), item.type === PATTERN_TYPES.theme && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { - placement: "top", - text: (0,external_wp_i18n_namespaceObject.__)('This pattern cannot be edited.'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - className: "edit-site-patterns__pattern-lock-icon", - icon: lock_small, - size: 24 - }) - })] - }); -} +const templatePartAuthorField = { + label: (0,external_wp_i18n_namespaceObject.__)('Author'), + id: 'author', + getValue: ({ + item + }) => item.author_text, + render: AuthorField, + filterBy: { + isPrimary: true + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-patterns/index.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + + +const { + ExperimentalBlockEditorProvider: page_patterns_ExperimentalBlockEditorProvider +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +const { + usePostActions, + patternTitleField +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: page_patterns_useLocation, + useHistory: page_patterns_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const page_patterns_EMPTY_ARRAY = []; +const defaultLayouts = { + [LAYOUT_TABLE]: { + layout: { + styles: { + author: { + width: '1%' + } + } + } + }, + [LAYOUT_GRID]: { + layout: { + badgeFields: ['sync-status'] + } + } +}; +const DEFAULT_VIEW = { + type: LAYOUT_GRID, + search: '', + page: 1, + perPage: 20, + titleField: 'title', + mediaField: 'preview', + fields: ['sync-status'], + filters: [], + ...defaultLayouts[LAYOUT_GRID] +}; function DataviewsPatterns() { const { - params: { - postType, + query: { + postType = 'wp_block', categoryId: categoryIdFromURL } } = page_patterns_useLocation(); - const type = postType || PATTERN_TYPES.user; + const history = page_patterns_useHistory(); const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY; const [view, setView] = (0,external_wp_element_namespaceObject.useState)(DEFAULT_VIEW); const previousCategoryId = (0,external_wp_compose_namespaceObject.usePrevious)(categoryId); + const previousPostType = (0,external_wp_compose_namespaceObject.usePrevious)(postType); const viewSyncStatus = view.filters?.find(({ field }) => field === 'sync-status')?.value; const { patterns, isResolving - } = use_patterns(type, categoryId, { + } = use_patterns(postType, categoryId, { search: view.search, syncStatus: viewSyncStatus }); @@ -35130,84 +37846,27 @@ })); }, [records]); const fields = (0,external_wp_element_namespaceObject.useMemo)(() => { - const _fields = [{ - header: (0,external_wp_i18n_namespaceObject.__)('Preview'), - id: 'preview', - render: ({ - item - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Preview, { - item: item, - viewType: view.type - }), - enableSorting: false, - enableHiding: false, - width: '1%' - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Title'), - id: 'title', - render: ({ - item - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Title, { - item: item - }), - enableHiding: false - }]; - if (type === PATTERN_TYPES.user) { + const _fields = [previewField, patternTitleField]; + if (postType === PATTERN_TYPES.user) { + _fields.push(patternStatusField); + } else if (postType === TEMPLATE_PART_POST_TYPE) { _fields.push({ - header: (0,external_wp_i18n_namespaceObject.__)('Sync status'), - id: 'sync-status', - render: ({ - item - }) => { - // User patterns can have their sync statuses checked directly. - // Non-user patterns are all unsynced for the time being. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: `edit-site-patterns__field-sync-status-${item.syncStatus}`, - children: (SYNC_FILTERS.find(({ - value - }) => value === item.syncStatus) || SYNC_FILTERS.find(({ - value - }) => value === PATTERN_SYNC_TYPES.unsynced)).label - }); - }, - elements: SYNC_FILTERS, - filterBy: { - operators: [OPERATOR_IS], - isPrimary: true - }, - enableSorting: false - }); - } else if (type === TEMPLATE_PART_POST_TYPE) { - _fields.push({ - header: (0,external_wp_i18n_namespaceObject.__)('Author'), - id: 'author', - getValue: ({ - item - }) => item.templatePart.author_text, - render: ({ - item - }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Author, { - viewType: view.type, - item: item - }); - }, - elements: authors, - filterBy: { - isPrimary: true - }, - width: '1%' + ...templatePartAuthorField, + elements: authors }); } return _fields; - }, [view.type, type, authors]); + }, [postType, authors]); // Reset the page number when the category changes. (0,external_wp_element_namespaceObject.useEffect)(() => { - if (previousCategoryId !== categoryId) { - setView(DEFAULT_VIEW); - } - }, [categoryId, previousCategoryId]); + if (previousCategoryId !== categoryId || previousPostType !== postType) { + setView(prevView => ({ + ...prevView, + page: 1 + })); + } + }, [categoryId, previousCategoryId, previousPostType, postType]); const { data, paginationInfo @@ -35218,37 +37877,27 @@ ...view }; delete viewWithoutFilters.search; - if (type !== TEMPLATE_PART_POST_TYPE) { + if (postType !== TEMPLATE_PART_POST_TYPE) { viewWithoutFilters.filters = []; } return filterSortAndPaginate(patterns, viewWithoutFilters, fields); - }, [patterns, view, fields, type]); - const templatePartActions = page_patterns_usePostActions({ + }, [patterns, view, fields, postType]); + const dataWithPermissions = useAugmentPatternsWithPermissions(data); + const templatePartActions = usePostActions({ postType: TEMPLATE_PART_POST_TYPE, context: 'list' }); - const patternActions = page_patterns_usePostActions({ + const patternActions = usePostActions({ postType: PATTERN_TYPES.user, context: 'list' }); const editAction = useEditPostAction(); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (type === TEMPLATE_PART_POST_TYPE) { + if (postType === TEMPLATE_PART_POST_TYPE) { return [editAction, ...templatePartActions].filter(Boolean); } return [editAction, ...patternActions].filter(Boolean); - }, [editAction, type, templatePartActions, patternActions]); - const onChangeView = (0,external_wp_element_namespaceObject.useCallback)(newView => { - if (newView.type !== view.type) { - newView = { - ...newView, - layout: { - ...defaultConfigPerViewType[newView.type] - } - }; - } - setView(newView); - }, [view.type, setView]); + }, [editAction, postType, templatePartActions, patternActions]); const id = (0,external_wp_element_namespaceObject.useId)(); const settings = usePatternSettings(); // Wrap everything in a block editor provider. @@ -35262,25 +37911,217 @@ hideTitleFromUI: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsHeader, { categoryId: categoryId, - type: type, + type: postType, titleId: `${id}-title`, descriptionId: `${id}-description` }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { paginationInfo: paginationInfo, fields: fields, actions: actions, - data: data || page_patterns_EMPTY_ARRAY, - getItemId: item => item.name, + data: dataWithPermissions || page_patterns_EMPTY_ARRAY, + getItemId: item => { + var _item$name; + return (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : item.id; + }, isLoading: isResolving, + isItemClickable: item => item.type !== PATTERN_TYPES.theme, + onClickItem: item => { + history.navigate(`/${item.type}/${[PATTERN_TYPES.user, TEMPLATE_PART_POST_TYPE].includes(item.type) ? item.id : item.name}?canvas=edit`); + }, view: view, - onChangeView: onChangeView, - supportedLayouts: [LAYOUT_GRID, LAYOUT_TABLE] - })] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js + onChangeView: setView, + defaultLayouts: defaultLayouts + }, categoryId + postType)] + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/patterns.js +/** + * Internal dependencies + */ + + + + +const patternsRoute = { + name: 'patterns', + path: '/pattern', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? '/' : undefined; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: backPath + }); + }, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), + mobile({ + siteData, + query + }) { + const { + categoryId + } = query; + const isBlockTheme = siteData.currentTheme?.is_block_theme; + const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? '/' : undefined; + return !!categoryId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: backPath + }); + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pattern-item.js +/** + * Internal dependencies + */ + + + + +const patternItemRoute = { + name: 'pattern-item', + path: '/wp_block/:postId', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? '/' : undefined; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: backPath + }); + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-part-item.js +/** + * Internal dependencies + */ + + + +const templatePartItemRoute = { + name: 'template-part-item', + path: '/wp_template_part/*postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { + backPath: "/" + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + + + + +const { + useLocation: content_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +const content_EMPTY_ARRAY = []; +function TemplateDataviewItem({ + template, + isActive +}) { + const { + text, + icon + } = useAddedBy(template.type, template.id); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: (0,external_wp_url_namespaceObject.addQueryArgs)('/template', { + activeView: text + }), + icon: icon, + "aria-current": isActive, + children: text + }); +} +function DataviewsTemplatesSidebarContent() { + const { + query: { + activeView = 'all' + } + } = content_useLocation(); + const { + records + } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_POST_TYPE, { + per_page: -1 + }); + const firstItemPerAuthorText = (0,external_wp_element_namespaceObject.useMemo)(() => { + var _ref; + const firstItemPerAuthor = records?.reduce((acc, template) => { + const author = template.author_text; + if (author && !acc[author]) { + acc[author] = template; + } + return acc; + }, {}); + return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : content_EMPTY_ARRAY; + }, [records]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-templates-browse", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { + to: "/template", + icon: library_layout, + "aria-current": activeView === 'all', + children: (0,external_wp_i18n_namespaceObject.__)('All templates') + }), firstItemPerAuthorText.map(template => { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateDataviewItem, { + template: template, + isActive: activeView === template.author_text + }, template.author_text); + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function SidebarNavigationScreenTemplatesBrowse({ + backPath +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Templates'), + description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'), + backPath: backPath, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsTemplatesSidebarContent, {}) + }); +} + +;// ./node_modules/@wordpress/icons/build-module/library/home.js /** * WordPress dependencies */ @@ -35295,7 +38136,7 @@ }); /* harmony default export */ const library_home = (home); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js +;// ./node_modules/@wordpress/icons/build-module/library/verse.js /** * WordPress dependencies */ @@ -35310,7 +38151,7 @@ }); /* harmony default export */ const library_verse = (verse); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js +;// ./node_modules/@wordpress/icons/build-module/library/pin.js /** * WordPress dependencies */ @@ -35325,7 +38166,7 @@ }); /* harmony default export */ const library_pin = (pin); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js +;// ./node_modules/@wordpress/icons/build-module/library/archive.js /** * WordPress dependencies */ @@ -35342,7 +38183,7 @@ }); /* harmony default export */ const library_archive = (archive); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/not-found.js +;// ./node_modules/@wordpress/icons/build-module/library/not-found.js /** * WordPress dependencies */ @@ -35357,7 +38198,7 @@ }); /* harmony default export */ const not_found = (notFound); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js +;// ./node_modules/@wordpress/icons/build-module/library/list.js /** * WordPress dependencies */ @@ -35372,7 +38213,7 @@ }); /* harmony default export */ const library_list = (list); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-meta.js +;// ./node_modules/@wordpress/icons/build-module/library/block-meta.js /** * WordPress dependencies */ @@ -35389,7 +38230,7 @@ }); /* harmony default export */ const block_meta = (blockMeta); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js +;// ./node_modules/@wordpress/icons/build-module/library/calendar.js /** * WordPress dependencies */ @@ -35404,7 +38245,7 @@ }); /* harmony default export */ const library_calendar = (calendar); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js +;// ./node_modules/@wordpress/icons/build-module/library/tag.js /** * WordPress dependencies */ @@ -35419,11 +38260,10 @@ }); /* harmony default export */ const library_tag = (tag); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/icons/build-module/library/media.js +/** + * WordPress dependencies + */ const media = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { @@ -35439,7 +38279,7 @@ }); /* harmony default export */ const library_media = (media); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post.js +;// ./node_modules/@wordpress/icons/build-module/library/post.js /** * WordPress dependencies */ @@ -35454,11 +38294,10 @@ }); /* harmony default export */ const library_post = (post_post); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/utils.js -/** - * WordPress dependencies - */ - +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/utils.js +/** + * WordPress dependencies + */ @@ -35493,7 +38332,7 @@ * * @param {Object[]} entities The array of entities. * @param {string} path The path to map a `name` property from the entity. - * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface. + * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. */ const mapToIHasNameAndId = (entities, path) => { return (entities || []).map(entity => ({ @@ -35514,7 +38353,7 @@ }), []); }; const useDefaultTemplateTypes = () => { - return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplateTypes(), []); + return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_types || [], []); }; const usePublicPostTypes = () => { const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostTypes({ @@ -35639,10 +38478,10 @@ (0,external_wp_i18n_namespaceObject.__)('Single item: %s'), labels.singular_name); if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Name of the template e.g: "Single Item: Post"; %2s: Slug of the post type e.g: "book". - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), labels.template_name, slug) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Name of the post type e.g: "Post"; %2s: Slug of the post type e.g: "book". - (0,external_wp_i18n_namespaceObject.__)('Single item: %1$s (%2$s)'), labels.singular_name, slug); + // translators: 1: Name of the template e.g: "Single Item: Post". 2: Slug of the post type e.g: "book". + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'post type menu label'), labels.template_name, slug) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: Name of the post type e.g: "Post". 2: Slug of the post type e.g: "book". + (0,external_wp_i18n_namespaceObject._x)('Single item: %1$s (%2$s)', 'post type menu label'), labels.singular_name, slug); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, @@ -35772,10 +38611,10 @@ let menuItemTitle = labels.template_name || labels.singular_name; if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Name of the template e.g: "Products by Category"; %2s: Slug of the taxonomy e.g: "product_cat". - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), labels.template_name, slug) : (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: Name of the taxonomy e.g: "Category"; %2s: Slug of the taxonomy e.g: "product_cat". - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), labels.singular_name, slug); + // translators: 1: Name of the template e.g: "Products by Category". 2s: Slug of the taxonomy e.g: "product_cat". + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'taxonomy template menu label'), labels.template_name, slug) : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: 1: Name of the taxonomy e.g: "Category". 2: Slug of the taxonomy e.g: "product_cat". + (0,external_wp_i18n_namespaceObject._x)('%1$s (%2$s)', 'taxonomy menu label'), labels.singular_name, slug); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, @@ -36025,30 +38864,22 @@ return entitiesInfo; }; -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - -const { - CompositeV2: add_custom_template_modal_content_Composite, - CompositeItemV2: add_custom_template_modal_content_CompositeItem, - useCompositeStoreV2: add_custom_template_modal_content_useCompositeStore -} = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + const add_custom_template_modal_content_EMPTY_ARRAY = []; function SuggestionListItem({ suggestion, @@ -36057,8 +38888,9 @@ entityForSuggestions }) { const baseCssClass = 'edit-site-custom-template-modal__suggestions_list__list-item'; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(add_custom_template_modal_content_CompositeItem, { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, role: "option", className: baseCssClass, onClick: () => onSelect(entityForSuggestions.config.getSpecificTemplate(suggestion)) @@ -36119,9 +38951,6 @@ entityForSuggestions, onSelect }) { - const composite = add_custom_template_modal_content_useCompositeStore({ - orientation: 'vertical' - }); const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(); const suggestions = useSearchSuggestions(entityForSuggestions, debouncedSearch); const { @@ -36138,8 +38967,8 @@ value: search, label: labels.search_items, placeholder: labels.search_items - }), !!suggestions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(add_custom_template_modal_content_Composite, { - store: composite, + }), !!suggestions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { + orientation: "vertical", role: "listbox", className: "edit-site-custom-template-modal__suggestions_list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suggestions list'), @@ -36239,7 +39068,7 @@ } /* harmony default export */ const add_custom_template_modal_content = (AddCustomTemplateModalContent); -;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs +;// ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. @@ -36254,7 +39083,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || @@ -36365,8 +39194,8 @@ } function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -36470,8 +39299,9 @@ function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } @@ -36504,10 +39334,19 @@ o["default"] = v; }; +var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); +}; + function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } @@ -36537,16 +39376,18 @@ function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; + var dispose, inner; if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { @@ -36565,28 +39406,46 @@ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } + var r, s = 0; function next() { - while (env.stack.length) { - var rec = env.stack.pop(); + while (r = env.stack.pop()) { try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; } catch (e) { - fail(e); - } - } + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); } +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); + }); + } + return path; +} + /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, __metadata, __awaiter, __generator, @@ -36609,9 +39468,10 @@ __classPrivateFieldIn, __addDisposableResource, __disposeResources, -}); - -;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js + __rewriteRelativeImportExtension, +}); + +;// ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ @@ -36660,7 +39520,7 @@ return str.toLowerCase(); } -;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js +;// ./node_modules/no-case/dist.es2015/index.js // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; @@ -36692,7 +39552,7 @@ return re.reduce(function (input, re) { return input.replace(re, value); }, input); } -;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js +;// ./node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { @@ -36700,7 +39560,7 @@ return noCase(input, __assign({ delimiter: "." }, options)); } -;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js +;// ./node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { @@ -36708,7 +39568,7 @@ return dotCase(input, __assign({ delimiter: "-" }, options)); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/add-custom-generic-template-modal-content.js /** * External dependencies */ @@ -36721,7 +39581,6 @@ - function AddCustomGenericTemplateModalContent({ onClose, createTemplate @@ -36756,7 +39615,9 @@ onChange: setTitle, placeholder: defaultTitle, disabled: isBusy, - help: (0,external_wp_i18n_namespaceObject.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.') + help: (0,external_wp_i18n_namespaceObject.__)( + // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts + 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "edit-site-custom-generic-template__modal-actions", justify: "right", @@ -36781,7 +39642,7 @@ } /* harmony default export */ const add_custom_generic_template_modal_content = (AddCustomGenericTemplateModalContent); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js /** * External dependencies */ @@ -36800,16 +39661,15 @@ -/** - * Internal dependencies - */ - - -/** - * Internal dependencies - */ - - + +/** + * Internal dependencies + */ + + +/** + * Internal dependencies + */ @@ -36817,7 +39677,7 @@ const { useHistory: add_new_template_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); const DEFAULT_TEMPLATE_SLUGS = ['front-page', 'home', 'single', 'page', 'index', 'archive', 'author', 'category', 'date', 'tag', 'search', '404']; const TEMPLATE_ICONS = { 'front-page': library_home, @@ -36845,6 +39705,7 @@ children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, className: className, onClick: onClick, label: description, @@ -36898,15 +39759,10 @@ createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const { - homeUrl - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getUnstableBase // Site index. - } = select(external_wp_coreData_namespaceObject.store); - return { - homeUrl: getUnstableBase()?.home - }; + const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); + const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { + // Site index. + return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; }, []); const TEMPLATE_SHORT_DESCRIPTIONS = { 'front-page': homeUrl, @@ -36938,13 +39794,9 @@ }); // Navigate to the created template editor. - history.push({ - postId: newTemplate.id, - postType: TEMPLATE_POST_TYPE, - canvas: 'edit' - }); + history.navigate(`/${TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit`); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %s: Title of the created template e.g: "Category". + // translators: %s: Title of the created post or template, e.g: "Hello world". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newTemplate.title?.rendered || title)), { type: 'snackbar' }); @@ -36978,7 +39830,7 @@ onRequestClose: onModalClose, overlayClassName: modalContent === modalContentMap.customGenericTemplate ? 'edit-site-custom-generic-template__modal' : undefined, children: [modalContent === modalContentMap.templatesList && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalGrid, { - columns: 3, + columns: isMobile ? 2 : 3, gap: 4, align: "flex-start", justify: "center", @@ -37098,7 +39950,7 @@ } /* harmony default export */ const add_new_template = ((0,external_wp_element_namespaceObject.memo)(NewTemplate)); -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-templates/index.js +;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/fields.js /** * External dependencies */ @@ -37115,48 +39967,160 @@ - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - -const { - usePostActions: page_templates_usePostActions -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const { - ExperimentalBlockEditorProvider: page_templates_ExperimentalBlockEditorProvider, - useGlobalStyle: page_templates_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); +/** + * Internal dependencies + */ + + + + +const { + useGlobalStyle: page_templates_fields_useGlobalStyle +} = unlock(external_wp_blockEditor_namespaceObject.privateApis); +function fields_PreviewField({ + item +}) { + const settings = usePatternSettings(); + const [backgroundColor = 'white'] = page_templates_fields_useGlobalStyle('color.background'); + const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { + return (0,external_wp_blocks_namespaceObject.parse)(item.content.raw); + }, [item.content.raw]); + const isEmpty = !blocks?.length; + // Wrap everything in a block editor provider to ensure 'styles' that are needed + // for the previews are synced between the site editor store and the block editor store. + // Additionally we need to have the `__experimentalBlockPatterns` setting in order to + // render patterns inside the previews. + // TODO: Same approach is used in the patterns list and it becomes obvious that some of + // the block editor settings are needed in context where we don't have the block editor. + // Explore how we can solve this in a better way. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorProvider, { + post: item, + settings: settings, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { + className: "page-templates-preview-field", + style: { + backgroundColor + }, + children: [isEmpty && (0,external_wp_i18n_namespaceObject.__)('Empty template'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview.Async, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { + blocks: blocks + }) + })] + }) + }); +} +const fields_previewField = { + label: (0,external_wp_i18n_namespaceObject.__)('Preview'), + id: 'preview', + render: fields_PreviewField, + enableSorting: false +}; +const descriptionField = { + label: (0,external_wp_i18n_namespaceObject.__)('Description'), + id: 'description', + render: ({ + item + }) => { + return item.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "page-templates-description", + children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.description) + }); + }, + enableSorting: false, + enableGlobalSearch: true +}; +function fields_AuthorField({ + item +}) { + const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); + const { + text, + icon, + imageUrl + } = useAddedBy(item.type, item.id); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "left", + spacing: 0, + children: [imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: dist_clsx('page-templates-author-field__avatar', { + 'is-loaded': isImageLoaded + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { + onLoad: () => setIsImageLoaded(true), + alt: "", + src: imageUrl + }) + }), !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "page-templates-author-field__icon", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { + icon: icon + }) + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { + className: "page-templates-author-field__name", + children: text + })] + }); +} +const authorField = { + label: (0,external_wp_i18n_namespaceObject.__)('Author'), + id: 'author', + getValue: ({ + item + }) => item.author_text, + render: fields_AuthorField +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/page-templates/index.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + + +const { + usePostActions: page_templates_usePostActions, + templateTitleField +} = unlock(external_wp_editor_namespaceObject.privateApis); const { useHistory: page_templates_useHistory, useLocation: page_templates_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); +const { + useEntityRecordsWithPermissions +} = unlock(external_wp_coreData_namespaceObject.privateApis); const page_templates_EMPTY_ARRAY = []; -const page_templates_defaultConfigPerViewType = { +const page_templates_defaultLayouts = { [LAYOUT_TABLE]: { - primaryField: 'title' + showMedia: false, + layout: { + styles: { + author: { + width: '1%' + } + } + } }, [LAYOUT_GRID]: { - mediaField: 'preview', - primaryField: 'title', - columnFields: ['description'] + showMedia: true }, [LAYOUT_LIST]: { - primaryField: 'title', - mediaField: 'preview' + showMedia: false } }; const page_templates_DEFAULT_VIEW = { @@ -37168,138 +40132,48 @@ field: 'title', direction: 'asc' }, - // All fields are visible by default, so it's - // better to keep track of the hidden ones. - hiddenFields: ['preview'], - layout: page_templates_defaultConfigPerViewType[LAYOUT_GRID], - filters: [] -}; -function page_templates_Title({ - item, - viewType -}) { - if (viewType === LAYOUT_LIST) { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered) || (0,external_wp_i18n_namespaceObject.__)('(no title)'); - } - const linkProps = { - params: { - postId: item.id, - postType: item.type, - canvas: 'edit' - } - }; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Link, { - ...linkProps, - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered) || (0,external_wp_i18n_namespaceObject.__)('(no title)') - }); -} -function AuthorField({ - item, - viewType -}) { - const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); - const { - text, - icon, - imageUrl - } = useAddedBy(item.type, item.id); - const withIcon = viewType !== LAYOUT_LIST; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - alignment: "left", - spacing: 1, - children: [withIcon && imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('page-templates-author-field__avatar', { - 'is-loaded': isImageLoaded - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { - onLoad: () => setIsImageLoaded(true), - alt: "", - src: imageUrl - }) - }), withIcon && !imageUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "page-templates-author-field__icon", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - icon: icon - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "page-templates-author-field__name", - children: text - })] - }); -} -function page_templates_Preview({ - item, - viewType -}) { - const settings = usePatternSettings(); - const [backgroundColor = 'white'] = page_templates_useGlobalStyle('color.background'); - const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { - return (0,external_wp_blocks_namespaceObject.parse)(item.content.raw); - }, [item.content.raw]); - const { - onClick - } = useLink({ - postId: item.id, - postType: item.type, - canvas: 'edit' - }); - const isEmpty = !blocks?.length; - // Wrap everything in a block editor provider to ensure 'styles' that are needed - // for the previews are synced between the site editor store and the block editor store. - // Additionally we need to have the `__experimentalBlockPatterns` setting in order to - // render patterns inside the previews. - // TODO: Same approach is used in the patterns list and it becomes obvious that some of - // the block editor settings are needed in context where we don't have the block editor. - // Explore how we can solve this in a better way. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_templates_ExperimentalBlockEditorProvider, { - settings: settings, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: `page-templates-preview-field is-viewtype-${viewType}`, - style: { - backgroundColor - }, - children: [viewType === LAYOUT_LIST && !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Async, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { - blocks: blocks - }) - }), viewType !== LAYOUT_LIST && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { - className: "page-templates-preview-field__button", - type: "button", - onClick: onClick, - "aria-label": item.title?.rendered || item.title, - children: [isEmpty && (0,external_wp_i18n_namespaceObject.__)('Empty template'), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Async, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockPreview, { - blocks: blocks - }) - })] - })] - }) - }); -} + titleField: 'title', + descriptionField: 'description', + mediaField: 'preview', + fields: ['author'], + filters: [], + ...page_templates_defaultLayouts[LAYOUT_GRID] +}; function PageTemplates() { const { - params + path, + query } = page_templates_useLocation(); const { activeView = 'all', layout, postId - } = params; + } = query; const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)([postId]); const defaultView = (0,external_wp_element_namespaceObject.useMemo)(() => { const usedType = layout !== null && layout !== void 0 ? layout : page_templates_DEFAULT_VIEW.type; return { ...page_templates_DEFAULT_VIEW, type: usedType, - layout: page_templates_defaultConfigPerViewType[usedType], filters: activeView !== 'all' ? [{ field: 'author', operator: 'isAny', value: [activeView] - }] : [] + }] : [], + ...page_templates_defaultLayouts[usedType] }; }, [layout, activeView]); const [view, setView] = (0,external_wp_element_namespaceObject.useState)(defaultView); + + // Sync the layout from the URL to the view state. + (0,external_wp_element_namespaceObject.useEffect)(() => { + setView(currentView => ({ + ...currentView, + type: layout !== null && layout !== void 0 ? layout : page_templates_DEFAULT_VIEW.type + })); + }, [setView, layout]); + + // Sync the active view from the URL to the view state. (0,external_wp_element_namespaceObject.useEffect)(() => { setView(currentView => ({ ...currentView, @@ -37309,22 +40183,22 @@ value: [activeView] }] : [] })); - }, [activeView]); + }, [setView, activeView]); const { records, isResolving: isLoadingData - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_POST_TYPE, { + } = useEntityRecordsWithPermissions('postType', TEMPLATE_POST_TYPE, { per_page: -1 }); const history = page_templates_useHistory(); - const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)(items => { + const onChangeSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { + setSelection(items); if (view?.type === LAYOUT_LIST) { - history.push({ - ...params, - postId: items.length === 1 ? items[0].id : undefined - }); - } - }, [history, params, view?.type]); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + postId: items.length === 1 ? items[0] : undefined + })); + } + }, [history, path, view?.type]); const authors = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!records) { return page_templates_EMPTY_ARRAY; @@ -37338,75 +40212,10 @@ label: author })); }, [records]); - const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [{ - header: (0,external_wp_i18n_namespaceObject.__)('Preview'), - id: 'preview', - render: ({ - item - }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_templates_Preview, { - item: item, - viewType: view.type - }); - }, - minWidth: 120, - maxWidth: 120, - enableSorting: false - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Template'), - id: 'title', - getValue: ({ - item - }) => item.title?.rendered, - render: ({ - item - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(page_templates_Title, { - item: item, - viewType: view.type - }), - maxWidth: 400, - enableHiding: false, - enableGlobalSearch: true - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Description'), - id: 'description', - render: ({ - item - }) => { - return item.description ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - className: "page-templates-description", - children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.description) - }) : view.type === LAYOUT_TABLE && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - variant: "muted", - "aria-hidden": "true", - children: "\u2014" - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { - children: (0,external_wp_i18n_namespaceObject.__)('No description.') - })] - }); - }, - maxWidth: 400, - minWidth: 320, - enableSorting: false, - enableGlobalSearch: true - }, { - header: (0,external_wp_i18n_namespaceObject.__)('Author'), - id: 'author', - getValue: ({ - item - }) => item.author_text, - render: ({ - item - }) => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AuthorField, { - viewType: view.type, - item: item - }); - }, - elements: authors, - width: '1%' - }], [authors, view.type]); + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => [fields_previewField, templateTitleField, descriptionField, { + ...authorField, + elements: authors + }], [authors]); const { data, paginationInfo @@ -37419,21 +40228,14 @@ }); const editAction = useEditPostAction(); const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); - const onChangeView = (0,external_wp_element_namespaceObject.useCallback)(newView => { - if (newView.type !== view.type) { - newView = { - ...newView, - layout: { - ...page_templates_defaultConfigPerViewType[newView.type] - } - }; - history.push({ - ...params, + const onChangeView = (0,external_wp_compose_namespaceObject.useEvent)(newView => { + setView(newView); + if (newView.type !== layout) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { layout: newView.type - }); - } - setView(newView); - }, [view.type, setView, history, params]); + })); + } + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { className: "edit-site-page-templates", title: (0,external_wp_i18n_namespaceObject.__)('Templates'), @@ -37446,272 +40248,349 @@ isLoading: isLoadingData, view: view, onChangeView: onChangeView, - onSelectionChange: onSelectionChange, + onChangeSelection: onChangeSelection, + isItemClickable: () => true, + onClickItem: ({ + id + }) => { + history.navigate(`/wp_template/${id}?canvas=edit`); + }, selection: selection, - setSelection: setSelection - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-button/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - -function SidebarButton(props) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - ...props, - className: dist_clsx('edit-site-sidebar-button', props.className) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - -const { - useHistory: sidebar_navigation_screen_useHistory, - useLocation: sidebar_navigation_screen_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationScreen({ - isRoot, - title, - actions, - meta, - content, - footer, - description, - backPath: backPathProp -}) { - const { - dashboardLink, - dashboardLinkText, - previewingThemeName - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = lock_unlock_unlock(select(store)); - const currentlyPreviewingThemeId = currentlyPreviewingTheme(); - return { - dashboardLink: getSettings().__experimentalDashboardLink, - dashboardLinkText: getSettings().__experimentalDashboardLinkText, - // Do not call `getTheme` with null, it will cause a request to - // the server. - previewingThemeName: currentlyPreviewingThemeId ? select(external_wp_coreData_namespaceObject.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined - }; - }, []); - const location = sidebar_navigation_screen_useLocation(); - const history = sidebar_navigation_screen_useHistory(); - const { - navigate - } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); - const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath; - const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - className: dist_clsx('edit-site-sidebar-navigation-screen__main', { - 'has-footer': !!footer - }), - spacing: 0, - justify: "flex-start", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 3, - alignment: "flex-start", - className: "edit-site-sidebar-navigation-screen__title-icon", - children: [!isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - onClick: () => { - history.push(backPath); - navigate('back'); - }, - icon: icon, - label: (0,external_wp_i18n_namespaceObject.__)('Back'), - showTooltip: false - }), isRoot && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: icon, - label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), - href: dashboardLink || 'index.php' - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { - className: "edit-site-sidebar-navigation-screen__title", - color: '#e0e0e0' /* $gray-200 */, - level: 1, - size: 20, - children: !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)('Previewing %1$s: %2$s', previewingThemeName, title) - }), actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen__actions", - children: actions - })] - }), meta && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen__meta", - children: meta - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-sidebar-navigation-screen__content", - children: [description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { - className: "edit-site-sidebar-navigation-screen__description", - children: description - }), content] - })] - }), footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("footer", { - className: "edit-site-sidebar-navigation-screen__footer", - children: footer - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js -/** - * WordPress dependencies - */ - - -const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" - }) -}); -/* harmony default export */ const chevron_left_small = (chevronLeftSmall); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js -/** - * WordPress dependencies - */ - - -const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" - }) -}); -/* harmony default export */ const chevron_right_small = (chevronRightSmall); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - -const { - useHistory: sidebar_navigation_item_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationItem({ - className, - icon, - withChevron = false, - suffix, - uid, - params, - onClick, - children, - ...props -}) { - const history = sidebar_navigation_item_useHistory(); - const { - navigate - } = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext); - // If there is no custom click handler, create one that navigates to `params`. - function handleClick(e) { - if (onClick) { - onClick(e); - navigate('forward'); - } else if (params) { - e.preventDefault(); - history.push(params); - navigate('forward', `[id="${uid}"]`); - } - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { - className: dist_clsx('edit-site-sidebar-navigation-item', { - 'with-suffix': !withChevron && suffix - }, className), - onClick: handleClick, - id: uid, - ...props, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "flex-start", - children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - style: { - fill: 'currentcolor' - }, - icon: icon, - size: 24 - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { - children: children - }), withChevron && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { - icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small, - className: "edit-site-sidebar-navigation-item__drilldown-indicator", - size: 24 - }), !withChevron && suffix] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js -/** - * WordPress dependencies - */ - - -function SidebarNavigationScreenDetailsPanelLabel({ - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - className: "edit-site-sidebar-navigation-details-screen-panel__label", - children: children - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js + defaultLayouts: page_templates_defaultLayouts + }, activeView) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/templates.js +/** + * Internal dependencies + */ + + + + + +const templatesRoute = { + name: 'templates', + path: '/template', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { + backPath: "/" + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + content({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) : undefined; + }, + preview({ + query, + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + if (!isBlockTheme) { + return undefined; + } + const isListView = query.layout === 'list'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : undefined; + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + }, + widths: { + content({ + query + }) { + const isListView = query.layout === 'list'; + return isListView ? 380 : undefined; + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/template-item.js +/** + * Internal dependencies + */ + + + + +const templateItemRoute = { + name: 'template-item', + path: '/wp_template/*postId', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { + backPath: "/" + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + } +}; + +;// ./node_modules/@wordpress/icons/build-module/library/pages.js +/** + * WordPress dependencies + */ + + +const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" + })] +}); +/* harmony default export */ const library_pages = (pages); + +;// ./node_modules/@wordpress/icons/build-module/library/published.js +/** + * WordPress dependencies + */ + + +const published = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" + }) +}); +/* harmony default export */ const library_published = (published); + +;// ./node_modules/@wordpress/icons/build-module/library/scheduled.js +/** + * WordPress dependencies + */ + + +const scheduled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" + }) +}); +/* harmony default export */ const library_scheduled = (scheduled); + +;// ./node_modules/@wordpress/icons/build-module/library/drafts.js +/** + * WordPress dependencies + */ + + +const drafts = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" + }) +}); +/* harmony default export */ const library_drafts = (drafts); + +;// ./node_modules/@wordpress/icons/build-module/library/pending.js +/** + * WordPress dependencies + */ + + +const pending = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" + }) +}); +/* harmony default export */ const library_pending = (pending); + +;// ./node_modules/@wordpress/icons/build-module/library/not-allowed.js +/** + * WordPress dependencies + */ + + +const notAllowed = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" + }) +}); +/* harmony default export */ const not_allowed = (notAllowed); + +;// ./node_modules/@wordpress/icons/build-module/library/trash.js +/** + * WordPress dependencies + */ + + +const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" + }) +}); +/* harmony default export */ const library_trash = (trash); + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/default-views.js +/** + * WordPress dependencies + */ + + + + + + +/** + * Internal dependencies + */ + +const default_views_defaultLayouts = { + [LAYOUT_TABLE]: {}, + [LAYOUT_GRID]: {}, + [LAYOUT_LIST]: {} +}; +const DEFAULT_POST_BASE = { + type: LAYOUT_LIST, + search: '', + filters: [], + page: 1, + perPage: 20, + sort: { + field: 'title', + direction: 'asc' + }, + showLevels: true, + titleField: 'title', + mediaField: 'featured_media', + fields: ['author', 'status'], + ...default_views_defaultLayouts[LAYOUT_LIST] +}; +function useDefaultViews({ + postType +}) { + const labels = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getPostType + } = select(external_wp_coreData_namespaceObject.store); + return getPostType(postType)?.labels; + }, [postType]); + return (0,external_wp_element_namespaceObject.useMemo)(() => { + return [{ + title: labels?.all_items || (0,external_wp_i18n_namespaceObject.__)('All items'), + slug: 'all', + icon: library_pages, + view: DEFAULT_POST_BASE + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Published'), + slug: 'published', + icon: library_published, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'publish' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Scheduled'), + slug: 'future', + icon: library_scheduled, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'future' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Drafts'), + slug: 'drafts', + icon: library_drafts, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'draft' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Pending'), + slug: 'pending', + icon: library_pending, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'pending' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Private'), + slug: 'private', + icon: not_allowed, + view: DEFAULT_POST_BASE, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'private' + }] + }, { + title: (0,external_wp_i18n_namespaceObject.__)('Trash'), + slug: 'trash', + icon: library_trash, + view: { + ...DEFAULT_POST_BASE, + type: LAYOUT_TABLE, + layout: default_views_defaultLayouts[LAYOUT_TABLE].layout + }, + filters: [{ + field: 'status', + operator: OPERATOR_IS_ANY, + value: 'trash' + }] + }]; + }, [labels]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/dataview-item.js /** * External dependencies */ @@ -37722,1403 +40601,18 @@ */ -function SidebarNavigationScreenDetailsPanelRow({ - label, - children, - className, - ...extraProps -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - spacing: 5, - alignment: "left", - className: dist_clsx('edit-site-sidebar-navigation-details-screen-panel__row', className), - ...extraProps, - children: children - }, label); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js -/** - * WordPress dependencies - */ - - -function SidebarNavigationScreenDetailsPanelValue({ - children -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { - className: "edit-site-sidebar-navigation-details-screen-panel__value", - children: children - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/index.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -function SidebarNavigationScreenDetailsPanel({ - title, - children, - spacing -}) { - return /*#__PURE__*/_jsxs(VStack, { - className: "edit-site-sidebar-navigation-details-screen-panel", - spacing: spacing, - children: [title && /*#__PURE__*/_jsx(Heading, { - className: "edit-site-sidebar-navigation-details-screen-panel__heading", - level: 2, - children: title - }), children] - }); -} - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - -function SidebarNavigationScreenDetailsFooter({ - record, - ...otherProps -}) { - var _record$_links$predec, _record$_links$versio; - /* - * There might be other items in the future, - * but for now it's just modified date. - * Later we might render a list of items and isolate - * the following logic. - */ - const hrefProps = {}; - const lastRevisionId = (_record$_links$predec = record?._links?.['predecessor-version']?.[0]?.id) !== null && _record$_links$predec !== void 0 ? _record$_links$predec : null; - const revisionsCount = (_record$_links$versio = record?._links?.['version-history']?.[0]?.count) !== null && _record$_links$versio !== void 0 ? _record$_links$versio : 0; - // Enable the revisions link if there is a last revision and there are more than one revisions. - if (lastRevisionId && revisionsCount > 1) { - hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { - revision: record?._links['predecessor-version'][0].id - }); - hrefProps.as = 'a'; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-details-footer", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Revisions'), - ...hrefProps, - ...otherProps, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(SidebarNavigationScreenDetailsPanelRow, { - justify: "space-between", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsPanelLabel, { - children: (0,external_wp_i18n_namespaceObject.__)('Last modified') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsPanelValue, { - children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is the relative time when the post was last modified. */ - (0,external_wp_i18n_namespaceObject.__)(''), (0,external_wp_date_namespaceObject.humanTimeDiff)(record.modified)), { - time: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { - dateTime: record.modified - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { - className: "edit-site-sidebar-navigation-screen-details-footer__icon", - icon: library_backup - })] - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.js -/** - * WordPress dependencies - */ - - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - -const sidebar_navigation_screen_global_styles_noop = () => {}; -function SidebarNavigationItemGlobalStyles(props) { - const { - openGeneralSidebar - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - setCanvasMode - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const hasGlobalStyleVariations = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []); - if (hasGlobalStyleVariations) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...props, - params: { - path: '/wp_global_styles' - }, - uid: "global-styles-navigation-item" - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...props, - onClick: () => { - // Switch to edit mode. - setCanvasMode('edit'); - // Open global styles sidebar. - openGeneralSidebar('edit-site/global-styles'); - } - }); -} -function SidebarNavigationScreenGlobalStylesContent() { - const { - storedSettings - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = lock_unlock_unlock(select(store)); - return { - storedSettings: getSettings() - }; - }, []); - const colorVariations = useColorVariations(); - const typographyVariations = useTypographyVariations(); - const gap = 3; - - // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are - // loaded. This is necessary because the Iframe component waits until - // the block editor store's `__internalIsInitialized` is true before - // rendering the iframe. Without this, the iframe previews will not render - // in mobile viewport sizes, where the editor canvas is hidden. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { - settings: storedSettings, - onChange: sidebar_navigation_screen_global_styles_noop, - onInput: sidebar_navigation_screen_global_styles_noop, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: 10, - className: "edit-site-global-styles-variation-container", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleVariationsContainer, { - gap: gap - }), colorVariations?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorVariations, { - title: (0,external_wp_i18n_namespaceObject.__)('Palettes'), - gap: gap - }), typographyVariations?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyVariations, { - title: (0,external_wp_i18n_namespaceObject.__)('Typography'), - gap: gap - })] - }) - }); -} -function SidebarNavigationScreenGlobalStyles({ - backPath -}) { - const { - revisions, - isLoading: isLoadingRevisions - } = useGlobalStylesRevisions(); - const { - openGeneralSidebar - } = (0,external_wp_data_namespaceObject.useDispatch)(store); - const { - setIsListViewOpened - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); - const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); - const { - setCanvasMode, - setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - const { - isViewMode, - isStyleBookOpened, - revisionsCount - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - var _globalStyles$_links$; - const { - getCanvasMode, - getEditorCanvasContainerView - } = lock_unlock_unlock(select(store)); - const { - getEntityRecord, - __experimentalGetCurrentGlobalStylesId - } = select(external_wp_coreData_namespaceObject.store); - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined; - return { - isViewMode: 'view' === getCanvasMode(), - isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(), - revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0 - }; - }, []); - const { - set: setPreference - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); - const openGlobalStyles = (0,external_wp_element_namespaceObject.useCallback)(async () => { - return Promise.all([setPreference('core', 'distractionFree', false), setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]); - }, [setCanvasMode, openGeneralSidebar, setPreference]); - const openStyleBook = (0,external_wp_element_namespaceObject.useCallback)(async () => { - await openGlobalStyles(); - // Open the Style Book once the canvas mode is set to edit, - // and the global styles sidebar is open. This ensures that - // the Style Book is not prematurely closed. - setEditorCanvasContainerView('style-book'); - setIsListViewOpened(false); - }, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]); - const openRevisions = (0,external_wp_element_namespaceObject.useCallback)(async () => { - await openGlobalStyles(); - // Open the global styles revisions once the canvas mode is set to edit, - // and the global styles sidebar is open. The global styles UI is responsible - // for redirecting to the revisions screen once the editor canvas container - // has been set to 'global-styles-revisions'. - setEditorCanvasContainerView('global-styles-revisions'); - }, [openGlobalStyles, setEditorCanvasContainerView]); - - // If there are no revisions, do not render a footer. - const hasRevisions = revisionsCount > 0; - const modifiedDateTime = revisions?.[0]?.modified; - const shouldShowGlobalStylesFooter = hasRevisions && !isLoadingRevisions && modifiedDateTime; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Styles'), - description: (0,external_wp_i18n_namespaceObject.__)('Choose a different style combination for the theme styles.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStylesContent, {}), - footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenDetailsFooter, { - record: revisions?.[0], - onClick: openRevisions - }), - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: library_seen, - label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), - onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined), - isPressed: isStyleBookOpened - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarButton, { - icon: edit, - label: (0,external_wp_i18n_namespaceObject.__)('Edit styles'), - onClick: async () => await openGlobalStyles() - })] - }) - }), isStyleBookOpened && !isMobileViewport && isViewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_book, { - enableResizing: false, - isSelected: () => false, - onClick: openStyleBook, - onSelect: openStyleBook, - showCloseButton: false, - showTabs: false - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js -/** - * WordPress dependencies - */ - - -const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" - }) -}); -/* harmony default export */ const library_navigation = (navigation); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -function SidebarNavigationScreenMain() { - const { - setEditorCanvasContainerView - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); - - // Clear the editor canvas container view when accessing the main navigation screen. - (0,external_wp_element_namespaceObject.useEffect)(() => { - setEditorCanvasContainerView(undefined); - }, [setEditorCanvasContainerView]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - isRoot: true, - title: (0,external_wp_i18n_namespaceObject.__)('Design'), - description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "navigation-navigation-item", - params: { - postType: NAVIGATION_POST_TYPE - }, - withChevron: true, - icon: library_navigation, - children: (0,external_wp_i18n_namespaceObject.__)('Navigation') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItemGlobalStyles, { - uid: "styles-navigation-item", - withChevron: true, - icon: library_styles, - children: (0,external_wp_i18n_namespaceObject.__)('Styles') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "page-navigation-item", - params: { - postType: 'page' - }, - withChevron: true, - icon: library_page, - children: (0,external_wp_i18n_namespaceObject.__)('Pages') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "template-navigation-item", - params: { - postType: TEMPLATE_POST_TYPE - }, - withChevron: true, - icon: library_layout, - children: (0,external_wp_i18n_namespaceObject.__)('Templates') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - uid: "patterns-navigation-item", - params: { - postType: PATTERN_TYPES.user - }, - withChevron: true, - icon: library_symbol, - children: (0,external_wp_i18n_namespaceObject.__)('Patterns') - })] - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js -// This requested is preloaded in `gutenberg_preload_navigation_posts`. -// As unbounded queries are limited to 100 by `fetchAllMiddleware` -// on apiFetch this query is limited to 100. -// These parameters must be kept aligned with those in -// lib/compat/wordpress-6.3/navigation-block-preloading.php -// and -// block-library/src/navigation/constants.js -const PRELOADED_NAVIGATION_MENUS_QUERY = { - per_page: 100, - status: ['publish', 'draft'], - order: 'desc', - orderby: 'date' -}; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js -/** - * WordPress dependencies - */ - - - - - -const notEmptyString = testString => testString?.trim()?.length > 0; -function rename_modal_RenameModal({ - menuTitle, - onClose, - onSave -}) { - const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_namespaceObject.useState)(menuTitle); - const titleHasChanged = editedMenuTitle !== menuTitle; - const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: (0,external_wp_i18n_namespaceObject.__)('Rename'), - onRequestClose: onClose, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { - className: "sidebar-navigation__rename-modal-form", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { - spacing: "3", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { - __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, - value: editedMenuTitle, - placeholder: (0,external_wp_i18n_namespaceObject.__)('Navigation title'), - onChange: setEditedMenuTitle - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { - justify: "right", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - variant: "tertiary", - onClick: onClose, - children: (0,external_wp_i18n_namespaceObject.__)('Cancel') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { - __next40pxDefaultSize: true, - __experimentalIsFocusable: true, - disabled: !isEditedMenuTitleValid, - variant: "primary", - type: "submit", - onClick: e => { - e.preventDefault(); - if (!isEditedMenuTitleValid) { - return; - } - onSave({ - title: editedMenuTitle - }); - - // Immediate close avoids ability to hit save multiple times. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Save') - })] - })] - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js -/** - * WordPress dependencies - */ - - - -function DeleteConfirmDialog({ - onClose, - onConfirm -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { - isOpen: true, - onConfirm: () => { - onConfirm(); - - // Immediate close avoids ability to hit delete multiple times. - onClose(); - }, - onCancel: onClose, - confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), - size: "medium", - children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - - -const { - useHistory: more_menu_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const POPOVER_PROPS = { - position: 'bottom right' -}; -function ScreenNavigationMoreMenu(props) { - const { - onDelete, - onSave, - onDuplicate, - menuTitle, - menuId - } = props; - const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); - const history = more_menu_useHistory(); - const closeModals = () => { - setRenameModalOpen(false); - setDeleteConfirmDialogOpen(false); - }; - const openRenameModal = () => setRenameModalOpen(true); - const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { - className: "sidebar-navigation__more-menu", - label: (0,external_wp_i18n_namespaceObject.__)('Actions'), - icon: more_vertical, - popoverProps: POPOVER_PROPS, - children: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - openRenameModal(); - // Close the dropdown after opening the modal. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Rename') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - history.push({ - postId: menuId, - postType: 'wp_navigation', - canvas: 'edit' - }); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Edit') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - onDuplicate(); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Duplicate') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - isDestructive: true, - onClick: () => { - openDeleteConfirmDialog(); - - // Close the dropdown after opening the modal. - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Delete') - })] - }) - }) - }), deleteConfirmDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DeleteConfirmDialog, { - onClose: closeModals, - onConfirm: onDelete - }), renameModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rename_modal_RenameModal, { - onClose: closeModals, - menuTitle: menuTitle, - onSave: onSave - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js -/** - * WordPress dependencies - */ - - -const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" - }) -}); -/* harmony default export */ const chevron_up = (chevronUp); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js -/** - * WordPress dependencies - */ - - -const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" - }) -}); -/* harmony default export */ const chevron_down = (chevronDown); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js -/** - * WordPress dependencies - */ - - - - - - - - -const leaf_more_menu_POPOVER_PROPS = { - className: 'block-editor-block-settings-menu__popover', - placement: 'bottom-start' -}; - -/** - * Internal dependencies - */ - - - - -const { - useHistory: leaf_more_menu_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function LeafMoreMenu(props) { - const history = leaf_more_menu_useHistory(); - const { - block - } = props; - const { - clientId - } = block; - const { - moveBlocksDown, - moveBlocksUp, - removeBlocks - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ - clientId, - maximumLength: 25 - })); - const goToLabel = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */ - (0,external_wp_i18n_namespaceObject.__)('Go to %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ - clientId, - maximumLength: 25 - })); - const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getBlockRootClientId - } = select(external_wp_blockEditor_namespaceObject.store); - return getBlockRootClientId(clientId); - }, [clientId]); - const onGoToPage = (0,external_wp_element_namespaceObject.useCallback)(selectedBlock => { - const { - attributes, - name - } = selectedBlock; - if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) { - const { - params - } = history.getLocationWithParams(); - history.push({ - postType: attributes.type, - postId: attributes.id, - canvas: 'edit' - }, { - backPath: params - }); - } - if (name === 'core/page-list-item' && attributes.id && history) { - const { - params - } = history.getLocationWithParams(); - history.push({ - postType: 'page', - postId: attributes.id, - canvas: 'edit' - }, { - backPath: params - }); - } - }, [history]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { - icon: more_vertical, - label: (0,external_wp_i18n_namespaceObject.__)('Options'), - className: "block-editor-block-settings-menu", - popoverProps: leaf_more_menu_POPOVER_PROPS, - noIcons: true, - ...props, - children: ({ - onClose - }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: chevron_up, - onClick: () => { - moveBlocksUp([clientId], rootClientId); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Move up') - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - icon: chevron_down, - onClick: () => { - moveBlocksDown([clientId], rootClientId); - onClose(); - }, - children: (0,external_wp_i18n_namespaceObject.__)('Move down') - }), block.attributes?.type === 'page' && block.attributes?.id && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - onGoToPage(block); - onClose(); - }, - children: goToLabel - })] - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { - onClick: () => { - removeBlocks([clientId], false); - onClose(); - }, - children: removeLabel - }) - })] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - - - -const { - PrivateListView -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); - -// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js. -const MAX_PAGE_COUNT = 100; -const PAGES_QUERY = ['postType', 'page', { - per_page: MAX_PAGE_COUNT, - _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], - // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby - // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent - // sort. - orderby: 'menu_order', - order: 'asc' -}]; -function NavigationMenuContent({ - rootClientId -}) { - const { - listViewRootClientId, - isLoading - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - areInnerBlocksControlled, - getBlockName, - getBlockCount, - getBlockOrder - } = select(external_wp_blockEditor_namespaceObject.store); - const { - isResolving - } = select(external_wp_coreData_namespaceObject.store); - const blockClientIds = getBlockOrder(rootClientId); - const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === 'core/page-list'; - const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0; - const isLoadingPages = isResolving('getEntityRecords', PAGES_QUERY); - return { - listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId, - // This is a small hack to wait for the navigation block - // to actually load its inner blocks. - isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages - }; - }, [rootClientId]); - const { - replaceBlock, - __unstableMarkNextChangeAsNotPersistent - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); - const offCanvasOnselect = (0,external_wp_element_namespaceObject.useCallback)(block => { - if (block.name === 'core/navigation-link' && !block.attributes.url) { - __unstableMarkNextChangeAsNotPersistent(); - replaceBlock(block.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', block.attributes)); - } - }, [__unstableMarkNextChangeAsNotPersistent, replaceBlock]); - - // The hidden block is needed because it makes block edit side effects trigger. - // For example a navigation page list load its items has an effect on edit to load its items. - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { - rootClientId: listViewRootClientId, - onSelect: offCanvasOnselect, - blockSettingsMenu: LeafMoreMenu, - showAppender: false - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, {}) - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - - -const navigation_menu_editor_noop = () => {}; -function NavigationMenuEditor({ - navigationMenuId -}) { - const { - storedSettings - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getSettings - } = lock_unlock_unlock(select(store)); - return { - storedSettings: getSettings() - }; - }, []); - const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { - if (!navigationMenuId) { - return []; - } - return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', { - ref: navigationMenuId - })]; - }, [navigationMenuId]); - if (!navigationMenuId || !blocks?.length) { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { - settings: storedSettings, - value: blocks, - onChange: navigation_menu_editor_noop, - onInput: navigation_menu_editor_noop, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-navigation-menus__content", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuContent, { - rootClientId: blocks[0].clientId - }) - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js -/** - * WordPress dependencies - */ - - - -// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. -function buildNavigationLabel(title, id, status) { - if (!title?.rendered) { - /* translators: %s is the index of the menu in the list of menus. */ - return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); - } - if (status === 'publish') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered); - } - return (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.). - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered), status); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - - -function SingleNavigationMenu({ - navigationMenu, - backPath, - handleDelete, - handleDuplicate, - handleSave -}) { - const menuTitle = navigationMenu?.title?.rendered; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { - menuId: navigationMenu?.id, - menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), - onDelete: handleDelete, - onSave: handleSave, - onDuplicate: handleDuplicate - }) - }), - backPath: backPath, - title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuEditor, { - navigationMenuId: navigationMenu?.id - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - -const { - useLocation: sidebar_navigation_screen_navigation_menu_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const postType = `wp_navigation`; -function SidebarNavigationScreenNavigationMenu({ - backPath -}) { - const { - params: { - postId - } - } = sidebar_navigation_screen_navigation_menu_useLocation(); - const { - record: navigationMenu, - isResolving - } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId); - const { - isSaving, - isDeleting - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - isSavingEntityRecord, - isDeletingEntityRecord - } = select(external_wp_coreData_namespaceObject.store); - return { - isSaving: isSavingEntityRecord('postType', postType, postId), - isDeleting: isDeletingEntityRecord('postType', postType, postId) - }; - }, [postId]); - const isLoading = isResolving || isSaving || isDeleting; - const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; - const { - handleSave, - handleDelete, - handleDuplicate - } = useNavigationMenuHandlers(); - const _handleDelete = () => handleDelete(navigationMenu); - const _handleSave = edits => handleSave(navigationMenu, edits); - const _handleDuplicate = () => handleDuplicate(navigationMenu); - if (isLoading) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'), - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { - className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" - }) - }); - } - if (!isLoading && !navigationMenu) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menu missing.'), - backPath: backPath - }); - } - if (!navigationMenu?.content?.raw) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenNavigationMoreMenu, { - menuId: navigationMenu?.id, - menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), - onDelete: _handleDelete, - onSave: _handleSave, - onDuplicate: _handleDuplicate - }), - backPath: backPath, - title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), - description: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { - navigationMenu: navigationMenu, - backPath: backPath, - handleDelete: _handleDelete, - handleSave: _handleSave, - handleDuplicate: _handleDuplicate - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js -/** - * WordPress dependencies - */ - - - - - - -/** - * Internal dependencies - */ - - - -const { - useHistory: use_navigation_menu_handlers_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useDeleteNavigationMenu() { - const { - deleteEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const history = use_navigation_menu_handlers_useHistory(); - const handleDelete = async navigationMenu => { - const postId = navigationMenu?.id; - try { - await deleteEntityRecord('postType', postType, postId, { - force: true - }, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.'), { - type: 'snackbar' - }); - history.push({ - postType: 'wp_navigation' - }); - } catch (error) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to delete Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleDelete; -} -function useSaveNavigationMenu() { - const { - getEditedEntityRecord - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getEditedEntityRecord: getEditedEntityRecordSelector - } = select(external_wp_coreData_namespaceObject.store); - return { - getEditedEntityRecord: getEditedEntityRecordSelector - }; - }, []); - const { - editEntityRecord, - __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const handleSave = async (navigationMenu, edits) => { - if (!edits) { - return; - } - const postId = navigationMenu?.id; - // Prepare for revert in case of error. - const originalRecord = getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, postId); - - // Apply the edits. - editEntityRecord('postType', postType, postId, edits); - const recordPropertiesToSave = Object.keys(edits); - - // Attempt to persist. - try { - await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, { - throwOnError: true - }); - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Renamed Navigation Menu'), { - type: 'snackbar' - }); - } catch (error) { - // Revert to original in case of error. - editEntityRecord('postType', postType, postId, originalRecord); - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be renamed. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to rename Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleSave; -} -function useDuplicateNavigationMenu() { - const history = use_navigation_menu_handlers_useHistory(); - const { - saveEntityRecord - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); - const { - createSuccessNotice, - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - const handleDuplicate = async navigationMenu => { - const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; - try { - const savedRecord = await saveEntityRecord('postType', postType, { - title: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Navigation menu title */ - (0,external_wp_i18n_namespaceObject.__)('%s (Copy)'), menuTitle), - content: navigationMenu?.content?.raw, - status: 'publish' - }, { - throwOnError: true - }); - if (savedRecord) { - createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Duplicated Navigation Menu'), { - type: 'snackbar' - }); - history.push({ - postType: postType, - postId: savedRecord.id - }); - } - } catch (error) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ - (0,external_wp_i18n_namespaceObject.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message), { - type: 'snackbar' - }); - } - }; - return handleDuplicate; -} -function useNavigationMenuHandlers() { - return { - handleDelete: useDeleteNavigationMenu(), - handleSave: useSaveNavigationMenu(), - handleDuplicate: useDuplicateNavigationMenu() - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js -/** - * WordPress dependencies - */ - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js. - -function buildMenuLabel(title, id, status) { - if (!title) { - /* translators: %s is the index of the menu in the list of menus. */ - return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); - } - if (status === 'publish') { - return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); - } - return (0,external_wp_i18n_namespaceObject.sprintf)( - // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.). - (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); -} - -// Save a boolean to prevent us creating a fallback more than once per session. -let hasCreatedFallback = false; -function SidebarNavigationScreenNavigationMenus({ - backPath -}) { - const { - records: navigationMenus, - isResolving: isResolvingNavigationMenus, - hasResolved: hasResolvedNavigationMenus - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY); - const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus; - const { - getNavigationFallbackId - } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); - const firstNavigationMenu = navigationMenus?.[0]; - - // Save a boolean to prevent us creating a fallback more than once per session. - if (firstNavigationMenu) { - hasCreatedFallback = true; - } - - // If there is no navigation menu found - // then trigger fallback algorithm to create one. - if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && !hasCreatedFallback) { - getNavigationFallbackId(); - } - const { - handleSave, - handleDelete, - handleDuplicate - } = useNavigationMenuHandlers(); - const hasNavigationMenus = !!navigationMenus?.length; - if (isLoading) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { - className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" - }) - }); - } - if (!isLoading && !hasNavigationMenus) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - description: (0,external_wp_i18n_namespaceObject.__)('No Navigation Menus found.'), - backPath: backPath - }); - } - - // if single menu then render it - if (navigationMenus?.length === 1) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleNavigationMenu, { - navigationMenu: firstNavigationMenu, - backPath: backPath, - handleDelete: () => handleDelete(firstNavigationMenu), - handleDuplicate: () => handleDuplicate(firstNavigationMenu), - handleSave: edits => handleSave(firstNavigationMenu, edits) - }); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenWrapper, { - backPath: backPath, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: navigationMenus?.map(({ - id, - title, - status - }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavMenuItem, { - postId: id, - withChevron: true, - icon: library_navigation, - children: buildMenuLabel(title?.rendered, index + 1, status) - }, id)) - }) - }); -} -function SidebarNavigationScreenWrapper({ - children, - actions, - title, - description, - backPath -}) { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: title || (0,external_wp_i18n_namespaceObject.__)('Navigation'), - actions: actions, - description: description || (0,external_wp_i18n_namespaceObject.__)('Manage your Navigation Menus.'), - backPath: backPath, - content: children - }); -} -const NavMenuItem = ({ - postId, - ...props -}) => { - const linkInfo = useLink({ - postId, - postType: 'wp_navigation' - }); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...linkInfo, - ...props - }); -}; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/dataview-item.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - + + + +/** + * Internal dependencies + */ const { useLocation: dataview_item_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); function DataViewItem({ title, slug, @@ -39130,22 +40624,18 @@ suffix }) { const { - params: { - postType, - layout - } + path } = dataview_item_useLocation(); const iconToUse = icon || VIEW_LAYOUTS.find(v => v.type === type).icon; let activeView = isCustom ? customViewId : slug; if (activeView === 'all') { activeView = undefined; } - const linkInfo = useLink({ - postType, - layout, + const query = { + layout: type, activeView, isCustom: isCustom ? 'true' : undefined - }); + }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", className: dist_clsx('edit-site-sidebar-dataviews-dataview-item', { @@ -39153,371 +40643,53 @@ }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { icon: iconToUse, - ...linkInfo, + to: (0,external_wp_url_namespaceObject.addQueryArgs)(path, query), "aria-current": isActive ? 'true' : undefined, children: title }), suffix] }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - - - - - - -const content_EMPTY_ARRAY = []; -function TemplateDataviewItem({ - template, - isActive -}) { - const { - text, - icon - } = useAddedBy(template.type, template.id); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { - slug: text, - title: text, - icon: icon, - isActive: isActive, - isCustom: false - }, text); -} -function DataviewsTemplatesSidebarContent({ - activeView, - title -}) { - const { - records - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_POST_TYPE, { - per_page: -1 - }); - const firstItemPerAuthorText = (0,external_wp_element_namespaceObject.useMemo)(() => { - var _ref; - const firstItemPerAuthor = records?.reduce((acc, template) => { - const author = template.author_text; - if (author && !acc[author]) { - acc[author] = template; - } - return acc; - }, {}); - return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : content_EMPTY_ARRAY; - }, [records]); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { - slug: "all", - title: title, - icon: library_layout, - isActive: activeView === 'all', - isCustom: false - }), firstItemPerAuthorText.map(template => { - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateDataviewItem, { - template: template, - isActive: activeView === template.author_text - }, template.author_text); - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -const { - useLocation: sidebar_navigation_screen_templates_browse_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function SidebarNavigationScreenTemplatesBrowse({ - backPath -}) { - const { - params: { - activeView = 'all' - } - } = sidebar_navigation_screen_templates_browse_useLocation(); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Templates'), - description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsTemplatesSidebarContent, { - activeView: activeView, - title: (0,external_wp_i18n_namespaceObject.__)('All templates') - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js -/** - * WordPress dependencies - */ - - -const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" - }) -}); -/* harmony default export */ const library_file = (file); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.js -/** - * Internal dependencies - */ - - - - -function CategoryItem({ - count, - icon, - id, - isActive, - label, - type -}) { - const linkInfo = useLink({ - categoryId: id !== TEMPLATE_PART_ALL_AREAS_CATEGORY && id !== PATTERN_DEFAULT_CATEGORY ? id : undefined, - postType: type === TEMPLATE_PART_POST_TYPE ? TEMPLATE_PART_POST_TYPE : PATTERN_TYPES.user - }); - if (!count) { - return; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationItem, { - ...linkInfo, - icon: icon, - suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { - children: count - }), - "aria-current": isActive ? 'true' : undefined, - children: label - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js -/** - * WordPress dependencies - */ - - - - -/** - * Internal dependencies - */ - -const useTemplatePartsGroupedByArea = items => { - const allItems = items || []; - const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); - - // Create map of template areas ensuring that default areas are displayed before - // any custom registered template part areas. - const knownAreas = { - header: {}, - footer: {}, - sidebar: {}, - uncategorized: {} - }; - templatePartAreas.forEach(templatePartArea => knownAreas[templatePartArea.area] = { - ...templatePartArea, - templateParts: [] - }); - const groupedByArea = allItems.reduce((accumulator, item) => { - const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY; - accumulator[key].templateParts.push(item); - return accumulator; - }, knownAreas); - return groupedByArea; -}; -function useTemplatePartAreas() { - const { - records: templateParts, - isResolving: isLoading - } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', TEMPLATE_PART_POST_TYPE, { - per_page: -1 - }); - return { - hasTemplateParts: templateParts ? !!templateParts.length : false, - isLoading, - templatePartAreas: useTemplatePartsGroupedByArea(templateParts) - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - -const { - useLocation: sidebar_navigation_screen_patterns_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function CategoriesGroup({ - templatePartAreas, - patternCategories, - currentCategory, - currentType -}) { - const [allPatterns, ...otherPatterns] = patternCategories; - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-patterns__group", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: Object.values(templatePartAreas).map(({ - templateParts - }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0), - icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)() /* no name, so it provides the fallback icon */, - label: (0,external_wp_i18n_namespaceObject.__)('All template parts'), - id: TEMPLATE_PART_ALL_AREAS_CATEGORY, - type: TEMPLATE_PART_POST_TYPE, - isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE - }, "all"), Object.entries(templatePartAreas).map(([area, { - label, - templateParts - }]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: templateParts?.length, - icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area), - label: label, - id: area, - type: TEMPLATE_PART_POST_TYPE, - isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE - }, area)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-sidebar-navigation-screen-patterns__divider" - }), allPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: allPatterns.count, - label: allPatterns.label, - icon: library_file, - id: allPatterns.name, - type: PATTERN_TYPES.user, - isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user - }, allPatterns.name), otherPatterns.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoryItem, { - count: category.count, - label: category.label, - icon: library_file, - id: category.name, - type: PATTERN_TYPES.user, - isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user - }, category.name))] - }); -} -function SidebarNavigationScreenPatterns({ - backPath -}) { - const { - params: { - postType, - categoryId - } - } = sidebar_navigation_screen_patterns_useLocation(); - const currentType = postType || PATTERN_TYPES.user; - const currentCategory = categoryId || (currentType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY); - const { - templatePartAreas, - hasTemplateParts, - isLoading - } = useTemplatePartAreas(); - const { - patternCategories, - hasPatterns - } = usePatternCategories(); - const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - isRoot: !isBlockBasedTheme, - title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), - description: (0,external_wp_i18n_namespaceObject.__)('Manage what patterns are available when editing the site.'), - backPath: backPath, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading items…'), !isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [!hasTemplateParts && !hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - className: "edit-site-sidebar-navigation-screen-patterns__group", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { - children: (0,external_wp_i18n_namespaceObject.__)('No items found') - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CategoriesGroup, { - templatePartAreas: templatePartAreas, - patternCategories: patternCategories, - currentCategory: currentCategory, - currentType: currentType - })] - })] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/add-new-view.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - -const { +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/add-new-view.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useLocation: add_new_view_useLocation, useHistory: add_new_view_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); function AddNewItemModalContent({ type, setIsAdding }) { const history = add_new_view_useHistory(); const { + path + } = add_new_view_useLocation(); + const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const [isSaving, setIsSaving] = (0,external_wp_element_namespaceObject.useState)(false); + const defaultViews = useDefaultViews({ + postType: type + }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: async event => { event.preventDefault(); @@ -39543,24 +40715,19 @@ title, status: 'publish', wp_dataviews_type: dataViewTaxonomyId, - content: JSON.stringify(DEFAULT_VIEWS[type][0].view) - }); - const { - params: { - postType - } - } = history.getLocationWithParams(); - history.push({ - postType, + content: JSON.stringify(defaultViews[0].view) + }); + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { activeView: savedRecord.id, isCustom: 'true' - }); + })); setIsSaving(false); setIsAdding(false); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, @@ -39570,12 +40737,14 @@ }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { setIsAdding(false); }, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, variant: "primary", type: "submit", "aria-disabled": !title || isSaving, @@ -39611,30 +40780,29 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/custom-dataviews-list.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ - - - - - - -const { - useHistory: custom_dataviews_list_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/custom-dataviews-list.js +/** + * WordPress dependencies + */ + + + + + + + + +/** + * Internal dependencies + */ + + + + +const { + useHistory: custom_dataviews_list_useHistory, + useLocation: custom_dataviews_list_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); const custom_dataviews_list_EMPTY_ARRAY = []; function RenameItemModalContent({ dataviewId, @@ -39656,6 +40824,7 @@ children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, @@ -39666,6 +40835,7 @@ justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", + __next40pxDefaultSize: true, onClick: () => { setIsRenaming(false); }, @@ -39674,7 +40844,8 @@ variant: "primary", type: "submit", "aria-disabled": !title, - children: (0,external_wp_i18n_namespaceObject.__)('Rename') + __next40pxDefaultSize: true, + children: (0,external_wp_i18n_namespaceObject.__)('Save') })] })] }) @@ -39685,6 +40856,7 @@ isActive }) { const history = custom_dataviews_list_useHistory(); + const location = custom_dataviews_list_useLocation(); const { dataview } = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -39735,13 +40907,8 @@ force: true }); if (isActive) { - const { - params: { - postType - } - } = history.getLocationWithParams(); history.replace({ - postType + postType: location.query.postType }); } onClose(); @@ -39752,10 +40919,12 @@ }) }) }), isRenaming && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { - title: (0,external_wp_i18n_namespaceObject.__)('Rename view'), + title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: () => { setIsRenaming(false); }, + focusOnMount: "firstContentElement", + size: "small", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenameItemModalContent, { dataviewId: dataviewId, setIsRenaming: setIsRenaming, @@ -39801,6 +40970,7 @@ children: (0,external_wp_i18n_namespaceObject.__)('Custom Views') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalItemGroup, { + className: "edit-site-sidebar-navigation-screen-dataviews__custom-items", children: [customDataViews.map(customViewRecord => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomDataViewItem, { dataviewId: customViewRecord.id, @@ -39813,41 +40983,44 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/index.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ +;// ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + const { useLocation: sidebar_dataviews_useLocation -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); - - - - - -function DataViewsSidebarContent() { - const { - params: { - postType, +} = unlock(external_wp_router_namespaceObject.privateApis); +function DataViewsSidebarContent({ + postType +}) { + const { + query: { activeView = 'all', isCustom = 'false' } } = sidebar_dataviews_useLocation(); + const defaultViews = useDefaultViews({ + postType + }); if (!postType) { return null; } const isCustomBoolean = isCustom === 'true'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { - children: DEFAULT_VIEWS[postType].map(dataview => { + className: "edit-site-sidebar-dataviews", + children: defaultViews.map(dataview => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewItem, { slug: dataview.slug, title: dataview.title, @@ -39865,247 +41038,994 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/router.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - - -const { - useLocation: router_useLocation, - useHistory: router_useHistory -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -function useRedirectOldPaths() { - const history = router_useHistory(); - const { - params - } = router_useLocation(); - (0,external_wp_element_namespaceObject.useEffect)(() => { - const { - postType, - path, - categoryType, - ...rest - } = params; - if (path === '/wp_template_part/all') { - history.replace({ - postType: TEMPLATE_PART_POST_TYPE - }); - } - if (path === '/page') { - history.replace({ - postType: 'page', - ...rest - }); - } - if (path === '/wp_template') { - history.replace({ - postType: TEMPLATE_POST_TYPE, - ...rest - }); - } - if (path === '/patterns') { - history.replace({ - postType: categoryType === TEMPLATE_PART_POST_TYPE ? TEMPLATE_PART_POST_TYPE : PATTERN_TYPES.user, - ...rest - }); - } - if (path === '/navigation') { - history.replace({ - postType: NAVIGATION_POST_TYPE, - ...rest - }); - } - }, [history, params]); -} -function useLayoutAreas() { - const isSiteEditorLoading = useIsSiteEditorLoading(); - const { - params - } = router_useLocation(); - const { +;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js +/** + * WordPress dependencies + */ + + +const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { + width: "24", + height: "24", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" + }) +}); +/* harmony default export */ const drawer_right = (drawerRight); + +;// ./node_modules/@wordpress/edit-site/build-module/components/add-new-post/index.js +/** + * WordPress dependencies + */ + + + + + + + + + +function AddNewPostModal({ + postType, + onSave, + onClose +}) { + const labels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.labels, [postType]); + const [isCreatingPost, setIsCreatingPost] = (0,external_wp_element_namespaceObject.useState)(false); + const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); + const { + saveEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + createErrorNotice, + createSuccessNotice + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); + const { + resolveSelect + } = (0,external_wp_data_namespaceObject.useRegistry)(); + async function createPost(event) { + event.preventDefault(); + if (isCreatingPost) { + return; + } + setIsCreatingPost(true); + try { + const postTypeObject = await resolveSelect(external_wp_coreData_namespaceObject.store).getPostType(postType); + const newPage = await saveEntityRecord('postType', postType, { + status: 'draft', + title, + slug: title !== null && title !== void 0 ? title : undefined, + content: !!postTypeObject.template && postTypeObject.template.length ? (0,external_wp_blocks_namespaceObject.serialize)((0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)([], postTypeObject.template)) : undefined + }, { + throwOnError: true + }); + onSave(newPage); + createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Title of the created post or template, e.g: "Hello world". + (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(newPage.title?.rendered || title)), { + type: 'snackbar' + }); + } catch (error) { + const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the item.'); + createErrorNotice(errorMessage, { + type: 'snackbar' + }); + } finally { + setIsCreatingPost(false); + } + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { + title: + // translators: %s: post type singular_name label e.g: "Page". + (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Draft new: %s'), labels?.singular_name), + onRequestClose: onClose, + focusOnMount: "firstContentElement", + size: "small", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { + onSubmit: createPost, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 4, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + label: (0,external_wp_i18n_namespaceObject.__)('Title'), + onChange: setTitle, + placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), + value: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + spacing: 2, + justify: "end", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "tertiary", + onClick: onClose, + children: (0,external_wp_i18n_namespaceObject.__)('Cancel') + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + __next40pxDefaultSize: true, + variant: "primary", + type: "submit", + isBusy: isCreatingPost, + "aria-disabled": isCreatingPost, + children: (0,external_wp_i18n_namespaceObject.__)('Create draft') + })] + })] + }) + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/post-list/index.js +/** + * WordPress dependencies + */ + + + + + + + + + + + + +/** + * Internal dependencies + */ + + + + + + + +const { + usePostActions: post_list_usePostActions, + usePostFields +} = unlock(external_wp_editor_namespaceObject.privateApis); +const { + useLocation: post_list_useLocation, + useHistory: post_list_useHistory +} = unlock(external_wp_router_namespaceObject.privateApis); +const { + useEntityRecordsWithPermissions: post_list_useEntityRecordsWithPermissions +} = unlock(external_wp_coreData_namespaceObject.privateApis); +const post_list_EMPTY_ARRAY = []; +const getDefaultView = (defaultViews, activeView) => { + return defaultViews.find(({ + slug + }) => slug === activeView)?.view; +}; +const getCustomView = editedEntityRecord => { + if (!editedEntityRecord?.content) { + return undefined; + } + const content = JSON.parse(editedEntityRecord.content); + if (!content) { + return undefined; + } + return { + ...content, + ...default_views_defaultLayouts[content.type] + }; +}; + +/** + * This function abstracts working with default & custom views by + * providing a [ state, setState ] tuple based on the URL parameters. + * + * Consumers use the provided tuple to work with state + * and don't have to deal with the specifics of default & custom views. + * + * @param {string} postType Post type to retrieve default views for. + * @return {Array} The [ state, setState ] tuple. + */ +function useView(postType) { + const { + path, + query: { + activeView = 'all', + isCustom = 'false', + layout + } + } = post_list_useLocation(); + const history = post_list_useHistory(); + const defaultViews = useDefaultViews({ + postType + }); + const { + editEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const editedEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { + if (isCustom !== 'true') { + return undefined; + } + const { + getEditedEntityRecord + } = select(external_wp_coreData_namespaceObject.store); + return getEditedEntityRecord('postType', 'wp_dataviews', Number(activeView)); + }, [activeView, isCustom]); + const [view, setView] = (0,external_wp_element_namespaceObject.useState)(() => { + let initialView; + if (isCustom === 'true') { + var _getCustomView; + initialView = (_getCustomView = getCustomView(editedEntityRecord)) !== null && _getCustomView !== void 0 ? _getCustomView : { + type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST + }; + } else { + var _getDefaultView; + initialView = (_getDefaultView = getDefaultView(defaultViews, activeView)) !== null && _getDefaultView !== void 0 ? _getDefaultView : { + type: layout !== null && layout !== void 0 ? layout : LAYOUT_LIST + }; + } + const type = layout !== null && layout !== void 0 ? layout : initialView.type; + return { + ...initialView, + type, + ...default_views_defaultLayouts[type] + }; + }); + const setViewWithUrlUpdate = (0,external_wp_compose_namespaceObject.useEvent)(newView => { + setView(newView); + if (isCustom === 'true' && editedEntityRecord?.id) { + editEntityRecord('postType', 'wp_dataviews', editedEntityRecord?.id, { + content: JSON.stringify(newView) + }); + } + const currentUrlLayout = layout !== null && layout !== void 0 ? layout : LAYOUT_LIST; + if (newView.type !== currentUrlLayout) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(path, { + layout: newView.type + })); + } + }); + + // When layout URL param changes, update the view type + // without affecting any other config. + const onUrlLayoutChange = (0,external_wp_compose_namespaceObject.useEvent)(() => { + setView(prevView => { + const newType = layout !== null && layout !== void 0 ? layout : LAYOUT_LIST; + if (newType === prevView.type) { + return prevView; + } + return { + ...prevView, + type: newType, + ...default_views_defaultLayouts[newType] + }; + }); + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + onUrlLayoutChange(); + }, [onUrlLayoutChange, layout]); + + // When activeView or isCustom URL parameters change, reset the view. + const onUrlActiveViewChange = (0,external_wp_compose_namespaceObject.useEvent)(() => { + let newView; + if (isCustom === 'true') { + newView = getCustomView(editedEntityRecord); + } else { + newView = getDefaultView(defaultViews, activeView); + } + if (newView) { + const type = layout !== null && layout !== void 0 ? layout : newView.type; + setView({ + ...newView, + type, + ...default_views_defaultLayouts[type] + }); + } + }); + (0,external_wp_element_namespaceObject.useEffect)(() => { + onUrlActiveViewChange(); + }, [onUrlActiveViewChange, activeView, isCustom, defaultViews, editedEntityRecord]); + return [view, setViewWithUrlUpdate]; +} +const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'. + +function getItemId(item) { + return item.id.toString(); +} +function getItemLevel(item) { + return item.level; +} +function PostList({ + postType +}) { + var _postId$split, _data$map, _usePrevious; + const [view, setView] = useView(postType); + const defaultViews = useDefaultViews({ + postType + }); + const history = post_list_useHistory(); + const location = post_list_useLocation(); + const { + postId, + quickEdit = false, + isCustom, + activeView = 'all' + } = location.query; + const [selection, setSelection] = (0,external_wp_element_namespaceObject.useState)((_postId$split = postId?.split(',')) !== null && _postId$split !== void 0 ? _postId$split : []); + const onChangeSelection = (0,external_wp_element_namespaceObject.useCallback)(items => { + var _location$query$isCus; + setSelection(items); + if (((_location$query$isCus = location.query.isCustom) !== null && _location$query$isCus !== void 0 ? _location$query$isCus : 'false') === 'false') { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + postId: items.join(',') + })); + } + }, [location.path, location.query.isCustom, history]); + const getActiveViewFilters = (views, match) => { + var _found$filters; + const found = views.find(({ + slug + }) => slug === match); + return (_found$filters = found?.filters) !== null && _found$filters !== void 0 ? _found$filters : []; + }; + const { + isLoading: isLoadingFields, + fields: _fields + } = usePostFields({ + postType + }); + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => { + const activeViewFilters = getActiveViewFilters(defaultViews, activeView).map(({ + field + }) => field); + return _fields.map(field => ({ + ...field, + elements: activeViewFilters.includes(field.id) ? [] : field.elements + })); + }, [_fields, defaultViews, activeView]); + const queryArgs = (0,external_wp_element_namespaceObject.useMemo)(() => { + const filters = {}; + view.filters?.forEach(filter => { + if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { + filters.status = filter.value; + } + if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { + filters.author = filter.value; + } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { + filters.author_exclude = filter.value; + } + }); + + // The bundled views want data filtered without displaying the filter. + const activeViewFilters = getActiveViewFilters(defaultViews, activeView); + activeViewFilters.forEach(filter => { + if (filter.field === 'status' && filter.operator === OPERATOR_IS_ANY) { + filters.status = filter.value; + } + if (filter.field === 'author' && filter.operator === OPERATOR_IS_ANY) { + filters.author = filter.value; + } else if (filter.field === 'author' && filter.operator === OPERATOR_IS_NONE) { + filters.author_exclude = filter.value; + } + }); + + // We want to provide a different default item for the status filter + // than the REST API provides. + if (!filters.status || filters.status === '') { + filters.status = DEFAULT_STATUSES; + } + return { + per_page: view.perPage, + page: view.page, + _embed: 'author', + order: view.sort?.direction, + orderby: view.sort?.field, + orderby_hierarchy: !!view.showLevels, + search: view.search, + ...filters + }; + }, [view, activeView, defaultViews]); + const { + records, + isResolving: isLoadingData, + totalItems, + totalPages + } = post_list_useEntityRecordsWithPermissions('postType', postType, queryArgs); + + // The REST API sort the authors by ID, but we want to sort them by name. + const data = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (!isLoadingFields && view?.sort?.field === 'author') { + return filterSortAndPaginate(records, { + sort: { + ...view.sort + } + }, fields).data; + } + return records; + }, [records, fields, isLoadingFields, view?.sort]); + const ids = (_data$map = data?.map(record => getItemId(record))) !== null && _data$map !== void 0 ? _data$map : []; + const prevIds = (_usePrevious = (0,external_wp_compose_namespaceObject.usePrevious)(ids)) !== null && _usePrevious !== void 0 ? _usePrevious : []; + const deletedIds = prevIds.filter(id => !ids.includes(id)); + const postIdWasDeleted = deletedIds.includes(postId); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (postIdWasDeleted) { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + postId: undefined + })); + } + }, [history, postIdWasDeleted, location.path]); + const paginationInfo = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + totalItems, + totalPages + }), [totalItems, totalPages]); + const { + labels, + canCreateRecord + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + const { + getPostType, + canUser + } = select(external_wp_coreData_namespaceObject.store); + return { + labels: getPostType(postType)?.labels, + canCreateRecord: canUser('create', { + kind: 'postType', + name: postType + }) + }; + }, [postType]); + const postTypeActions = post_list_usePostActions({ postType, - postId, - path, - layout, - isCustom, - canvas - } = params; - const hasEditCanvasMode = canvas === 'edit'; - useRedirectOldPaths(); - - // Page list - if (postType === 'page') { - const isListLayout = layout === 'list' || !layout; - return { - key: 'pages', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { - title: (0,external_wp_i18n_namespaceObject.__)('Pages'), - backPath: {}, - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, {}) - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PagePages, {}), - preview: (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PagePages, {}) + context: 'list' + }); + const editAction = useEditPostAction(); + const actions = (0,external_wp_element_namespaceObject.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]); + const [showAddPostModal, setShowAddPostModal] = (0,external_wp_element_namespaceObject.useState)(false); + const openModal = () => setShowAddPostModal(true); + const closeModal = () => setShowAddPostModal(false); + const handleNewPage = ({ + type, + id + }) => { + history.navigate(`/${type}/${id}?canvas=edit`); + closeModal(); + }; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Page, { + title: labels?.name, + actions: labels?.add_new_item && canCreateRecord && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + variant: "primary", + onClick: openModal, + __next40pxDefaultSize: true, + children: labels.add_new_item + }), showAddPostModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddNewPostModal, { + postType: postType, + onSave: handleNewPage, + onClose: closeModal + })] + }), + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViews, { + paginationInfo: paginationInfo, + fields: fields, + actions: actions, + data: data || post_list_EMPTY_ARRAY, + isLoading: isLoadingData || isLoadingFields, + view: view, + onChangeView: setView, + selection: selection, + onChangeSelection: onChangeSelection, + isItemClickable: item => item.status !== 'trash', + onClickItem: ({ + id + }) => { + history.navigate(`/${postType}/${id}?canvas=edit`); }, - widths: { - content: isListLayout ? 380 : undefined - } - }; - } - - // Templates - if (postType === TEMPLATE_POST_TYPE) { - const isListLayout = isCustom !== 'true' && layout === 'list'; - return { - key: 'templates', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenTemplatesBrowse, { - backPath: {} - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}), - preview: (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageTemplates, {}) - }, - widths: { - content: isListLayout ? 380 : undefined - } - }; - } - - // Patterns - if ([TEMPLATE_PART_POST_TYPE, PATTERN_TYPES.user].includes(postType)) { - return { - key: 'patterns', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenPatterns, { - backPath: {} - }), - content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), - mobile: hasEditCanvasMode ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataviewsPatterns, {}), - preview: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) - } - }; - } - - // Styles - if (path === '/wp_global_styles') { - return { - key: 'styles', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenGlobalStyles, { - backPath: {} - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading + getItemId: getItemId, + getItemLevel: getItemLevel, + defaultLayouts: default_views_defaultLayouts, + header: window.__experimentalQuickEditDataViews && view.type !== LAYOUT_LIST && postType === 'page' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + size: "compact", + isPressed: quickEdit, + icon: drawer_right, + label: (0,external_wp_i18n_namespaceObject.__)('Details'), + onClick: () => { + history.navigate((0,external_wp_url_namespaceObject.addQueryArgs)(location.path, { + quickEdit: quickEdit ? undefined : true + })); + } + }) + }, activeView + isCustom) + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataform-context/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const DataFormContext = (0,external_wp_element_namespaceObject.createContext)({ + fields: [] +}); +function DataFormProvider({ + fields, + children +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormContext.Provider, { + value: { + fields + }, + children: children + }); +} +/* harmony default export */ const dataform_context = (DataFormContext); + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/is-combined-field.js +/** + * Internal dependencies + */ + +function isCombinedField(field) { + return field.children !== undefined; +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/regular/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +function regular_Header({ + title +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-regular__header", + spacing: 4, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "center", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + size: 13, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {})] + }) + }); +} +function FormRegularField({ + data, + field, + onChange, + hideLabelFromVision +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { + return { + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; }), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) - } - }; - } - - // Navigation - if (postType === NAVIGATION_POST_TYPE) { - if (postId) { + type: 'regular' + }; + } + return { + type: 'regular', + fields: [] + }; + }, [field]); + if (isCombinedField(field)) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [!hideLabelFromVision && field.label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(regular_Header, { + title: field.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange + })] + }); + } + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'top'; + const fieldDefinition = fields.find(fieldDef => fieldDef.id === field.id); + if (!fieldDefinition) { + return null; + } + if (labelPosition === 'side') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + className: "dataforms-layouts-regular__field", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-label", + children: fieldDefinition.label + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: true + }, fieldDefinition.id) + })] + }); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-regular__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.Edit, { + data: data, + field: fieldDefinition, + onChange: onChange, + hideLabelFromVision: labelPosition === 'none' ? true : hideLabelFromVision + }) + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/panel/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + + +function DropdownHeader({ + title, + onClose +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-panel__dropdown-header", + spacing: 4, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + alignment: "center", + children: [title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { + level: 2, + size: 13, + children: title + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}), onClose && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + label: (0,external_wp_i18n_namespaceObject.__)('Close'), + icon: close_small, + onClick: onClose, + size: "small" + })] + }) + }); +} +function PanelDropdown({ + fieldDefinition, + popoverAnchor, + labelPosition = 'side', + data, + onChange, + field +}) { + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + const form = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isCombinedField(field)) { return { - key: 'navigation', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenu, { - backPath: { - postType: NAVIGATION_POST_TYPE - } - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) - } - }; - } - return { - key: 'navigation', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenNavigationMenus, { - backPath: {} - }), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) - } - }; - } - - // Fallback shows the home page preview - return { - key: 'default', - areas: { - sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}), - preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }), - mobile: hasEditCanvasMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { - isLoading: isSiteEditorLoading - }) - } - }; -} - -;// CONCATENATED MODULE: ./node_modules/@react-spring/rafz/dist/esm/index.js -var esm_f=esm_l(),esm_n=e=>esm_c(e,esm_f),esm_m=esm_l();esm_n.write=e=>esm_c(e,esm_m);var esm_d=esm_l();esm_n.onStart=e=>esm_c(e,esm_d);var esm_h=esm_l();esm_n.onFrame=e=>esm_c(e,esm_h);var esm_p=esm_l();esm_n.onFinish=e=>esm_c(e,esm_p);var esm_i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=esm_i.findIndex(z=>z.cancel==o);~F&&esm_i.splice(F,1),esm_u-=~F?1:0},s={time:a,handler:e,cancel:o};return esm_i.splice(esm_w(a),0,s),esm_u+=1,esm_v(),s};var esm_w=e=>~(~esm_i.findIndex(t=>t.time>e)||~esm_i.length);esm_n.cancel=e=>{esm_d.delete(e),esm_h.delete(e),esm_p.delete(e),esm_f.delete(e),esm_m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{esm_d.delete(a),t=null},o};var esm_y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>esm_y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):esm_x()};var esm_r=-1,esm_u=0,T=!1;function esm_c(e,t){T?(t.delete(e),e(0)):(t.add(e),esm_v())}function esm_v(){esm_r<0&&(esm_r=0,esm_n.frameLoop!=="demand"&&esm_y(esm_b))}function esm_R(){esm_r=-1}function esm_b(){~esm_r&&(esm_y(esm_b),esm_n.batchedUpdates(esm_x))}function esm_x(){let e=esm_r;esm_r=esm_n.now();let t=esm_w(esm_r);if(t&&(Q(esm_i.splice(0,t),a=>a.handler()),esm_u-=t),!esm_u){esm_R();return}esm_d.flush(),esm_f.flush(e?Math.min(64,esm_r-e):16.667),esm_h.flush(),esm_m.flush(),esm_p.flush()}function esm_l(){let e=new Set,t=e;return{add(a){esm_u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return esm_u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,esm_u-=t.size,Q(t,o=>o(a)&&e.add(o)),esm_u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var esm_S={count(){return esm_u},isRunning(){return esm_r>=0},clear(){esm_r=-1,esm_i=[],esm_d=esm_l(),esm_f=esm_l(),esm_h=esm_l(),esm_m=esm_l(),esm_p=esm_l(),esm_u=0}}; - -;// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/esm/index.js -var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var dist_esm_p={};Le(dist_esm_p,{assign:()=>U,colors:()=>dist_esm_c,createStringInterpolator:()=>esm_k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>dist_esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),dist_esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(dist_esm_l.arr(e)){if(!dist_esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function xt(e,t,r){if(dist_esm_l.arr(e)){for(let n=0;ndist_esm_l.und(e)?[]:dist_esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),esm_Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),dist_esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var esm_k,J,dist_esm_c=null,ee=!1,dist_esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(dist_esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(esm_k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(dist_esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var esm_E=new Set,dist_esm_u=[],esm_H=[],A=0,qe={get idle(){return!esm_E.size&&!dist_esm_u.length},start(e){A>e.priority?(esm_E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=dist_esm_u.indexOf(e);~t&&(dist_esm_u.splice(t,1),re(e))}},clear(){dist_esm_u=[],esm_E.clear()}};function $e(){esm_E.forEach(te),esm_E.clear(),esm_n(B)}function te(e){dist_esm_u.includes(e)||re(e)}function re(e){dist_esm_u.splice(Ge(dist_esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=esm_H;for(let r=0;r0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var dist_esm_d="[-+]?\\d*\\.?\\d+",esm_M=dist_esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(dist_esm_d,dist_esm_d,dist_esm_d)),fe=new RegExp("rgba"+C(dist_esm_d,dist_esm_d,dist_esm_d,dist_esm_d)),ae=new RegExp("hsl"+C(dist_esm_d,esm_M,esm_M)),ie=new RegExp("hsla"+C(dist_esm_d,esm_M,esm_M,dist_esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,esm_ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:dist_esm_c&&dist_esm_c[e]!==void 0?dist_esm_c[e]:(t=oe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=esm_ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function dist_esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function esm_pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function esm_z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(dist_esm_l.fun(e))return e;if(dist_esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(dist_esm_l.str(e.output[0]))return esm_k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(ar){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var esm_g=Symbol.for("FluidValue.get"),dist_esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[esm_g]),ve=e=>e&&e[esm_g]?e[esm_g]():e,esm_qt=e=>e[dist_esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[dist_esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[esm_g];[dist_esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,esm_g,t);function Gt(e,t){if(e[esm_g]){let r=e[dist_esm_m];r||Ee(e,dist_esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[dist_esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[dist_esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,dist_esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var esm_N=e=>{let[t,r]=We(e);if(!t||dist_esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&dist_esm_b.test(r))return esm_N(r);if(r)return r}return e},We=e=>{let t=dist_esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,esm_Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=dist_esm_c?new RegExp(`(${Object.keys(dist_esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(dist_esm_b,esm_N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,esm_Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return dist_esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!dist_esm_h()&&dist_esm_b.test(e)||e in(dist_esm_c||{}))}var dist_esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){dist_esm_v||typeof ResizeObserver<"u"&&(dist_esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),dist_esm_v&&dist_esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&dist_esm_v&&dist_esm_v.unobserve(t))}}var esm_$=new Set,dist_esm_w,esm_Xe=()=>{let e=()=>{esm_$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>(esm_$.add(e),dist_esm_w||(dist_esm_w=esm_Xe()),()=>{esm_$.delete(e),!esm_$.size&&dist_esm_w&&(dist_esm_w(),dist_esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var esm_Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=esm_Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=dist_esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=ct();return lt(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e}; - -;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/esm/index.js -var animated_dist_esm_h=Symbol.for("Animated:node"),animated_dist_esm_v=e=>!!e&&e[animated_dist_esm_h]===e,dist_esm_k=e=>e&&e[animated_dist_esm_h],esm_D=(e,t)=>mt(e,animated_dist_esm_h,t),F=e=>e&&e[animated_dist_esm_h]&&e[animated_dist_esm_h].getPayload(),animated_dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var animated_dist_esm_l=class extends animated_dist_esm_c{constructor(r){super();this._value=r;dist_esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new animated_dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return dist_esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,dist_esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var animated_dist_esm_d=class extends animated_dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new animated_dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(dist_esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var dist_esm_f={dependencies:null};var animated_dist_esm_u=class extends animated_dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{animated_dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&esm_Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){dist_esm_f.dependencies&&Pt(r)&&dist_esm_f.dependencies.add(r);let n=F(r);n&&esm_Ve(n,a=>this.add(a))}};var animated_dist_esm_y=class extends animated_dist_esm_u{constructor(t){super(t)}static create(t){return new animated_dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(dist_esm_z)),!0)}};function dist_esm_z(e){return(esm_or(e)?animated_dist_esm_d:animated_dist_esm_l).create(e)}function esm_Le(e){let t=dist_esm_k(e);return t?t.constructor:dist_esm_l.arr(e)?animated_dist_esm_y:esm_or(e)?animated_dist_esm_d:animated_dist_esm_l}var dist_esm_x=(e,t)=>{let r=!dist_esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new animated_dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,esm_Ve(T,s=>Gt(s,_)),()=>{p.current&&(esm_Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;esm_Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},animated_dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return dist_esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new animated_dist_esm_u(e),dist_esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(dist_esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),dist_esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new animated_dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=esm_I(o)||"Anonymous";return dist_esm_l.str(o)?o=i[o]||(i[o]=dist_esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=dist_esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{dist_esm_l.arr(e)&&(m=esm_I(o)),i[m]=i(o)}),{animated:i}},esm_I=e=>dist_esm_l.str(e)?e:e&&dist_esm_l.str(e.displayName)?e.displayName:dist_esm_l.fun(e)&&e.name||null; - -;// CONCATENATED MODULE: ./node_modules/@react-spring/core/dist/esm/index.js -function dist_esm_I(t,...e){return dist_esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(dist_esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>dist_esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);dist_esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),dist_esm_l.arr(t)?t.map(esm_me):esm_or(t)?dist_esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return dist_esm_l.fun(t)||dist_esm_l.arr(t)&&dist_esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+dist_esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return dist_esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!dist_esm_l.und(e.decay))t.duration=void 0;else{let n=!dist_esm_l.und(e.tension)||!dist_esm_l.und(e.friction);(n||!dist_esm_l.und(e.frequency)||!dist_esm_l.und(e.damping)||!dist_esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{dist_esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=dist_esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!dist_esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):dist_esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),dist_esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&dist_esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(dist_esm_p.skipAnimation)throw esm_oe(n),x.result=dist_esm_E(r,!1),d(x),x;b(g);let S=dist_esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{dist_esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(dist_esm_p.skipAnimation)return esm_oe(n),dist_esm_E(r,!1);try{let l;dist_esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=dist_esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return dist_esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=dist_esm_k(this);return e&&e.getValue()}to(...e){return dist_esm_p.to(this,e)}interpolate(...e){return Jt(),dist_esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!dist_esm_l.und(e)||!dist_esm_l.und(n)){let r=dist_esm_l.obj(e)?{...e}:{...n,from:e};dist_esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=dist_esm_k(this);return e instanceof animated_dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==animated_dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=dist_esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(dist_esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!dist_esm_l.und(A),_=l==m?f.v0>0:lS,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=dist_esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return dist_esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[dist_esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=dist_esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=dist_esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),dist_esm_l.und(o)?dist_esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!dist_esm_l.und(e.to),s=!dist_esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||dist_esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,dist_esm_I(n.config,a),n.config!==i.config?dist_esm_I(i.config,a):void 0);let x=dist_esm_k(this);if(!x||dist_esm_l.und(d))return r(dist_esm_E(this,!0));let S=dist_esm_l.und(n.reset)?s&&!n.default:!dist_esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=dist_esm_l.num(V)||dist_esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==animated_dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;esm_Ve(_n,y=>_t(this,n,y));let N=dist_esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?dist_esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!dist_esm_l.und(r)){let o=dist_esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return dist_esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",dist_esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),dist_esm_I(this.animation.onChange,e,this)),dist_esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;dist_esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){dist_esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;esm_Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):dist_esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=dist_esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return dist_esm_l.obj(e)&&Vt(e,r),dist_esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return R.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];dist_esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;esm_Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(dist_esm_l.und(e))this.start({pause:!0});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(dist_esm_l.und(e))this.start({pause:!1});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=dist_esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=dist_esm_l.arr(o)||dist_esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):esm_Ve(Fn,P=>{let l=e[P];if(dist_esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=esm_Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&esm_Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){esm_Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var dist_esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(dist_esm_H,{});dist_esm_H.Provider=esm_Ge.Provider;dist_esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?esm_fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;xesm_e(h,p[g])),b=Mn(dist_esm_H),c=Dt(b),P=b!==c&&esm_Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=Qn.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),dist_esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=dist_esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=dist_esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=dist_esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=dist_esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{dist_esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=dist_esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(dist_esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(dist_esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&esm_ct(this)}_get(){let n=dist_esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,esm_Ve(F(this),n=>{n.done=!1}),dist_esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),esm_ct(this)):qe.start(this))}_attach(){let n=1;esm_Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){esm_Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),esm_ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function esm_ct(t){t.idle||(t.idle=!0,esm_Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var esm_ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));dist_esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance; - -;// CONCATENATED MODULE: ./node_modules/@react-spring/web/dist/esm/index.js -var web_dist_esm_k=/^--/;function web_dist_esm_I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!web_dist_esm_k.test(t)&&!(web_dist_esm_c.hasOwnProperty(t)&&web_dist_esm_c[t])?e+"px":(""+e).trim()}var web_dist_esm_v={};function esm_V(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:u,scrollLeft:l,viewBox:a,...n}=e,d=Object.values(n),m=Object.keys(n).map(o=>r||t.hasAttribute(o)?o:web_dist_esm_v[o]||(web_dist_esm_v[o]=o.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));s!==void 0&&(t.textContent=s);for(let o in i)if(i.hasOwnProperty(o)){let p=web_dist_esm_I(o,i[o]);web_dist_esm_k.test(o)?t.style.setProperty(o,p):t.style[o]=p}m.forEach((o,p)=>{t.setAttribute(o,d[p])}),u!==void 0&&(t.scrollTop=u),l!==void 0&&(t.scrollLeft=l),a!==void 0&&t.setAttribute("viewBox",a)}var web_dist_esm_c={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},esm_F=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),esm_L=["Webkit","Ms","Moz","O"];web_dist_esm_c=Object.keys(web_dist_esm_c).reduce((t,e)=>(esm_L.forEach(r=>t[esm_F(r,e)]=t[e]),t),web_dist_esm_c);var esm_=/^(matrix|translate|scale|rotate|skew)/,dist_esm_$=/^(translate)/,dist_esm_G=/^(rotate|skew)/,web_dist_esm_y=(t,e)=>dist_esm_l.num(t)&&t!==0?t+e:t,web_dist_esm_h=(t,e)=>dist_esm_l.arr(t)?t.every(r=>web_dist_esm_h(r,e)):dist_esm_l.num(t)?t===e:parseFloat(t)===e,dist_esm_g=class extends animated_dist_esm_u{constructor({x:e,y:r,z:i,...s}){let u=[],l=[];(e||r||i)&&(u.push([e||0,r||0,i||0]),l.push(a=>[`translate3d(${a.map(n=>web_dist_esm_y(n,"px")).join(",")})`,web_dist_esm_h(a,0)])),xt(s,(a,n)=>{if(n==="transform")u.push([a||""]),l.push(d=>[d,d===""]);else if(esm_.test(n)){if(delete s[n],dist_esm_l.und(a))return;let d=dist_esm_$.test(n)?"px":dist_esm_G.test(n)?"deg":"";u.push(ht(a)),l.push(n==="rotate3d"?([m,o,p,O])=>[`rotate3d(${m},${o},${p},${web_dist_esm_y(O,d)})`,web_dist_esm_h(O,0)]:m=>[`${n}(${m.map(o=>web_dist_esm_y(o,d)).join(",")})`,web_dist_esm_h(m,n.startsWith("scale")?1:0)])}}),u.length&&(s.transform=new web_dist_esm_x(u,l)),super(s)}},web_dist_esm_x=class extends esm_ge{constructor(r,i){super();this.inputs=r;this.transforms=i}_value=null;get(){return this._value||(this._value=this._get())}_get(){let r="",i=!0;return esm_Ve(this.inputs,(s,u)=>{let l=ve(s[0]),[a,n]=this.transforms[u](dist_esm_l.arr(l)?l:s.map(ve));r+=" "+a,i=i&&n}),i?"none":r}observerAdded(r){r==1&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Gt(s,this)))}observerRemoved(r){r==0&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Qt(s,this)))}eventObserved(r){r.type=="change"&&(this._value=null),$t(this,r)}};var esm_C=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dist_esm_p.assign({batchedUpdates:external_ReactDOM_namespaceObject.unstable_batchedUpdates,createStringInterpolator:Xt,colors:It});var dist_esm_q=dist_esm_Ke(esm_C,{applyAnimatedValues:esm_V,createAnimatedStyle:t=>new dist_esm_g(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),dist_esm_it=dist_esm_q.animated; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/animation.js + type: 'regular', + fields: field.children.map(child => { + if (typeof child === 'string') { + return { + id: child + }; + } + return child; + }) + }; + } + // If not explicit children return the field id itself. + return { + type: 'regular', + fields: [{ + id: field.id + }] + }; + }, [field]); + + // Memoize popoverProps to avoid returning a new object every time. + const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + // Anchor the popover to the middle of the entire row so that it doesn't + // move around when the label changes. + anchor: popoverAnchor, + placement: 'left-start', + offset: 36, + shift: true + }), [popoverAnchor]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { + contentClassName: "dataforms-layouts-panel__field-dropdown", + popoverProps: popoverProps, + focusOnMount: true, + toggleProps: { + size: 'compact', + variant: 'tertiary', + tooltipPosition: 'middle left' + }, + renderToggle: ({ + isOpen, + onToggle + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { + className: "dataforms-layouts-panel__field-control", + size: "compact", + variant: ['none', 'top'].includes(labelPosition) ? 'link' : 'tertiary', + "aria-expanded": isOpen, + "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s: Field name. + (0,external_wp_i18n_namespaceObject._x)('Edit %s', 'field'), fieldLabel), + onClick: onToggle, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fieldDefinition.render, { + item: data + }) + }), + renderContent: ({ + onClose + }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownHeader, { + title: fieldLabel, + onClose: onClose + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange, + children: (FieldLayout, nestedField) => { + var _form$fields; + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { + data: data, + field: nestedField, + onChange: onChange, + hideLabelFromVision: ((_form$fields = form?.fields) !== null && _form$fields !== void 0 ? _form$fields : []).length < 2 + }, nestedField.id); + } + })] + }) + }); +} +function FormPanelField({ + data, + field, + onChange +}) { + var _field$labelPosition; + const { + fields + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + const fieldDefinition = fields.find(fieldDef => { + // Default to the first child if it is a combined field. + if (isCombinedField(field)) { + const children = field.children.filter(child => typeof child === 'string' || !isCombinedField(child)); + const firstChildFieldId = typeof children[0] === 'string' ? children[0] : children[0].id; + return fieldDef.id === firstChildFieldId; + } + return fieldDef.id === field.id; + }); + const labelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : 'side'; + + // Use internal state instead of a ref to make sure that the component + // re-renders when the popover's anchor updates. + const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); + if (!fieldDefinition) { + return null; + } + const fieldLabel = isCombinedField(field) ? field.label : fieldDefinition?.label; + if (labelPosition === 'top') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { + className: "dataforms-layouts-panel__field", + spacing: 0, + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-label", + style: { + paddingBottom: 0 + }, + children: fieldLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + })] + }); + } + if (labelPosition === 'none') { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + }); + } + + // Defaults to label position side. + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { + ref: setPopoverAnchor, + className: "dataforms-layouts-panel__field", + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-label", + children: fieldLabel + }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { + className: "dataforms-layouts-panel__field-control", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelDropdown, { + field: field, + popoverAnchor: popoverAnchor, + fieldDefinition: fieldDefinition, + data: data, + onChange: onChange, + labelPosition: labelPosition + }) + })] + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/index.js +/** + * Internal dependencies + */ + + +const FORM_FIELD_LAYOUTS = [{ + type: 'regular', + component: FormRegularField +}, { + type: 'panel', + component: FormPanelField +}]; +function getFormFieldLayout(type) { + return FORM_FIELD_LAYOUTS.find(layout => layout.type === type); +} + +;// ./node_modules/@wordpress/dataviews/build-module/normalize-form-fields.js +/** + * Internal dependencies + */ + +function normalizeFormFields(form) { + var _form$type, _form$labelPosition, _form$fields; + let layout = 'regular'; + if (['regular', 'panel'].includes((_form$type = form.type) !== null && _form$type !== void 0 ? _form$type : '')) { + layout = form.type; + } + const labelPosition = (_form$labelPosition = form.labelPosition) !== null && _form$labelPosition !== void 0 ? _form$labelPosition : layout === 'regular' ? 'top' : 'side'; + return ((_form$fields = form.fields) !== null && _form$fields !== void 0 ? _form$fields : []).map(field => { + var _field$layout, _field$labelPosition; + if (typeof field === 'string') { + return { + id: field, + layout, + labelPosition + }; + } + const fieldLayout = (_field$layout = field.layout) !== null && _field$layout !== void 0 ? _field$layout : layout; + const fieldLabelPosition = (_field$labelPosition = field.labelPosition) !== null && _field$labelPosition !== void 0 ? _field$labelPosition : fieldLayout === 'regular' ? 'top' : 'side'; + return { + ...field, + layout: fieldLayout, + labelPosition: fieldLabelPosition + }; + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/dataforms-layouts/data-form-layout.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function DataFormLayout({ + data, + form, + onChange, + children +}) { + const { + fields: fieldDefinitions + } = (0,external_wp_element_namespaceObject.useContext)(dataform_context); + function getFieldDefinition(field) { + const fieldId = typeof field === 'string' ? field : field.id; + return fieldDefinitions.find(fieldDefinition => fieldDefinition.id === fieldId); + } + const normalizedFormFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFormFields(form), [form]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { + spacing: 2, + children: normalizedFormFields.map(formField => { + const FieldLayout = getFormFieldLayout(formField.layout)?.component; + if (!FieldLayout) { + return null; + } + const fieldDefinition = !isCombinedField(formField) ? getFieldDefinition(formField) : undefined; + if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) { + return null; + } + if (children) { + return children(FieldLayout, formField); + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FieldLayout, { + data: data, + field: formField, + onChange: onChange + }, formField.id); + }) + }); +} + +;// ./node_modules/@wordpress/dataviews/build-module/components/dataform/index.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +function DataForm({ + data, + form, + fields, + onChange +}) { + const normalizedFields = (0,external_wp_element_namespaceObject.useMemo)(() => normalizeFields(fields), [fields]); + if (!form.fields) { + return null; + } + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormProvider, { + fields: normalizedFields, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataFormLayout, { + data: data, + form: form, + onChange: onChange + }) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/post-edit/index.js /** * External dependencies */ @@ -40115,432 +42035,494 @@ * WordPress dependencies */ -function getAbsolutePosition(element) { - return { - top: element.offsetTop, - left: element.offsetLeft - }; -} -const ANIMATION_DURATION = 400; - -/** - * Hook used to compute the styles required to move a div into a new position. - * - * The way this animation works is the following: - * - It first renders the element as if there was no animation. - * - It takes a snapshot of the position of the block to use it - * as a destination point for the animation. - * - It restores the element to the previous position using a CSS transform - * - It uses the "resetAnimation" flag to reset the animation - * from the beginning in order to animate to the new destination point. - * - * @param {Object} $1 Options - * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. - */ -function useMovingAnimation({ - triggerAnimationOnChange -}) { - const ref = (0,external_wp_element_namespaceObject.useRef)(); - - // Whenever the trigger changes, we need to take a snapshot of the current - // position of the block to use it as a destination point for the animation. - const { - previous, - prevRect - } = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - previous: ref.current && getAbsolutePosition(ref.current), - prevRect: ref.current && ref.current.getBoundingClientRect() - }), - // eslint-disable-next-line react-hooks/exhaustive-deps - [triggerAnimationOnChange]); - (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { - if (!previous || !ref.current) { - return; - } - - // We disable the animation if the user has a preference for reduced - // motion. - const disableAnimation = window.matchMedia('(prefers-reduced-motion: reduce)').matches; - if (disableAnimation) { - return; - } - const controller = new esm_le({ - x: 0, - y: 0, - width: prevRect.width, - height: prevRect.height, - config: { - duration: ANIMATION_DURATION, - easing: Lt.easeInOutQuint - }, - onChange({ - value - }) { - if (!ref.current) { - return; - } - let { - x, - y, - width, - height - } = value; - x = Math.round(x); - y = Math.round(y); - width = Math.round(width); - height = Math.round(height); - const finishedMoving = x === 0 && y === 0; - ref.current.style.transformOrigin = 'center center'; - ref.current.style.transform = finishedMoving ? null // Set to `null` to explicitly remove the transform. - : `translate3d(${x}px,${y}px,0)`; - ref.current.style.width = finishedMoving ? null : `${width}px`; - ref.current.style.height = finishedMoving ? null : `${height}px`; - } - }); - ref.current.style.transform = undefined; - const destination = ref.current.getBoundingClientRect(); - const x = Math.round(prevRect.left - destination.left); - const y = Math.round(prevRect.top - destination.top); - const width = destination.width; - const height = destination.height; - controller.start({ - x: 0, - y: 0, - width, - height, - from: { - x, - y, - width: prevRect.width, - height: prevRect.height - } - }); - return () => { - controller.stop(); - controller.set({ - x: 0, - y: 0, - width: prevRect.width, - height: prevRect.height - }); - }; - }, [previous, prevRect]); - return ref; -} -/* harmony default export */ const animation = (useMovingAnimation); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - - -function SaveHub() { - const { - isDisabled, - isSaving + + + + + + + +/** + * Internal dependencies + */ + + + + + +const { + usePostFields: post_edit_usePostFields, + PostCardPanel +} = unlock(external_wp_editor_namespaceObject.privateApis); +const fieldsWithBulkEditSupport = ['title', 'status', 'date', 'author', 'comment_status']; +function PostEditForm({ + postType, + postId +}) { + const ids = (0,external_wp_element_namespaceObject.useMemo)(() => postId.split(','), [postId]); + const { + record, + hasFinishedResolution } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - __experimentalGetDirtyEntityRecords, - isSavingEntityRecord + const args = ['postType', postType, ids[0]]; + const { + getEditedEntityRecord, + hasFinishedResolution: hasFinished } = select(external_wp_coreData_namespaceObject.store); - const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); - const _isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)); - return { - isSaving: _isSaving, - isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme() - }; - }, []); - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { - className: "edit-site-save-hub", - alignment: "right", + return { + record: ids.length === 1 ? getEditedEntityRecord(...args) : null, + hasFinishedResolution: hasFinished('getEditedEntityRecord', args) + }; + }, [postType, ids]); + const [multiEdits, setMultiEdits] = (0,external_wp_element_namespaceObject.useState)({}); + const { + editEntityRecord + } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); + const { + fields: _fields + } = post_edit_usePostFields({ + postType + }); + const fields = (0,external_wp_element_namespaceObject.useMemo)(() => _fields?.map(field => { + if (field.id === 'status') { + return { + ...field, + elements: field.elements.filter(element => element.value !== 'trash') + }; + } + return field; + }), [_fields]); + const form = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + type: 'panel', + fields: [{ + id: 'featured_media', + layout: 'regular' + }, { + id: 'status', + label: (0,external_wp_i18n_namespaceObject.__)('Status & Visibility'), + children: ['status', 'password'] + }, 'author', 'date', 'slug', 'parent', 'comment_status', { + label: (0,external_wp_i18n_namespaceObject.__)('Template'), + labelPosition: 'side', + id: 'template', + layout: 'regular' + }].filter(field => ids.length === 1 || fieldsWithBulkEditSupport.includes(field)) + }), [ids]); + const onChange = edits => { + for (const id of ids) { + if (edits.status && edits.status !== 'future' && record?.status === 'future' && new Date(record.date) > new Date()) { + edits.date = null; + } + if (edits.status && edits.status === 'private' && record.password) { + edits.password = ''; + } + editEntityRecord('postType', postType, id, edits); + if (ids.length > 1) { + setMultiEdits(prev => ({ + ...prev, + ...edits + })); + } + } + }; + (0,external_wp_element_namespaceObject.useEffect)(() => { + setMultiEdits({}); + }, [ids]); + const { + ExperimentalBlockEditorProvider + } = unlock(external_wp_blockEditor_namespaceObject.privateApis); + const settings = usePatternSettings(); + + /** + * The template field depends on the block editor settings. + * This is a workaround to ensure that the block editor settings are available. + * For more information, see: https://github.com/WordPress/gutenberg/issues/67521 + */ + const fieldsWithDependency = (0,external_wp_element_namespaceObject.useMemo)(() => { + return fields.map(field => { + if (field.id === 'template') { + return { + ...field, + Edit: data => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { + settings: settings, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(field.Edit, { + ...data + }) + }) + }; + } + return field; + }); + }, [fields, settings]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveButton, { - className: "edit-site-save-hub__button", - variant: isDisabled ? null : 'primary', - showTooltip: false, - icon: isDisabled && !isSaving ? library_check : null, - showReviewMessage: true, - __next40pxDefaultSize: true - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/layout/index.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - - - - - - - - -/** - * Internal dependencies - */ - - - - - - - - - - - - - - - - - - - - -const { - useCommands -} = lock_unlock_unlock(external_wp_coreCommands_namespaceObject.privateApis); -const { - useCommandContext -} = lock_unlock_unlock(external_wp_commands_namespaceObject.privateApis); -const { - useGlobalStyle: layout_useGlobalStyle -} = lock_unlock_unlock(external_wp_blockEditor_namespaceObject.privateApis); -const { - NavigableRegion: layout_NavigableRegion -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); -const layout_ANIMATION_DURATION = 0.3; -function Layout() { - // This ensures the edited entity id and type are initialized properly. - useInitEditedEntityFromURL(); - useSyncCanvasModeWithURL(); - useCommands(); - useEditModeCommands(); - useCommonCommands(); - const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); - const toggleRef = (0,external_wp_element_namespaceObject.useRef)(); - const { - isDistractionFree, - hasFixedToolbar, - hasBlockSelected, - canvasMode, - previousShortcut, - nextShortcut - } = (0,external_wp_data_namespaceObject.useSelect)(select => { - const { - getAllShortcutKeyCombinations - } = select(external_wp_keyboardShortcuts_namespaceObject.store); - const { - getCanvasMode - } = lock_unlock_unlock(select(store)); - return { - canvasMode: getCanvasMode(), - previousShortcut: getAllShortcutKeyCombinations('core/editor/previous-region'), - nextShortcut: getAllShortcutKeyCombinations('core/editor/next-region'), - hasFixedToolbar: select(external_wp_preferences_namespaceObject.store).get('core', 'fixedToolbar'), - isDistractionFree: select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree'), - hasBlockSelected: select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart() - }; - }, []); - const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)({ - previous: previousShortcut, - next: nextShortcut - }); - const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); - const [canvasResizer, canvasSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); - const [fullResizer] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); - const isEditorLoading = useIsSiteEditorLoading(); - const [isResizableFrameOversized, setIsResizableFrameOversized] = (0,external_wp_element_namespaceObject.useState)(false); - const { - key: routeKey, - areas, - widths - } = useLayoutAreas(); - const animationRef = animation({ - triggerAnimationOnChange: canvasMode + '__' + routeKey - }); - - // Sets the right context for the command palette - let commandContext = 'site-editor'; - if (canvasMode === 'edit') { - commandContext = 'entity-edit'; - } - if (hasBlockSelected) { - commandContext = 'block-selection-edit'; - } - useCommandContext(commandContext); - const [backgroundColor] = layout_useGlobalStyle('color.background'); - const [gradientValue] = layout_useGlobalStyle('color.gradient'); - const previousCanvaMode = (0,external_wp_compose_namespaceObject.usePrevious)(canvasMode); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (previousCanvaMode === 'edit') { - toggleRef.current?.focus(); - } - // Should not depend on the previous canvas mode value but the next. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [canvasMode]); - - // Synchronizing the URL with the store value of canvasMode happens in an effect - // This condition ensures the component is only rendered after the synchronization happens - // which prevents any animations due to potential canvasMode value change. - if (canvasMode === 'init') { - return null; - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(global, {}), fullResizer, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - ...navigateRegionsProps, - ref: navigateRegionsProps.ref, - className: dist_clsx('edit-site-layout', navigateRegionsProps.className, { - 'is-distraction-free': isDistractionFree && canvasMode === 'edit', - 'is-full-canvas': canvasMode === 'edit', - 'has-fixed-toolbar': hasFixedToolbar, - 'is-block-toolbar-visible': hasBlockSelected - }), - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-layout__content", - children: [(!isMobileViewport || !areas.mobile) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout_NavigableRegion, { - ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation'), - className: "edit-site-layout__sidebar-region", - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { - children: canvasMode === 'view' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { - initial: { - opacity: 0 - }, - animate: { - opacity: 1 - }, - exit: { - opacity: 0 - }, - transition: { - type: 'tween', - duration: - // Disable transition in mobile to emulate a full page transition. - disableMotion || isMobileViewport ? 0 : layout_ANIMATION_DURATION, - ease: 'easeOut' - }, - className: "edit-site-layout__sidebar", - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_hub, { - ref: toggleRef, - isTransparent: isResizableFrameOversized - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { - routeKey: routeKey, - children: areas.sidebar - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})] - }) - }) - }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-layout__mobile", - children: [canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { - routeKey: routeKey, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteHubMobile, { - ref: toggleRef, - isTransparent: isResizableFrameOversized - }) - }), areas.mobile] - }), !isMobileViewport && areas.content && canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: "edit-site-layout__area", - style: { - maxWidth: widths?.content - }, - children: areas.content - }), !isMobileViewport && areas.preview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { - className: "edit-site-layout__canvas-container", - children: [canvasResizer, !!canvasSize.width && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { - className: dist_clsx('edit-site-layout__canvas', { - 'is-right-aligned': isResizableFrameOversized - }), - ref: animationRef, - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resizable_frame, { - isReady: !isEditorLoading, - isFullWidth: canvasMode === 'edit', - defaultSize: { - width: canvasSize.width - 24 /* $canvas-padding */, - height: canvasSize.height - }, - isOversized: isResizableFrameOversized, - setIsOversized: setIsResizableFrameOversized, - innerContentStyle: { - background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor - }, - children: areas.preview - }) - }) - })] - })] - }) - })] - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/app/index.js -/** - * WordPress dependencies - */ - - - - - - - - -/** - * Internal dependencies - */ + children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, { + postType: postType, + postId: ids + }), hasFinishedResolution && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataForm, { + data: ids.length === 1 ? record : multiEdits, + fields: fieldsWithDependency, + form: form, + onChange: onChange + })] + }); +} +function PostEdit({ + postType, + postId +}) { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Page, { + className: dist_clsx('edit-site-post-edit', { + 'is-empty': !postId + }), + label: (0,external_wp_i18n_namespaceObject.__)('Post Edit'), + children: [postId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEditForm, { + postType: postType, + postId: postId + }), !postId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { + children: (0,external_wp_i18n_namespaceObject.__)('Select a page to edit') + })] + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/pages.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + + + +const { + useLocation: pages_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobilePagesView() { + const { + query = {} + } = pages_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "page" + }); +} +const pagesRoute = { + name: 'pages', + path: '/page', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Pages'), + backPath: "/", + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "page" + }) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + content({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "page" + }) : undefined; + }, + preview({ + query, + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + if (!isBlockTheme) { + return undefined; + } + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : undefined; + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePagesView, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + edit({ + query + }) { + var _query$layout; + const hasQuickEdit = ((_query$layout = query.layout) !== null && _query$layout !== void 0 ? _query$layout : 'list') !== 'list' && !!query.quickEdit; + return hasQuickEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { + postType: "page", + postId: query.postId + }) : undefined; + } + }, + widths: { + content({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? 380 : undefined; + }, + edit({ + query + }) { + var _query$layout2; + const hasQuickEdit = ((_query$layout2 = query.layout) !== null && _query$layout2 !== void 0 ? _query$layout2 : 'list') !== 'list' && !!query.quickEdit; + return hasQuickEdit ? 380 : undefined; + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/page-item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const pageItemRoute = { + name: 'page-item', + path: '/page/:postId', + areas: { + sidebar({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Pages'), + backPath: "/", + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "page" + }) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + mobile({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + const isBlockTheme = siteData.currentTheme?.is_block_theme; + return isBlockTheme ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/stylebook.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + + +const stylebookRoute = { + name: 'stylebook', + path: '/stylebook', + areas: { + sidebar({ + siteData + }) { + return isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Styles'), + backPath: "/", + description: (0,external_wp_i18n_namespaceObject.__)(`Preview your website's visual identity: colors, typography, and blocks.`) + }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenUnsupported, {}); + }, + preview({ + siteData + }) { + return isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { + isStatic: true + }) : undefined; + }, + mobile({ + siteData + }) { + return isClassicThemeWithStyleBookSupport(siteData) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyleBookPreview, { + isStatic: true + }) : undefined; + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/notfound.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function NotFoundError() { + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { + status: "error", + isDismissible: false, + children: (0,external_wp_i18n_namespaceObject.__)('The requested page could not be found. Please check the URL.') + }); +} +const notFoundRoute = { + name: 'notfound', + path: '*', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, {}), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreenMain, { + customDescription: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NotFoundError, {}) + }), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { + padding: 2, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NotFoundError, {}) + }) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/site-editor-routes/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + + + + + + + + + + +const site_editor_routes_routes = [pageItemRoute, pagesRoute, templateItemRoute, templatesRoute, templatePartItemRoute, patternItemRoute, patternsRoute, navigationItemRoute, navigationRoute, stylesRoute, homeRoute, stylebookRoute, notFoundRoute]; +function useRegisterSiteEditorRoutes() { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + registerRoute + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registry.batch(() => { + site_editor_routes_routes.forEach(registerRoute); + }); + }, [registry, registerRoute]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/app/index.js +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + + const { RouterProvider -} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); -const { - GlobalStylesProvider -} = lock_unlock_unlock(external_wp_editor_namespaceObject.privateApis); +} = unlock(external_wp_router_namespaceObject.privateApis); +function AppLayout() { + useCommonCommands(); + useSetCommandContext(); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {}); +} function App() { - const { - createErrorNotice - } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); - function onPluginAreaError(name) { - createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ - (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); - } - return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { - children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(GlobalStylesProvider, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(RouterProvider, { - children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Layout, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { - onError: onPluginAreaError - })] - })] - }) - }); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/deprecated.js + useRegisterSiteEditorRoutes(); + const { + routes, + currentTheme, + editorSettings + } = (0,external_wp_data_namespaceObject.useSelect)(select => { + return { + routes: unlock(select(store)).getRoutes(), + currentTheme: select(external_wp_coreData_namespaceObject.store).getCurrentTheme(), + // This is a temp solution until the has_theme_json value is available for the current theme. + editorSettings: select(store).getSettings() + }; + }, []); + const beforeNavigate = (0,external_wp_element_namespaceObject.useCallback)(({ + path, + query + }) => { + if (!isPreviewingTheme()) { + return { + path, + query + }; + } + return { + path, + query: { + ...query, + wp_theme_preview: 'wp_theme_preview' in query ? query.wp_theme_preview : currentlyPreviewingTheme() + } + }; + }, []); + const matchResolverArgsValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + siteData: { + currentTheme, + editorSettings + } + }), [currentTheme, editorSettings]); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RouterProvider, { + routes: routes, + pathArg: "p", + beforeNavigate: beforeNavigate, + matchResolverArgs: matchResolverArgsValue, + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AppLayout, {}) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/deprecated.js /** * WordPress dependencies */ @@ -40597,34 +42579,210 @@ } /* eslint-enable jsdoc/require-param */ -;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/index.js -/** - * WordPress dependencies - */ - - - - - - - - - -/** - * Internal dependencies - */ - - - - -/** - * Initializes the site editor screen. - * +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/posts.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + + +const { + useLocation: posts_useLocation +} = unlock(external_wp_router_namespaceObject.privateApis); +function MobilePostsView() { + const { + query = {} + } = posts_useLocation(); + const { + canvas = 'view' + } = query; + return canvas === 'edit' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "post" + }); +} +const postsRoute = { + name: 'posts', + path: '/', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + isRoot: true, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "post" + }) + }), + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostList, { + postType: "post" + }), + preview({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }) : undefined; + }, + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobilePostsView, {}), + edit({ + query + }) { + var _query$layout; + const hasQuickEdit = ((_query$layout = query.layout) !== null && _query$layout !== void 0 ? _query$layout : 'list') === 'list' && !!query.quickEdit; + return hasQuickEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostEdit, { + postType: "post", + postId: query.postId + }) : undefined; + } + }, + widths: { + content({ + query + }) { + const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true'; + return isListView ? 380 : undefined; + }, + edit({ + query + }) { + var _query$layout2; + const hasQuickEdit = ((_query$layout2 = query.layout) !== null && _query$layout2 !== void 0 ? _query$layout2 : 'list') === 'list' && !!query.quickEdit; + return hasQuickEdit ? 380 : undefined; + } + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/post-item.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const postItemRoute = { + name: 'post-item', + path: '/post/:postId', + areas: { + sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationScreen, { + title: (0,external_wp_i18n_namespaceObject.__)('Posts'), + isRoot: true, + content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DataViewsSidebarContent, { + postType: "post" + }) + }), + mobile: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }), + preview: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditSiteEditor, { + isPostsList: true + }) + } +}; + +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app-routes/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const posts_app_routes_routes = [postItemRoute, postsRoute]; +function useRegisterPostsAppRoutes() { + const registry = (0,external_wp_data_namespaceObject.useRegistry)(); + const { + registerRoute + } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + registry.batch(() => { + posts_app_routes_routes.forEach(registerRoute); + }); + }, [registry, registerRoute]); +} + +;// ./node_modules/@wordpress/edit-site/build-module/components/posts-app/index.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +const { + RouterProvider: posts_app_RouterProvider +} = unlock(external_wp_router_namespaceObject.privateApis); +function PostsApp() { + useRegisterPostsAppRoutes(); + const routes = (0,external_wp_data_namespaceObject.useSelect)(select => { + return unlock(select(store)).getRoutes(); + }, []); + return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(posts_app_RouterProvider, { + routes: routes, + pathArg: "p", + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutWithGlobalStylesProvider, {}) + }); +} + +;// ./node_modules/@wordpress/edit-site/build-module/posts.js +/** + * WordPress dependencies + */ + + + + + + + +/** + * Internal dependencies + */ + + + +/** + * Internal dependencies + */ + + +/** + * Initializes the "Posts Dashboard" * @param {string} id ID of the root element to render the screen in. * @param {Object} settings Editor settings. */ -function initializeEditor(id, settings) { +function initializePostsDashboard(id, settings) { + if (true) { + return; + } const target = document.getElementById(id); const root = (0,external_wp_element_namespaceObject.createRoot)(target); (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); @@ -40653,29 +42811,112 @@ allowRightClickOverrides: true, distractionFree: false, editorMode: 'visual', + editorTool: 'edit', fixedToolbar: false, focusMode: false, inactivePanels: [], keepCaretInsideBlock: false, openPanels: ['post-status'], showBlockBreadcrumbs: true, - showListViewByDefault: false + showListViewByDefault: false, + enableChoosePatternModal: true }); (0,external_wp_data_namespaceObject.dispatch)(store).updateSettings(settings); - // Keep the defaultTemplateTypes in the core/editor settings too, - // so that they can be selected with core/editor selectors in any editor. - // This is needed because edit-site doesn't initialize with EditorProvider, - // which internally uses updateEditorSettings as well. - (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).updateEditorSettings({ - defaultTemplateTypes: settings.defaultTemplateTypes, - defaultTemplatePartAreas: settings.defaultTemplatePartAreas - }); - // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); - root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(App, {})); + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsApp, {}) + })); + return root; +} + +;// ./node_modules/@wordpress/edit-site/build-module/index.js +/** + * WordPress dependencies + */ + + + + + + + + + +/** + * Internal dependencies + */ + + + + + +const { + registerCoreBlockBindingsSources +} = unlock(external_wp_editor_namespaceObject.privateApis); + +/** + * Initializes the site editor screen. + * + * @param {string} id ID of the root element to render the screen in. + * @param {Object} settings Editor settings. + */ +function initializeEditor(id, settings) { + const target = document.getElementById(id); + const root = (0,external_wp_element_namespaceObject.createRoot)(target); + (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); + const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(({ + name + }) => name !== 'core/freeform'); + (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks); + registerCoreBlockBindingsSources(); + (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).setFreeformFallbackBlockName('core/html'); + (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ + inserter: false + }); + (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ + inserter: false + }); + if (false) {} + + // We dispatch actions and update the store synchronously before rendering + // so that we won't trigger unnecessary re-renders with useEffect. + (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-site', { + welcomeGuide: true, + welcomeGuideStyles: true, + welcomeGuidePage: true, + welcomeGuideTemplate: true + }); + (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { + allowRightClickOverrides: true, + distractionFree: false, + editorMode: 'visual', + editorTool: 'edit', + fixedToolbar: false, + focusMode: false, + inactivePanels: [], + keepCaretInsideBlock: false, + openPanels: ['post-status'], + showBlockBreadcrumbs: true, + showListViewByDefault: false, + enableChoosePatternModal: true + }); + if (window.__experimentalMediaProcessing) { + (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/media', { + requireApproval: true, + optimizeOnUpload: true + }); + } + (0,external_wp_data_namespaceObject.dispatch)(store).updateSettings(settings); + + // Prevent the default browser action for files dropped outside of dropzones. + window.addEventListener('dragover', e => e.preventDefault(), false); + window.addEventListener('drop', e => e.preventDefault(), false); + root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { + children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(App, {}) + })); return root; } function reinitializeEditor() { @@ -40688,6 +42929,10 @@ +// Temporary: While the posts dashboard is being iterated on +// it's being built in the same package as the site editor. + + })(); (window.wp = window.wp || {}).editSite = __webpack_exports__;