/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 4660: /***/ ((module) => { /* 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 */ /* 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. When large enough input and output buffers are supplied to inflate(), for example, a 16K input buffer and a 64K output buffer, more than 95% of the inflate execution time is spent in this routine. Entry assumptions: state.mode === LEN strm.avail_in >= 6 strm.avail_out >= 258 start >= strm.avail_out state.bits < 8 On return, state.mode is one of: LEN -- ran out of enough output space or enough available input TYPE -- reached end of block code, inflate() to interpret next block BAD -- error in block data Notes: - The maximum input bits used by a length/distance pair is 15 bits for the length code, 5 bits for the length extra, 15 bits for the distance code, and 13 bits for the distance extra. This totals 48 bits, or six bytes. Therefore if strm.avail_in >= 6, then there is enough input to avoid checking for available input while decoding. - The maximum bytes that a single length/distance pair can output is 258 bytes, which is the maximum length that can be coded. inflate_fast() 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 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 */ /* 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 ); } /* 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 first time it's called, and returns those tables the first time and thereafter. This reduces the size of the code by about 2K bytes, in exchange for a little execution time. However, BUILDFIXED should not be 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; } /* 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 inflate call, but the end of the deflate stream has not been reached yet. It is also called to create a window for dictionary data when a dictionary is loaded. Providing output buffers larger than 32K to inflate() should provide a speed advantage, since only the last 32K of output is copied to the sliding window upon return from inflate(), and since all distances after the first 32K of 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 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" /* 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 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 exports.inflateCopy = inflateCopy; exports.inflateGetDictionary = inflateGetDictionary; exports.inflateMark = inflateMark; exports.inflatePrime = inflatePrime; exports.inflateSync = inflateSync; 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; /* 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 symbols by length from short to long, and retaining the symbol order for codes with equal lengths. Then the code starts with all zero bits for the first code of the shortest length, and the codes are integer increments for the same length, and zeros are appended as the length increases. For the deflate format, these bits are stored backwards from their more natural integer increment ordering, and so when the decoding tables are built in the large loop below, the integer codes are incremented backwards. This routine assumes, but does not check, that all of the entries in lens[] are in the range 0..MAXBITS. The caller must assure this. 1..MAXBITS is interpreted as that code length. zero means that that symbol does not occur in this code. The codes are sorted by computing a count of codes for each length, creating from that a table of starting indices for each length in the sorted table, and then entering the symbols in order in the sorted table. The sorted table is work[], with that space being provided by the caller. The length counts are used for other purposes as well, i.e. finding the minimum and maximum length codes, determining if there are any codes at all, checking for a valid set of lengths, and looking ahead at length counts to determine sub-table sizes when building the 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; } } /* 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 bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked for LENS and DIST tables against the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in the initial root table size constants. See the comments in inftrees.h for more information. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills 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; 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 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' ); } ); /* eslint-enable */ /***/ }), /***/ 8572: /***/ ((module) => { /* 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. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Bit reading helpers */ 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. Returns 0 if either: - the input callback returned an error, or - there is no more input and the position is past the end of the stream. After encountering the end of the input stream, 32 additional zero bytes are 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. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Lookup table to map the previous two bytes to a context id. There are four different context modeling modes defined here: CONTEXT_LSB6: context id is the least significant 6 bits of the last byte, CONTEXT_MSB6: context id is the most significant 6 bits of the last byte, CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text, CONTEXT_SIGNED: second-order context model tuned for signed integers. The context id for the UTF8 context model is calculated as follows. If p1 and p2 are the previous two bytes, we calcualte the context as context = kContextLookup[p1] | kContextLookup[p2 + 256]. If the previous two bytes are ASCII characters (i.e. < 128), this will be equivalent to context = 4 * context1(p1) + context2(p2), where context1 is based on the previous byte in the following way: 0 : non-ASCII control 1 : \t, \n, \r 2 : space 3 : other punctuation 4 : " ' 5 : % 6 : ( < [ { 7 : ) > ] } 8 : , ; : 9 : . 10 : = 11 : number 12 : upper-case vowel 13 : upper-case consonant 14 : lower-case vowel 15 : lower-case consonant and context2 is based on the second last byte: 0 : control, space 1 : punctuation 2 : upper-case letter, number 3 : lower-case letter If the last byte is ASCII, and the second last byte is not (in a valid UTF8 stream it will be a continuation byte, value between 128 and 191), the context is the same as if the second last byte was an ASCII control or space. If the last byte is a UTF8 lead byte (value >= 192), then the next byte will be a continuation byte and the context id is 2 or 3 depending on the LSB of the last byte and to a lesser extent on the second last byte if it is ASCII. If the last byte is a UTF8 continuation byte, the second last byte can be: - continuation byte: the next byte is probably ASCII or lead byte (assuming 4-byte UTF8 characters are rare) and the context id is 0 or 1. - lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1 - lead byte (208 - 255): next byte is continuation byte, context is 2 or 3 The possible value combinations of the previous two bytes, the range of context ids and the type of the next byte is summarized in the table below: |--------\-----------------------------------------------------------------| | \ Last byte | | Second \---------------------------------------------------------------| | last byte \ ASCII | cont. byte | lead byte | | \ (0-127) | (128-191) | (192-) | |=============|===================|=====================|==================| | ASCII | next: ASCII/lead | not valid | next: cont. | | (0-127) | context: 4 - 63 | | context: 2 - 3 | |-------------|-------------------|---------------------|------------------| | cont. byte | next: ASCII/lead | next: ASCII/lead | next: cont. | | (128-191) | context: 4 - 63 | context: 0 - 1 | context: 2 - 3 | |-------------|-------------------|---------------------|------------------| | lead byte | not valid | next: ASCII/lead | not valid | | (192-207) | | context: 0 - 1 | | |-------------|-------------------|---------------------|------------------| | lead byte | not valid | next: cont. | not valid | | (208-) | | context: 2 - 3 | | |-------------|-------------------|---------------------|------------------| The context id for the signed context mode is calculated as: context = (kContextLookup[512 + p1] << 3) | kContextLookup[512 + p2]. For any context modeling modes, the context ids can be calculated by |-ing together two lookups from one table using context model dependent offsets: context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2]. 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, 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, 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. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and 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: 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 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 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 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 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: - 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//62zQsFEZWSTCnMhcsQKlS2q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T60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/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. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 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 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 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. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Lookup tables to map prefix codes to value ranges. This is used during 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. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 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 ); } ); /* eslint-enable */ /***/ }), /***/ 4306: /***/ (function(module, exports) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */ (function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { var mod; } })(this, function (module, exports) { 'use strict'; var map = typeof Map === "function" ? new Map() : function () { var keys = []; var values = []; return { has: function has(key) { return keys.indexOf(key) > -1; }, get: function get(key) { return values[keys.indexOf(key)]; }, set: function set(key, value) { if (keys.indexOf(key) === -1) { keys.push(key); values.push(value); } }, delete: function _delete(key) { var index = keys.indexOf(key); if (index > -1) { keys.splice(index, 1); values.splice(index, 1); } } }; }(); var createEvent = function createEvent(name) { return new Event(name, { bubbles: true }); }; try { new Event('test'); } catch (e) { // IE does not support `new Event()` createEvent = function createEvent(name) { var evt = document.createEvent('Event'); evt.initEvent(name, true, false); return evt; }; } function assign(ta) { if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return; var heightOffset = null; var clientWidth = null; var cachedHeight = null; function init() { var style = window.getComputedStyle(ta, null); if (style.resize === 'vertical') { ta.style.resize = 'none'; } else if (style.resize === 'both') { ta.style.resize = 'horizontal'; } if (style.boxSizing === 'content-box') { heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); } else { heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } // Fix when a textarea is not on document body and heightOffset is Not a Number if (isNaN(heightOffset)) { heightOffset = 0; } update(); } function changeOverflow(value) { { // Chrome/Safari-specific fix: // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space // made available by removing the scrollbar. The following forces the necessary text reflow. var width = ta.style.width; ta.style.width = '0px'; // Force reflow: /* jshint ignore:start */ ta.offsetWidth; /* jshint ignore:end */ ta.style.width = width; } ta.style.overflowY = value; } function getParentOverflows(el) { var arr = []; while (el && el.parentNode && el.parentNode instanceof Element) { if (el.parentNode.scrollTop) { arr.push({ node: el.parentNode, scrollTop: el.parentNode.scrollTop }); } el = el.parentNode; } return arr; } function resize() { if (ta.scrollHeight === 0) { // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. return; } var overflows = getParentOverflows(ta); var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) ta.style.height = ''; ta.style.height = ta.scrollHeight + heightOffset + 'px'; // used to check if an update is actually necessary on window.resize clientWidth = ta.clientWidth; // prevents scroll-position jumping overflows.forEach(function (el) { el.node.scrollTop = el.scrollTop; }); if (docTop) { document.documentElement.scrollTop = docTop; } } function update() { resize(); var styleHeight = Math.round(parseFloat(ta.style.height)); var computed = window.getComputedStyle(ta, null); // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; // The actual height not matching the style height (set via the resize method) indicates that // the max-height has been exceeded, in which case the overflow should be allowed. if (actualHeight < styleHeight) { if (computed.overflowY === 'hidden') { changeOverflow('scroll'); resize(); actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } else { // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands. if (computed.overflowY !== 'hidden') { changeOverflow('hidden'); resize(); actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } if (cachedHeight !== actualHeight) { cachedHeight = actualHeight; var evt = createEvent('autosize:resized'); try { ta.dispatchEvent(evt); } catch (err) { // Firefox will throw an error on dispatchEvent for a detached element // https://bugzilla.mozilla.org/show_bug.cgi?id=889376 } } } var pageResize = function pageResize() { if (ta.clientWidth !== clientWidth) { update(); } }; var destroy = function (style) { window.removeEventListener('resize', pageResize, false); ta.removeEventListener('input', update, false); ta.removeEventListener('keyup', update, false); ta.removeEventListener('autosize:destroy', destroy, false); ta.removeEventListener('autosize:update', update, false); Object.keys(style).forEach(function (key) { ta.style[key] = style[key]; }); map.delete(ta); }.bind(ta, { height: ta.style.height, resize: ta.style.resize, overflowY: ta.style.overflowY, overflowX: ta.style.overflowX, wordWrap: ta.style.wordWrap }); ta.addEventListener('autosize:destroy', destroy, false); // IE9 does not fire onpropertychange or oninput for deletions, // so binding to onkeyup to catch most of those events. // There is no way that I know of to detect something like 'cut' in IE9. if ('onpropertychange' in ta && 'oninput' in ta) { ta.addEventListener('keyup', update, false); } window.addEventListener('resize', pageResize, false); ta.addEventListener('input', update, false); ta.addEventListener('autosize:update', update, false); ta.style.overflowX = 'hidden'; ta.style.wordWrap = 'break-word'; map.set(ta, { destroy: destroy, update: update }); init(); } function destroy(ta) { var methods = map.get(ta); if (methods) { methods.destroy(); } } function update(ta) { var methods = map.get(ta); if (methods) { methods.update(); } } var autosize = null; // Do nothing in Node.js environment and IE8 (or lower) if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { autosize = function autosize(el) { return el; }; autosize.destroy = function (el) { return el; }; autosize.update = function (el) { return el; }; } else { autosize = function autosize(el, options) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], function (x) { return assign(x, options); }); } return el; }; autosize.destroy = function (el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], destroy); } return el; }; autosize.update = function (el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], update); } return el; }; } exports.default = autosize; module.exports = exports['default']; }); /***/ }), /***/ 5755: /***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; var nativeCodeString = '[native code]'; function classNames() { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { if (arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } } else if (argType === 'object') { if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { classes.push(arg.toString()); continue; } for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ 6109: /***/ ((module) => { // This code has been refactored for 140 bytes // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js var computedStyle = function (el, prop, getComputedStyle) { getComputedStyle = window.getComputedStyle; // In one fell swoop return ( // If we have getComputedStyle getComputedStyle ? // Query it // TODO: From CSS-Query notes, we might need (node, null) for FF getComputedStyle(el) : // Otherwise, we are in IE and use currentStyle el.currentStyle )[ // Switch to camelCase for CSSOM // DEV: Grabbed from jQuery // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 prop.replace(/-(\w)/gi, function (word, letter) { return letter.toUpperCase(); }) ]; }; module.exports = computedStyle; /***/ }), /***/ 66: /***/ ((module) => { "use strict"; var isMergeableObject = function isMergeableObject(value) { return isNonNullObject(value) && !isSpecial(value) }; function isNonNullObject(value) { return !!value && typeof value === 'object' } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value) } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE } function emptyTarget(val) { return Array.isArray(val) ? [] : {} } function cloneUnlessOtherwiseSpecified(value, options) { return (options.clone !== false && options.isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, options) : value } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options) }) } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge } var customMerge = options.customMerge(key); return typeof customMerge === 'function' ? customMerge : deepmerge } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol) }) : [] } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) } function propertyIsOnObject(object, property) { try { return property in object } catch(_) { return false } } // Protects from prototype poisoning and unexpected merging up the prototype chain. function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() // implementations can use it. The caller may not replace it. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options) } else if (sourceIsArray) { return options.arrayMerge(target, source, options) } else { return mergeObject(target, source, options) } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error('first argument should be an array') } return array.reduce(function(prev, next) { return deepmerge(prev, next, options) }, {}) }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; /***/ }), /***/ 461: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Load in dependencies var computedStyle = __webpack_require__(6109); /** * Calculate the `line-height` of a given node * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. * @returns {Number} `line-height` of the element in pixels */ function lineHeight(node) { // Grab the line-height via style var lnHeightStr = computedStyle(node, 'line-height'); var lnHeight = parseFloat(lnHeightStr, 10); // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') if (lnHeightStr === lnHeight + '') { // Save the old lineHeight style and update the em unit to the element var _lnHeightStyle = node.style.lineHeight; node.style.lineHeight = lnHeightStr + 'em'; // Calculate the em based height lnHeightStr = computedStyle(node, 'line-height'); lnHeight = parseFloat(lnHeightStr, 10); // Revert the lineHeight style if (_lnHeightStyle) { node.style.lineHeight = _lnHeightStyle; } else { delete node.style.lineHeight; } } // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) // DEV: `em` units are converted to `pt` in IE6 // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length if (lnHeightStr.indexOf('pt') !== -1) { lnHeight *= 4; lnHeight /= 3; // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) } else if (lnHeightStr.indexOf('mm') !== -1) { lnHeight *= 96; lnHeight /= 25.4; // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) } else if (lnHeightStr.indexOf('cm') !== -1) { lnHeight *= 96; lnHeight /= 2.54; // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) } else if (lnHeightStr.indexOf('in') !== -1) { lnHeight *= 96; // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) } else if (lnHeightStr.indexOf('pc') !== -1) { lnHeight *= 16; } // Continue our computation lnHeight = Math.round(lnHeight); // If the line-height is "normal", calculate by font-size if (lnHeightStr === 'normal') { // Create a temporary node var nodeName = node.nodeName; var _node = document.createElement(nodeName); _node.innerHTML = ' '; // If we have a text area, reset it to only 1 row // https://github.com/twolfson/line-height/issues/4 if (nodeName.toUpperCase() === 'TEXTAREA') { _node.setAttribute('rows', '1'); } // Set the font-size of the element var fontSizeStr = computedStyle(node, 'font-size'); _node.style.fontSize = fontSizeStr; // Remove default padding/border which can affect offset height // https://github.com/twolfson/line-height/issues/4 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight _node.style.padding = '0px'; _node.style.border = '0px'; // Append it to the body var body = document.body; body.appendChild(_node); // Assume the line height of the element is the height var height = _node.offsetHeight; lnHeight = height; // Remove our child from the DOM body.removeChild(_node); } // Return the calculated height return lnHeight; } // Export lineHeight module.exports = lineHeight; /***/ }), /***/ 628: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = __webpack_require__(4067); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bigint: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /***/ 5826: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(628)(); } /***/ }), /***/ 4067: /***/ ((module) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /***/ 4462: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; }; exports.__esModule = true; var React = __webpack_require__(1609); var PropTypes = __webpack_require__(5826); var autosize = __webpack_require__(4306); var _getLineHeight = __webpack_require__(461); var getLineHeight = _getLineHeight; var RESIZED = "autosize:resized"; /** * A light replacement for built-in textarea component * which automaticaly adjusts its height to match the content */ var TextareaAutosizeClass = /** @class */ (function (_super) { __extends(TextareaAutosizeClass, _super); function TextareaAutosizeClass() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { lineHeight: null }; _this.textarea = null; _this.onResize = function (e) { if (_this.props.onResize) { _this.props.onResize(e); } }; _this.updateLineHeight = function () { if (_this.textarea) { _this.setState({ lineHeight: getLineHeight(_this.textarea) }); } }; _this.onChange = function (e) { var onChange = _this.props.onChange; _this.currentValue = e.currentTarget.value; onChange && onChange(e); }; return _this; } TextareaAutosizeClass.prototype.componentDidMount = function () { var _this = this; var _a = this.props, maxRows = _a.maxRows, async = _a.async; if (typeof maxRows === "number") { this.updateLineHeight(); } if (typeof maxRows === "number" || async) { /* the defer is needed to: - force "autosize" to activate the scrollbar when this.props.maxRows is passed - support StyledComponents (see #71) */ setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); } else { this.textarea && autosize(this.textarea); } if (this.textarea) { this.textarea.addEventListener(RESIZED, this.onResize); } }; TextareaAutosizeClass.prototype.componentWillUnmount = function () { if (this.textarea) { this.textarea.removeEventListener(RESIZED, this.onResize); autosize.destroy(this.textarea); } }; TextareaAutosizeClass.prototype.render = function () { var _this = this; var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { _this.textarea = element; if (typeof _this.props.innerRef === 'function') { _this.props.innerRef(element); } else if (_this.props.innerRef) { _this.props.innerRef.current = element; } } }), children)); }; TextareaAutosizeClass.prototype.componentDidUpdate = function () { this.textarea && autosize.update(this.textarea); }; TextareaAutosizeClass.defaultProps = { rows: 1, async: false }; TextareaAutosizeClass.propTypes = { rows: PropTypes.number, maxRows: PropTypes.number, onResize: PropTypes.func, innerRef: PropTypes.any, async: PropTypes.bool }; return TextareaAutosizeClass; }(React.Component)); exports.TextareaAutosize = React.forwardRef(function (props, ref) { return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); }); /***/ }), /***/ 4132: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = true; var TextareaAutosize_1 = __webpack_require__(4462); exports.A = TextareaAutosize_1.TextareaAutosize; /***/ }), /***/ 3394: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; /** * @license React * react-jsx-runtime.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 f=__webpack_require__(1609),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}__webpack_unused_export__=l;exports.jsx=q;__webpack_unused_export__=q; /***/ }), /***/ 4922: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(3394); } else {} /***/ }), /***/ 9681: /***/ ((module) => { var characterMap = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Ấ": "A", "Ắ": "A", "Ẳ": "A", "Ẵ": "A", "Ặ": "A", "Æ": "AE", "Ầ": "A", "Ằ": "A", "Ȃ": "A", "Ả": "A", "Ạ": "A", "Ẩ": "A", "Ẫ": "A", "Ậ": "A", "Ç": "C", "Ḉ": "C", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ế": "E", "Ḗ": "E", "Ề": "E", "Ḕ": "E", "Ḝ": "E", "Ȇ": "E", "Ẻ": "E", "Ẽ": "E", "Ẹ": "E", "Ể": "E", "Ễ": "E", "Ệ": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ḯ": "I", "Ȋ": "I", "Ỉ": "I", "Ị": "I", "Ð": "D", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Ố": "O", "Ṍ": "O", "Ṓ": "O", "Ȏ": "O", "Ỏ": "O", "Ọ": "O", "Ổ": "O", "Ỗ": "O", "Ộ": "O", "Ờ": "O", "Ở": "O", "Ỡ": "O", "Ớ": "O", "Ợ": "O", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ủ": "U", "Ụ": "U", "Ử": "U", "Ữ": "U", "Ự": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "ấ": "a", "ắ": "a", "ẳ": "a", "ẵ": "a", "ặ": "a", "æ": "ae", "ầ": "a", "ằ": "a", "ȃ": "a", "ả": "a", "ạ": "a", "ẩ": "a", "ẫ": "a", "ậ": "a", "ç": "c", "ḉ": "c", "è": "e", "é": "e", "ê": "e", "ë": "e", "ế": "e", "ḗ": "e", "ề": "e", "ḕ": "e", "ḝ": "e", "ȇ": "e", "ẻ": "e", "ẽ": "e", "ẹ": "e", "ể": "e", "ễ": "e", "ệ": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ḯ": "i", "ȋ": "i", "ỉ": "i", "ị": "i", "ð": "d", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "ố": "o", "ṍ": "o", "ṓ": "o", "ȏ": "o", "ỏ": "o", "ọ": "o", "ổ": "o", "ỗ": "o", "ộ": "o", "ờ": "o", "ở": "o", "ỡ": "o", "ớ": "o", "ợ": "o", "ù": "u", "ú": "u", "û": "u", "ü": "u", "ủ": "u", "ụ": "u", "ử": "u", "ữ": "u", "ự": "u", "ý": "y", "ÿ": "y", "Ā": "A", "ā": "a", "Ă": "A", "ă": "a", "Ą": "A", "ą": "a", "Ć": "C", "ć": "c", "Ĉ": "C", "ĉ": "c", "Ċ": "C", "ċ": "c", "Č": "C", "č": "c", "C̆": "C", "c̆": "c", "Ď": "D", "ď": "d", "Đ": "D", "đ": "d", "Ē": "E", "ē": "e", "Ĕ": "E", "ĕ": "e", "Ė": "E", "ė": "e", "Ę": "E", "ę": "e", "Ě": "E", "ě": "e", "Ĝ": "G", "Ǵ": "G", "ĝ": "g", "ǵ": "g", "Ğ": "G", "ğ": "g", "Ġ": "G", "ġ": "g", "Ģ": "G", "ģ": "g", "Ĥ": "H", "ĥ": "h", "Ħ": "H", "ħ": "h", "Ḫ": "H", "ḫ": "h", "Ĩ": "I", "ĩ": "i", "Ī": "I", "ī": "i", "Ĭ": "I", "ĭ": "i", "Į": "I", "į": "i", "İ": "I", "ı": "i", "IJ": "IJ", "ij": "ij", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "Ḱ": "K", "ḱ": "k", "K̆": "K", "k̆": "k", "Ĺ": "L", "ĺ": "l", "Ļ": "L", "ļ": "l", "Ľ": "L", "ľ": "l", "Ŀ": "L", "ŀ": "l", "Ł": "l", "ł": "l", "Ḿ": "M", "ḿ": "m", "M̆": "M", "m̆": "m", "Ń": "N", "ń": "n", "Ņ": "N", "ņ": "n", "Ň": "N", "ň": "n", "ʼn": "n", "N̆": "N", "n̆": "n", "Ō": "O", "ō": "o", "Ŏ": "O", "ŏ": "o", "Ő": "O", "ő": "o", "Œ": "OE", "œ": "oe", "P̆": "P", "p̆": "p", "Ŕ": "R", "ŕ": "r", "Ŗ": "R", "ŗ": "r", "Ř": "R", "ř": "r", "R̆": "R", "r̆": "r", "Ȓ": "R", "ȓ": "r", "Ś": "S", "ś": "s", "Ŝ": "S", "ŝ": "s", "Ş": "S", "Ș": "S", "ș": "s", "ş": "s", "Š": "S", "š": "s", "Ţ": "T", "ţ": "t", "ț": "t", "Ț": "T", "Ť": "T", "ť": "t", "Ŧ": "T", "ŧ": "t", "T̆": "T", "t̆": "t", "Ũ": "U", "ũ": "u", "Ū": "U", "ū": "u", "Ŭ": "U", "ŭ": "u", "Ů": "U", "ů": "u", "Ű": "U", "ű": "u", "Ų": "U", "ų": "u", "Ȗ": "U", "ȗ": "u", "V̆": "V", "v̆": "v", "Ŵ": "W", "ŵ": "w", "Ẃ": "W", "ẃ": "w", "X̆": "X", "x̆": "x", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Y̆": "Y", "y̆": "y", "Ź": "Z", "ź": "z", "Ż": "Z", "ż": "z", "Ž": "Z", "ž": "z", "ſ": "s", "ƒ": "f", "Ơ": "O", "ơ": "o", "Ư": "U", "ư": "u", "Ǎ": "A", "ǎ": "a", "Ǐ": "I", "ǐ": "i", "Ǒ": "O", "ǒ": "o", "Ǔ": "U", "ǔ": "u", "Ǖ": "U", "ǖ": "u", "Ǘ": "U", "ǘ": "u", "Ǚ": "U", "ǚ": "u", "Ǜ": "U", "ǜ": "u", "Ứ": "U", "ứ": "u", "Ṹ": "U", "ṹ": "u", "Ǻ": "A", "ǻ": "a", "Ǽ": "AE", "ǽ": "ae", "Ǿ": "O", "ǿ": "o", "Þ": "TH", "þ": "th", "Ṕ": "P", "ṕ": "p", "Ṥ": "S", "ṥ": "s", "X́": "X", "x́": "x", "Ѓ": "Г", "ѓ": "г", "Ќ": "К", "ќ": "к", "A̋": "A", "a̋": "a", "E̋": "E", "e̋": "e", "I̋": "I", "i̋": "i", "Ǹ": "N", "ǹ": "n", "Ồ": "O", "ồ": "o", "Ṑ": "O", "ṑ": "o", "Ừ": "U", "ừ": "u", "Ẁ": "W", "ẁ": "w", "Ỳ": "Y", "ỳ": "y", "Ȁ": "A", "ȁ": "a", "Ȅ": "E", "ȅ": "e", "Ȉ": "I", "ȉ": "i", "Ȍ": "O", "ȍ": "o", "Ȑ": "R", "ȑ": "r", "Ȕ": "U", "ȕ": "u", "B̌": "B", "b̌": "b", "Č̣": "C", "č̣": "c", "Ê̌": "E", "ê̌": "e", "F̌": "F", "f̌": "f", "Ǧ": "G", "ǧ": "g", "Ȟ": "H", "ȟ": "h", "J̌": "J", "ǰ": "j", "Ǩ": "K", "ǩ": "k", "M̌": "M", "m̌": "m", "P̌": "P", "p̌": "p", "Q̌": "Q", "q̌": "q", "Ř̩": "R", "ř̩": "r", "Ṧ": "S", "ṧ": "s", "V̌": "V", "v̌": "v", "W̌": "W", "w̌": "w", "X̌": "X", "x̌": "x", "Y̌": "Y", "y̌": "y", "A̧": "A", "a̧": "a", "B̧": "B", "b̧": "b", "Ḑ": "D", "ḑ": "d", "Ȩ": "E", "ȩ": "e", "Ɛ̧": "E", "ɛ̧": "e", "Ḩ": "H", "ḩ": "h", "I̧": "I", "i̧": "i", "Ɨ̧": "I", "ɨ̧": "i", "M̧": "M", "m̧": "m", "O̧": "O", "o̧": "o", "Q̧": "Q", "q̧": "q", "U̧": "U", "u̧": "u", "X̧": "X", "x̧": "x", "Z̧": "Z", "z̧": "z", "й":"и", "Й":"И", "ё":"е", "Ё":"Е", }; var chars = Object.keys(characterMap).join('|'); var allAccents = new RegExp(chars, 'g'); var firstAccent = new RegExp(chars, ''); function matcher(match) { return characterMap[match]; } var removeAccents = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents; module.exports.has = hasAccents; 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"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 16: return value when it's Promise-like /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = this(value); /******/ if(mode & 8) return value; /******/ if(typeof value === 'object' && value) { /******/ if((mode & 4) && value.__esModule) return value; /******/ if((mode & 16) && typeof value.then === 'function') return value; /******/ } /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } /******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { PluginMoreMenuItem: () => (/* reexport */ plugin_more_menu_item), PluginSidebar: () => (/* reexport */ PluginSidebarEditSite), PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem), PluginTemplateSettingPanel: () => (/* reexport */ plugin_template_setting_panel), initializeEditor: () => (/* binding */ initializeEditor), reinitializeEditor: () => (/* binding */ reinitializeEditor), store: () => (/* reexport */ store_store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { closeModal: () => (closeModal), disableComplementaryArea: () => (disableComplementaryArea), enableComplementaryArea: () => (enableComplementaryArea), openModal: () => (openModal), pinItem: () => (pinItem), setDefaultComplementaryArea: () => (setDefaultComplementaryArea), setFeatureDefaults: () => (setFeatureDefaults), setFeatureValue: () => (setFeatureValue), toggleFeature: () => (toggleFeature), unpinItem: () => (unpinItem) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { getActiveComplementaryArea: () => (getActiveComplementaryArea), isComplementaryAreaLoading: () => (isComplementaryAreaLoading), isFeatureActive: () => (isFeatureActive), isItemPinned: () => (isItemPinned), isModalActive: () => (isModalActive) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js var private_actions_namespaceObject = {}; __webpack_require__.r(private_actions_namespaceObject); __webpack_require__.d(private_actions_namespaceObject, { removeTemplates: () => (removeTemplates), setCanvasMode: () => (setCanvasMode), setEditorCanvasContainerView: () => (setEditorCanvasContainerView) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/actions.js var store_actions_namespaceObject = {}; __webpack_require__.r(store_actions_namespaceObject); __webpack_require__.d(store_actions_namespaceObject, { __experimentalSetPreviewDeviceType: () => (__experimentalSetPreviewDeviceType), addTemplate: () => (addTemplate), closeGeneralSidebar: () => (closeGeneralSidebar), openGeneralSidebar: () => (openGeneralSidebar), openNavigationPanelToMenu: () => (openNavigationPanelToMenu), removeTemplate: () => (removeTemplate), revertTemplate: () => (revertTemplate), setEditedEntity: () => (setEditedEntity), setEditedPostContext: () => (setEditedPostContext), setHasPageContentFocus: () => (setHasPageContentFocus), setHomeTemplateId: () => (setHomeTemplateId), setIsInserterOpened: () => (setIsInserterOpened), setIsListViewOpened: () => (setIsListViewOpened), setIsNavigationPanelOpened: () => (setIsNavigationPanelOpened), setIsSaveViewOpened: () => (setIsSaveViewOpened), setNavigationMenu: () => (setNavigationMenu), setNavigationPanelActiveMenu: () => (setNavigationPanelActiveMenu), setPage: () => (setPage), setTemplate: () => (setTemplate), setTemplatePart: () => (setTemplatePart), switchEditorMode: () => (switchEditorMode), toggleDistractionFree: () => (toggleDistractionFree), toggleFeature: () => (actions_toggleFeature), updateSettings: () => (updateSettings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js var store_selectors_namespaceObject = {}; __webpack_require__.r(store_selectors_namespaceObject); __webpack_require__.d(store_selectors_namespaceObject, { __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), __experimentalGetPreviewDeviceType: () => (__experimentalGetPreviewDeviceType), getCanUserCreateMedia: () => (getCanUserCreateMedia), getCurrentTemplateNavigationPanelSubMenu: () => (getCurrentTemplateNavigationPanelSubMenu), getCurrentTemplateTemplateParts: () => (getCurrentTemplateTemplateParts), getEditedPostContext: () => (getEditedPostContext), getEditedPostId: () => (getEditedPostId), getEditedPostType: () => (getEditedPostType), getEditorMode: () => (getEditorMode), getHomeTemplateId: () => (getHomeTemplateId), getNavigationPanelActiveMenu: () => (getNavigationPanelActiveMenu), getPage: () => (getPage), getReusableBlocks: () => (getReusableBlocks), getSettings: () => (getSettings), hasPageContentFocus: () => (hasPageContentFocus), isFeatureActive: () => (selectors_isFeatureActive), isInserterOpened: () => (isInserterOpened), isListViewOpened: () => (isListViewOpened), isNavigationOpened: () => (isNavigationOpened), isPage: () => (isPage), isSaveViewOpened: () => (isSaveViewOpened) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-site/build-module/store/private-selectors.js var private_selectors_namespaceObject = {}; __webpack_require__.r(private_selectors_namespaceObject); __webpack_require__.d(private_selectors_namespaceObject, { getCanvasMode: () => (getCanvasMode), getEditorCanvasContainerView: () => (getEditorCanvasContainerView) }); // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(1609); var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); ;// CONCATENATED MODULE: external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// CONCATENATED MODULE: external ["wp","blockLibrary"] const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; ;// CONCATENATED MODULE: external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// CONCATENATED MODULE: 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"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: external ["wp","editor"] const external_wp_editor_namespaceObject = window["wp"]["editor"]; // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(5755); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); ;// CONCATENATED MODULE: external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// CONCATENATED MODULE: external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js /** * WordPress dependencies */ const check = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/icons/build-module/library/star-filled.js /** * WordPress dependencies */ const starFilled = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" })); /* harmony default export */ const star_filled = (starFilled); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/star-empty.js /** * WordPress dependencies */ const starEmpty = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z", clipRule: "evenodd" })); /* harmony default export */ const star_empty = (starEmpty); ;// CONCATENATED MODULE: external ["wp","viewport"] const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; ;// CONCATENATED MODULE: external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js /** * WordPress dependencies */ const closeSmall = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/interface/build-module/store/actions.js /** * WordPress dependencies */ /** * Set a default complementary area. * * @param {string} scope Complementary area scope. * @param {string} area Area identifier. * * @return {Object} Action object. */ const setDefaultComplementaryArea = (scope, area) => ({ type: 'SET_DEFAULT_COMPLEMENTARY_AREA', scope, area }); /** * Enable the complementary area. * * @param {string} scope Complementary area scope. * @param {string} area Area identifier. */ const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => { // Return early if there's no area. if (!area) { return; } const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); if (!isComplementaryAreaVisible) { registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true); } dispatch({ type: 'ENABLE_COMPLEMENTARY_AREA', scope, area }); }; /** * Disable the complementary area. * * @param {string} scope Complementary area scope. */ const disableComplementaryArea = scope => ({ registry }) => { const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); if (isComplementaryAreaVisible) { registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false); } }; /** * Pins an item. * * @param {string} scope Item scope. * @param {string} item Item identifier. * * @return {Object} Action object. */ const pinItem = (scope, item) => ({ registry }) => { // Return early if there's no item. if (!item) { return; } const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do. if (pinnedItems?.[item] === true) { return; } registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, [item]: true }); }; /** * Unpins an item. * * @param {string} scope Item scope. * @param {string} item Item identifier. */ const unpinItem = (scope, item) => ({ registry }) => { // Return early if there's no item. if (!item) { return; } const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, [item]: false }); }; /** * Returns an action object used in signalling that a feature should be toggled. * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {string} featureName The feature name. */ function toggleFeature(scope, featureName) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).toggle` }); registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); }; } /** * Returns an action object used in signalling that a feature should be set to * a true or false value * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {string} featureName The feature name. * @param {boolean} value The value to set. * * @return {Object} Action object. */ function setFeatureValue(scope, featureName, value) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).set` }); registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); }; } /** * Returns an action object used in signalling that defaults should be set for features. * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {Object} defaults A key/value map of feature names to values. * * @return {Object} Action object. */ function setFeatureDefaults(scope, defaults) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).setDefaults` }); registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); }; } /** * Returns an action object used in signalling that the user opened a modal. * * @param {string} name A string that uniquely identifies the modal. * * @return {Object} Action object. */ function openModal(name) { return { type: 'OPEN_MODAL', name }; } /** * Returns an action object signalling that the user closed a modal. * * @return {Object} Action object. */ function closeModal() { return { type: 'CLOSE_MODAL' }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/selectors.js /** * WordPress dependencies */ /** * Returns the complementary area that is active in a given scope. * * @param {Object} state Global application state. * @param {string} scope Item scope. * * @return {string | null | undefined} The complementary area that is active in the given scope. */ const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled // visibility, this is the vanilla default. Other code relies on this // nuance in the return value. if (isComplementaryAreaVisible === undefined) { return undefined; } // Return `null` to indicate the user hid the complementary area. if (isComplementaryAreaVisible === false) { return null; } return state?.complementaryAreas?.[scope]; }); const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { const isVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); const identifier = state?.complementaryAreas?.[scope]; return isVisible && identifier === undefined; }); /** * Returns a boolean indicating if an item is pinned or not. * * @param {Object} state Global application state. * @param {string} scope Scope. * @param {string} item Item to check. * * @return {boolean} True if the item is pinned and false otherwise. */ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => { var _pinnedItems$item; const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true; }); /** * Returns a boolean indicating whether a feature is active for a particular * scope. * * @param {Object} state The store state. * @param {string} scope The scope of the feature (e.g. core/edit-post). * @param {string} featureName The name of the feature. * * @return {boolean} Is the feature enabled? */ const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => { external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, { since: '6.0', alternative: `select( 'core/preferences' ).get( scope, featureName )` }); return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); }); /** * Returns true if a modal is active, or false otherwise. * * @param {Object} state Global application state. * @param {string} modalName A string that uniquely identifies the modal. * * @return {boolean} Whether the modal is active. */ function isModalActive(state, modalName) { return state.activeModal === modalName; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/reducer.js /** * WordPress dependencies */ function complementaryAreas(state = {}, action) { switch (action.type) { case 'SET_DEFAULT_COMPLEMENTARY_AREA': { const { scope, area } = action; // If there's already an area, don't overwrite it. if (state[scope]) { return state; } return { ...state, [scope]: area }; } case 'ENABLE_COMPLEMENTARY_AREA': { const { scope, area } = action; return { ...state, [scope]: area }; } } return state; } /** * Reducer for storing the name of the open modal, or null if no modal is open. * * @param {Object} state Previous state. * @param {Object} action Action object containing the `name` of the modal * * @return {Object} Updated state */ function activeModal(state = null, action) { switch (action.type) { case 'OPEN_MODAL': return action.name; case 'CLOSE_MODAL': return null; } return state; } /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ complementaryAreas, activeModal })); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/constants.js /** * The identifier for the data store. * * @type {string} */ const STORE_NAME = 'core/interface'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Store definition for the interface namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject }); // Once we build a more generic persistence plugin that works across types of stores // we'd be able to replace this with a register call. (0,external_wp_data_namespaceObject.register)(store); ;// CONCATENATED MODULE: external ["wp","plugins"] const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-context/index.js /** * WordPress dependencies */ /* harmony default export */ const complementary_area_context = ((0,external_wp_plugins_namespaceObject.withPluginContext)((context, ownProps) => { return { icon: ownProps.icon || context.icon, identifier: ownProps.identifier || `${context.name}/${ownProps.name}` }; })); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ComplementaryAreaToggle({ as = external_wp_components_namespaceObject.Button, scope, identifier, icon, selectedIcon, name, ...props }) { const ComponentToUse = as; const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope]); const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_React_.createElement)(ComponentToUse, { icon: selectedIcon && isSelected ? selectedIcon : icon, "aria-controls": identifier.replace('/', ':'), onClick: () => { if (isSelected) { disableComplementaryArea(scope); } else { enableComplementaryArea(scope, identifier); } }, ...props }); } /* harmony default export */ const complementary_area_toggle = (complementary_area_context(ComplementaryAreaToggle)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ComplementaryAreaHeader = ({ smallScreenTitle, children, className, toggleButtonProps }) => { const toggleButton = (0,external_React_.createElement)(complementary_area_toggle, { icon: close_small, ...toggleButtonProps }); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { className: "components-panel__header interface-complementary-area-header__small" }, smallScreenTitle && (0,external_React_.createElement)("span", { className: "interface-complementary-area-header__small-title" }, smallScreenTitle), toggleButton), (0,external_React_.createElement)("div", { className: classnames_default()('components-panel__header', 'interface-complementary-area-header', className), tabIndex: -1 }, children, toggleButton)); }; /* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/action-item/index.js /** * WordPress dependencies */ const noop = () => {}; function ActionItemSlot({ name, as: Component = external_wp_components_namespaceObject.ButtonGroup, fillProps = {}, bubblesVirtually, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Slot, { name: name, bubblesVirtually: bubblesVirtually, fillProps: fillProps }, fills => { if (!external_wp_element_namespaceObject.Children.toArray(fills).length) { return null; } // Special handling exists for backward compatibility. // It ensures that menu items created by plugin authors aren't // duplicated with automatically injected menu items coming // from pinnable plugin sidebars. // @see https://github.com/WordPress/gutenberg/issues/14457 const initializedByPlugins = []; external_wp_element_namespaceObject.Children.forEach(fills, ({ props: { __unstableExplicitMenuItem, __unstableTarget } }) => { if (__unstableTarget && __unstableExplicitMenuItem) { initializedByPlugins.push(__unstableTarget); } }); const children = external_wp_element_namespaceObject.Children.map(fills, child => { if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) { return null; } return child; }); return (0,external_React_.createElement)(Component, { ...props }, children); }); } function ActionItem({ name, as: Component = external_wp_components_namespaceObject.Button, onClick, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Fill, { name: name }, ({ onClick: fpOnClick }) => { return (0,external_React_.createElement)(Component, { onClick: onClick || fpOnClick ? (...args) => { (onClick || noop)(...args); (fpOnClick || noop)(...args); } : undefined, ...props }); }); } ActionItem.Slot = ActionItemSlot; /* harmony default export */ const action_item = (ActionItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const PluginsMenuItem = ({ // Menu item is marked with unstable prop for backward compatibility. // They are removed so they don't leak to DOM elements. // @see https://github.com/WordPress/gutenberg/issues/14457 __unstableExplicitMenuItem, __unstableTarget, ...restProps }) => (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { ...restProps }); function ComplementaryAreaMoreMenuItem({ scope, target, __unstableExplicitMenuItem, ...props }) { return (0,external_React_.createElement)(complementary_area_toggle, { as: toggleProps => { return (0,external_React_.createElement)(action_item, { __unstableExplicitMenuItem: __unstableExplicitMenuItem, __unstableTarget: `${scope}/${target}`, as: PluginsMenuItem, name: `${scope}/plugin-more-menu`, ...toggleProps }); }, role: "menuitemcheckbox", selectedIcon: library_check, name: target, scope: scope, ...props }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js /** * External dependencies */ /** * WordPress dependencies */ function PinnedItems({ scope, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Fill, { name: `PinnedItems/${scope}`, ...props }); } function PinnedItemsSlot({ scope, className, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Slot, { name: `PinnedItems/${scope}`, ...props }, fills => fills?.length > 0 && (0,external_React_.createElement)("div", { className: classnames_default()(className, 'interface-pinned-items') }, fills)); } PinnedItems.Slot = PinnedItemsSlot; /* harmony default export */ const pinned_items = (PinnedItems); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ComplementaryAreaSlot({ scope, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Slot, { name: `ComplementaryArea/${scope}`, ...props }); } function ComplementaryAreaFill({ scope, children, className, id }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Fill, { name: `ComplementaryArea/${scope}` }, (0,external_React_.createElement)("div", { id: id, className: className }, children)); } function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { const previousIsSmall = (0,external_wp_element_namespaceObject.useRef)(false); const shouldOpenWhenNotSmall = (0,external_wp_element_namespaceObject.useRef)(false); const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); (0,external_wp_element_namespaceObject.useEffect)(() => { // If the complementary area is active and the editor is switching from // a big to a small window size. if (isActive && isSmall && !previousIsSmall.current) { disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size // goes from small to big. shouldOpenWhenNotSmall.current = true; } else if ( // If there is a flag indicating the complementary area should be // enabled when we go from small to big window size and we are going // from a small to big window size. shouldOpenWhenNotSmall.current && !isSmall && previousIsSmall.current) { // Remove the flag indicating the complementary area should be // enabled. shouldOpenWhenNotSmall.current = false; enableComplementaryArea(scope, identifier); } else if ( // If the flag is indicating the current complementary should be // reopened but another complementary area becomes active, remove // the flag. shouldOpenWhenNotSmall.current && activeArea && activeArea !== identifier) { shouldOpenWhenNotSmall.current = false; } if (isSmall !== previousIsSmall.current) { previousIsSmall.current = isSmall; } }, [isActive, isSmall, scope, identifier, activeArea, disableComplementaryArea, enableComplementaryArea]); } function ComplementaryArea({ children, className, closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), identifier, header, headerClassName, icon, isPinnable = true, panelClassName, scope, name, smallScreenTitle, title, toggleShortcut, isActiveByDefault }) { const { isLoading, isActive, isPinned, activeArea, isSmall, isLarge, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getActiveComplementaryArea, isComplementaryAreaLoading, isItemPinned } = select(store); const { get } = select(external_wp_preferences_namespaceObject.store); const _activeArea = getActiveComplementaryArea(scope); return { isLoading: isComplementaryAreaLoading(scope), isActive: _activeArea === identifier, isPinned: isItemPinned(scope, identifier), activeArea: _activeArea, isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'), isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large'), showIconLabels: get('core', 'showIconLabels') }; }, [identifier, scope]); useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); const { enableComplementaryArea, disableComplementaryArea, pinItem, unpinItem } = (0,external_wp_data_namespaceObject.useDispatch)(store); (0,external_wp_element_namespaceObject.useEffect)(() => { // Set initial visibility: For large screens, enable if it's active by // default. For small screens, always initially disable. if (isActiveByDefault && activeArea === undefined && !isSmall) { enableComplementaryArea(scope, identifier); } else if (activeArea === undefined && isSmall) { disableComplementaryArea(scope, identifier); } }, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]); return (0,external_React_.createElement)(external_React_.Fragment, null, isPinnable && (0,external_React_.createElement)(pinned_items, { scope: scope }, isPinned && (0,external_React_.createElement)(complementary_area_toggle, { scope: scope, identifier: identifier, isPressed: isActive && (!showIconLabels || isLarge), "aria-expanded": isActive, "aria-disabled": isLoading, label: title, icon: showIconLabels ? library_check : icon, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, size: "compact" })), name && isPinnable && (0,external_React_.createElement)(ComplementaryAreaMoreMenuItem, { target: name, scope: scope, icon: icon }, title), isActive && (0,external_React_.createElement)(ComplementaryAreaFill, { className: classnames_default()('interface-complementary-area', className), scope: scope, id: identifier.replace('/', ':') }, (0,external_React_.createElement)(complementary_area_header, { className: headerClassName, closeLabel: closeLabel, onClose: () => disableComplementaryArea(scope), smallScreenTitle: smallScreenTitle, toggleButtonProps: { label: closeLabel, shortcut: toggleShortcut, scope, identifier } }, header || (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("strong", null, title), isPinnable && (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { className: "interface-complementary-area__pin-unpin-item", icon: isPinned ? star_filled : star_empty, label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier), isPressed: isPinned, "aria-expanded": isPinned }))), (0,external_React_.createElement)(external_wp_components_namespaceObject.Panel, { className: panelClassName }, children))); } const ComplementaryAreaWrapped = complementary_area_context(ComplementaryArea); ComplementaryAreaWrapped.Slot = ComplementaryAreaSlot; /* harmony default export */ const complementary_area = (ComplementaryAreaWrapped); ;// CONCATENATED MODULE: external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js /** * External dependencies */ function NavigableRegion({ children, className, ariaLabel, as: Tag = 'div', ...props }) { return (0,external_React_.createElement)(Tag, { className: classnames_default()('interface-navigable-region', className), "aria-label": ariaLabel, role: "region", tabIndex: "-1", ...props }, children); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function useHTMLClass(className) { (0,external_wp_element_namespaceObject.useEffect)(() => { const element = document && document.querySelector(`html:not(.${className})`); if (!element) { return; } element.classList.toggle(className); return () => { element.classList.toggle(className); }; }, [className]); } const headerVariants = { hidden: { opacity: 0 }, hover: { opacity: 1, transition: { type: 'tween', delay: 0.2, delayChildren: 0.2 } }, distractionFreeInactive: { opacity: 1, transition: { delay: 0 } } }; function InterfaceSkeleton({ isDistractionFree, footer, header, editorNotices, sidebar, secondarySidebar, notices, content, actions, labels, className, enableRegionNavigation = true, // Todo: does this need to be a prop. // Can we use a dependency to keyboard-shortcuts directly? shortcuts }, ref) { const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(shortcuts); useHTMLClass('interface-interface-skeleton__html-container'); const defaultLabels = { /* translators: accessibility text for the top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject._x)('Header', 'header landmark area'), /* translators: accessibility text for the content landmark region. */ body: (0,external_wp_i18n_namespaceObject.__)('Content'), /* translators: accessibility text for the secondary sidebar landmark region. */ secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'), /* translators: accessibility text for the settings landmark region. */ sidebar: (0,external_wp_i18n_namespaceObject.__)('Settings'), /* translators: accessibility text for the publish landmark region. */ actions: (0,external_wp_i18n_namespaceObject.__)('Publish'), /* translators: accessibility text for the footer landmark region. */ footer: (0,external_wp_i18n_namespaceObject.__)('Footer') }; const mergedLabels = { ...defaultLabels, ...labels }; return (0,external_React_.createElement)("div", { ...(enableRegionNavigation ? navigateRegionsProps : {}), ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, enableRegionNavigation ? navigateRegionsProps.ref : undefined]), className: classnames_default()(className, 'interface-interface-skeleton', navigateRegionsProps.className, !!footer && 'has-footer') }, (0,external_React_.createElement)("div", { className: "interface-interface-skeleton__editor" }, !!header && (0,external_React_.createElement)(NavigableRegion, { as: external_wp_components_namespaceObject.__unstableMotion.div, className: "interface-interface-skeleton__header", "aria-label": mergedLabels.header, initial: isDistractionFree ? 'hidden' : 'distractionFreeInactive', whileHover: isDistractionFree ? 'hover' : 'distractionFreeInactive', animate: isDistractionFree ? 'hidden' : 'distractionFreeInactive', variants: headerVariants, transition: isDistractionFree ? { type: 'tween', delay: 0.8 } : undefined }, header), isDistractionFree && (0,external_React_.createElement)("div", { className: "interface-interface-skeleton__header" }, editorNotices), (0,external_React_.createElement)("div", { className: "interface-interface-skeleton__body" }, !!secondarySidebar && (0,external_React_.createElement)(NavigableRegion, { className: "interface-interface-skeleton__secondary-sidebar", ariaLabel: mergedLabels.secondarySidebar }, secondarySidebar), !!notices && (0,external_React_.createElement)("div", { className: "interface-interface-skeleton__notices" }, notices), (0,external_React_.createElement)(NavigableRegion, { className: "interface-interface-skeleton__content", ariaLabel: mergedLabels.body }, content), !!sidebar && (0,external_React_.createElement)(NavigableRegion, { className: "interface-interface-skeleton__sidebar", ariaLabel: mergedLabels.sidebar }, sidebar), !!actions && (0,external_React_.createElement)(NavigableRegion, { className: "interface-interface-skeleton__actions", ariaLabel: mergedLabels.actions }, actions))), !!footer && (0,external_React_.createElement)(NavigableRegion, { className: "interface-interface-skeleton__footer", ariaLabel: mergedLabels.footer }, footer)); } /* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ const moreVertical = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" })); /* harmony default export */ const more_vertical = (moreVertical); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/more-menu-dropdown/index.js /** * External dependencies */ /** * WordPress dependencies */ function MoreMenuDropdown({ as: DropdownComponent = external_wp_components_namespaceObject.DropdownMenu, className, /* translators: button label text should, if possible, be under 16 characters. */ label = (0,external_wp_i18n_namespaceObject.__)('Options'), popoverProps, toggleProps, children }) { return (0,external_React_.createElement)(DropdownComponent, { className: classnames_default()('interface-more-menu-dropdown', className), icon: more_vertical, label: label, popoverProps: { placement: 'bottom-end', ...popoverProps, className: classnames_default()('interface-more-menu-dropdown__content', popoverProps?.className) }, toggleProps: { tooltipPosition: 'bottom', ...toggleProps, size: 'compact' } }, onClose => children(onClose)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js ;// CONCATENATED MODULE: external ["wp","widgets"] const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; ;// CONCATENATED MODULE: external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// CONCATENATED MODULE: external ["wp","mediaUtils"] const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/components.js /** * WordPress dependencies */ (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-site/components/media-upload', () => external_wp_mediaUtils_namespaceObject.MediaUpload); ;// CONCATENATED MODULE: external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// CONCATENATED MODULE: external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// CONCATENATED MODULE: external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// CONCATENATED MODULE: ./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 j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; ;// CONCATENATED MODULE: ./node_modules/colord/plugins/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: external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/edit-site'); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/hooks.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useGlobalSetting, useGlobalStyle } = unlock(external_wp_blockEditor_namespaceObject.privateApis); // Enable colord's a11y plugin. k([a11y]); function useColorRandomizer(name) { const [themeColors, setThemeColors] = useGlobalSetting('color.palette.theme', name); function randomizeColors() { /* eslint-disable no-restricted-syntax */ const randomRotationValue = Math.floor(Math.random() * 225); /* eslint-enable no-restricted-syntax */ const newColors = themeColors.map(colorObject => { const { color } = colorObject; const newColor = w(color).rotate(randomRotationValue).toHex(); return { ...colorObject, color: newColor }; }); setThemeColors(newColors); } return window.__experimentalEnableColorRandomizer ? [randomizeColors] : []; } function useStylesPreviewColors() { const [textColor = 'black'] = useGlobalStyle('color.text'); const [backgroundColor = 'white'] = useGlobalStyle('color.background'); const [headingColor = textColor] = useGlobalStyle('elements.h1.color.text'); const [coreColors] = useGlobalSetting('color.palette.core'); const [themeColors] = useGlobalSetting('color.palette.theme'); const [customColors] = useGlobalSetting('color.palette.custom'); const paletteColors = (themeColors !== null && themeColors !== void 0 ? themeColors : []).concat(customColors !== null && customColors !== void 0 ? customColors : []).concat(coreColors !== null && coreColors !== void 0 ? coreColors : []); const highlightedColors = paletteColors.filter( // we exclude these two colors because they are already visible in the preview. ({ color }) => color !== backgroundColor && color !== headingColor).slice(0, 2); return { paletteColors, highlightedColors }; } function useSupportedStyles(name, element) { const { supportedPanels } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { supportedPanels: unlock(select(external_wp_blocks_namespaceObject.store)).getSupportedStyles(name, element) }; }, [name, element]); return supportedPanels; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/push-changes-to-global-styles/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject, 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 // to global styles as well. const STYLE_PROPERTY = { ...external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY, blockGap: { value: ['spacing', 'blockGap'] } }; // TODO: Temporary duplication of constant in @wordpress/block-editor. Can be // removed by moving PushChangesToGlobalStylesControl to // @wordpress/block-editor. const STYLE_PATH_TO_CSS_VAR_INFIX = { 'border.color': 'color', 'color.background': 'color', 'color.text': 'color', 'elements.link.color.text': 'color', 'elements.link.:hover.color.text': 'color', 'elements.link.typography.fontFamily': 'font-family', 'elements.link.typography.fontSize': 'font-size', 'elements.button.color.text': 'color', 'elements.button.color.background': 'color', 'elements.button.typography.fontFamily': 'font-family', 'elements.button.typography.fontSize': 'font-size', 'elements.caption.color.text': 'color', 'elements.heading.color': 'color', 'elements.heading.color.background': 'color', 'elements.heading.typography.fontFamily': 'font-family', 'elements.heading.gradient': 'gradient', 'elements.heading.color.gradient': 'gradient', 'elements.h1.color': 'color', 'elements.h1.color.background': 'color', 'elements.h1.typography.fontFamily': 'font-family', 'elements.h1.color.gradient': 'gradient', 'elements.h2.color': 'color', 'elements.h2.color.background': 'color', 'elements.h2.typography.fontFamily': 'font-family', 'elements.h2.color.gradient': 'gradient', 'elements.h3.color': 'color', 'elements.h3.color.background': 'color', 'elements.h3.typography.fontFamily': 'font-family', 'elements.h3.color.gradient': 'gradient', 'elements.h4.color': 'color', 'elements.h4.color.background': 'color', 'elements.h4.typography.fontFamily': 'font-family', 'elements.h4.color.gradient': 'gradient', 'elements.h5.color': 'color', 'elements.h5.color.background': 'color', 'elements.h5.typography.fontFamily': 'font-family', 'elements.h5.color.gradient': 'gradient', 'elements.h6.color': 'color', 'elements.h6.color.background': 'color', 'elements.h6.typography.fontFamily': 'font-family', 'elements.h6.color.gradient': 'gradient', 'color.gradient': 'gradient', blockGap: 'spacing', 'typography.fontSize': 'font-size', 'typography.fontFamily': 'font-family' }; // TODO: Temporary duplication of constant in @wordpress/block-editor. Can be // removed by moving PushChangesToGlobalStylesControl to // @wordpress/block-editor. const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = { 'border.color': 'borderColor', 'color.background': 'backgroundColor', 'color.text': 'textColor', 'color.gradient': 'gradient', 'typography.fontSize': 'fontSize', 'typography.fontFamily': 'fontFamily' }; const SUPPORTED_STYLES = ['border', 'color', 'spacing', 'typography']; const getValueFromObjectPath = (object, path) => { let value = object; path.forEach(fieldName => { value = value?.[fieldName]; }); return value; }; const flatBorderProperties = ['borderColor', 'borderWidth', 'borderStyle']; const sides = ['top', 'right', 'bottom', 'left']; function getBorderStyleChanges(border, presetColor, userStyle) { if (!border && !presetColor) { return []; } const changes = [...getFallbackBorderStyleChange('top', border, userStyle), ...getFallbackBorderStyleChange('right', border, userStyle), ...getFallbackBorderStyleChange('bottom', border, userStyle), ...getFallbackBorderStyleChange('left', border, userStyle)]; // Handle a flat border i.e. all sides the same, CSS shorthand. const { color: customColor, style, width } = border || {}; const hasColorOrWidth = presetColor || customColor || width; if (hasColorOrWidth && !style) { // Global Styles need individual side configurations to overcome // theme.json configurations which are per side as well. sides.forEach(side => { // Only add fallback border-style if global styles don't already // have something set. if (!userStyle?.[side]?.style) { changes.push({ path: ['border', side, 'style'], value: 'solid' }); } }); } return changes; } function getFallbackBorderStyleChange(side, border, globalBorderStyle) { if (!border?.[side] || globalBorderStyle?.[side]?.style) { return []; } const { color, style, width } = border[side]; const hasColorOrWidth = color || width; if (!hasColorOrWidth || style) { return []; } return [{ path: ['border', side, 'style'], value: 'solid' }]; } function useChangesToPush(name, attributes, userConfig) { const supports = useSupportedStyles(name); const blockUserConfig = userConfig?.styles?.blocks?.[name]; return (0,external_wp_element_namespaceObject.useMemo)(() => { const changes = supports.flatMap(key => { if (!STYLE_PROPERTY[key]) { return []; } const { value: path } = STYLE_PROPERTY[key]; const presetAttributeKey = path.join('.'); const presetAttributeValue = attributes[STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[presetAttributeKey]]; const value = presetAttributeValue ? `var:preset|${STYLE_PATH_TO_CSS_VAR_INFIX[presetAttributeKey]}|${presetAttributeValue}` : getValueFromObjectPath(attributes.style, path); // Links only have a single support entry but have two element // style properties, color and hover color. The following check // will add the hover color to the changes if required. if (key === 'linkColor') { const linkChanges = value ? [{ path, value }] : []; const hoverPath = ['elements', 'link', ':hover', 'color', 'text']; const hoverValue = getValueFromObjectPath(attributes.style, hoverPath); if (hoverValue) { linkChanges.push({ path: hoverPath, value: hoverValue }); } return linkChanges; } // The shorthand border styles can't be mapped directly as global // styles requires longhand config. if (flatBorderProperties.includes(key) && value) { // The shorthand config path is included to clear the block attribute. const borderChanges = [{ path, value }]; sides.forEach(side => { const currentPath = [...path]; currentPath.splice(-1, 0, side); borderChanges.push({ path: currentPath, value }); }); return borderChanges; } return value ? [{ path, value }] : []; }); // To ensure display of a visible border, global styles require a // default border style if a border color or width is present. getBorderStyleChanges(attributes.style?.border, attributes.borderColor, blockUserConfig?.border).forEach(change => changes.push(change)); return changes; }, [supports, attributes, blockUserConfig]); } /** * Sets the value at path of object. * If a portion of path doesn’t exist, it’s created. * Arrays are created for missing index properties while objects are created * for all other missing properties. * * This function intentionally mutates the input object. * * Inspired by _.set(). * * @see https://lodash.com/docs/4.17.15#set * * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`. * * @param {Object} object Object to modify * @param {Array} path Path of the property to set. * @param {*} value Value to set. */ function setNestedValue(object, path, value) { if (!object || typeof object !== 'object') { return object; } path.reduce((acc, key, idx) => { if (acc[key] === undefined) { if (Number.isInteger(path[idx + 1])) { acc[key] = []; } else { acc[key] = {}; } } if (idx === path.length - 1) { acc[key] = value; } return acc[key]; }, object); return object; } function cloneDeep(object) { return !object ? {} : JSON.parse(JSON.stringify(object)); } function PushChangesToGlobalStylesControl({ name, attributes, setAttributes }) { const { user: userConfig, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const changes = useChangesToPush(name, attributes, userConfig); const { __unstableMarkNextChangeAsNotPersistent } = (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 pushChanges = (0,external_wp_element_namespaceObject.useCallback)(() => { if (changes.length === 0) { return; } if (changes.length > 0) { const { style: blockStyles } = attributes; const newBlockStyles = cloneDeep(blockStyles); const newUserConfig = cloneDeep(userConfig); for (const { path, value } of changes) { setNestedValue(newBlockStyles, path, undefined); setNestedValue(newUserConfig, ['styles', 'blocks', name, ...path], value); } const newBlockAttributes = { borderColor: undefined, backgroundColor: undefined, textColor: undefined, gradient: undefined, fontSize: undefined, fontFamily: undefined, style: cleanEmptyObject(newBlockStyles) }; // @wordpress/core-data doesn't support editing multiple entity types in // a single undo level. So for now, we disable @wordpress/core-data undo // tracking and implement our own Undo button in the snackbar // notification. __unstableMarkNextChangeAsNotPersistent(); setAttributes(newBlockAttributes); setUserConfig(() => newUserConfig, { undoIgnore: true }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the block e.g. 'Heading'. (0,external_wp_i18n_namespaceObject.__)('%s styles applied.'), (0,external_wp_blocks_namespaceObject.getBlockType)(name).title), { type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick() { __unstableMarkNextChangeAsNotPersistent(); setAttributes(attributes); setUserConfig(() => userConfig, { undoIgnore: true }); } }] }); } }, [__unstableMarkNextChangeAsNotPersistent, attributes, changes, createSuccessNotice, name, setAttributes, setUserConfig, userConfig]); return (0,external_React_.createElement)(external_wp_components_namespaceObject.BaseControl, { 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'. (0,external_wp_i18n_namespaceObject.__)('Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'), (0,external_wp_blocks_namespaceObject.getBlockType)(name).title) }, (0,external_React_.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Styles')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", disabled: changes.length === 0, onClick: pushChanges }, (0,external_wp_i18n_namespaceObject.__)('Apply globally'))); } function PushChangesToGlobalStyles(props) { const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme, []); const supportsStyles = SUPPORTED_STYLES.some(feature => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(props.name, feature)); const isDisplayed = blockEditingMode === 'default' && supportsStyles && isBlockBasedTheme; if (!isDisplayed) { return null; } return (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.InspectorAdvancedControls, null, (0,external_React_.createElement)(PushChangesToGlobalStylesControl, { ...props })); } const withPushChangesToGlobalStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(BlockEdit, { ...props }), props.isSelected && (0,external_React_.createElement)(PushChangesToGlobalStyles, { ...props }))); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-site/push-changes-to-global-styles', withPushChangesToGlobalStyles); ;// CONCATENATED MODULE: external ["wp","router"] const external_wp_router_namespaceObject = window["wp"]["router"]; ;// CONCATENATED MODULE: external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// 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 } = unlock(external_wp_router_namespaceObject.privateApis); function useLink(params, state, shouldReplace = false) { const history = 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 (0,external_React_.createElement)("a", { href: href, onClick: onClick, ...props }, children); } ;// CONCATENATED MODULE: external ["wp","patterns"] const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/constants.js /** * WordPress dependencies */ /** * Internal dependencies */ // Navigation const NAVIGATION_POST_TYPE = 'wp_navigation'; // Templates. const constants_TEMPLATE_POST_TYPE = 'wp_template'; const TEMPLATE_PART_POST_TYPE = 'wp_template_part'; const TEMPLATE_ORIGINS = { custom: 'custom', theme: 'theme', plugin: 'plugin' }; const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized'; // Patterns. const { PATTERN_TYPES, PATTERN_DEFAULT_CATEGORY, PATTERN_USER_CATEGORY, EXCLUDED_PATTERN_SOURCES, PATTERN_SYNC_TYPES } = 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]; const POST_TYPE_LABELS = { [constants_TEMPLATE_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Template'), [TEMPLATE_PART_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Template part'), [PATTERN_TYPES.user]: (0,external_wp_i18n_namespaceObject.__)('Pattern'), [NAVIGATION_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Navigation') }; // DataViews constants const LAYOUT_GRID = 'grid'; const LAYOUT_TABLE = 'table'; const LAYOUT_LIST = 'list'; const ENUMERATION_TYPE = 'enumeration'; const OPERATOR_IN = 'in'; const OPERATOR_NOT_IN = 'notIn'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/template-part-edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function EditTemplatePartMenuItem({ attributes }) { const { theme, slug } = attributes; const { params } = useLocation(); const templatePart = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentTheme, getEntityRecord } = select(external_wp_coreData_namespaceObject.store); return getEntityRecord('postType', TEMPLATE_PART_POST_TYPE, // Ideally this should be an official public API. `${theme || getCurrentTheme()?.stylesheet}//${slug}`); }, [theme, slug]); const linkProps = useLink({ postId: templatePart?.id, postType: templatePart?.type, canvas: 'edit' }, { fromTemplateId: params.postId || templatePart?.id }); if (!templatePart) { return null; } return (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarButton, { ...linkProps, onClick: event => { linkProps.onClick(event); } }, (0,external_wp_i18n_namespaceObject.__)('Edit')); } const withEditBlockControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { const { attributes, name } = props; const isDisplayed = name === 'core/template-part' && attributes.slug; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(BlockEdit, { key: "edit", ...props }), isDisplayed && (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other" }, (0,external_React_.createElement)(EditTemplatePartMenuItem, { attributes: attributes }))); }, 'withEditBlockControls'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-site/template-part-edit-button', withEditBlockControls); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/navigation-menu-edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: navigation_menu_edit_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function NavigationMenuEdit({ attributes }) { const { ref } = attributes; const { params } = navigation_menu_edit_useLocation(); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const navigationMenu = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', NAVIGATION_POST_TYPE, // Ideally this should be an official public API. ref); }, [ref]); const linkProps = useLink({ postId: navigationMenu?.id, postType: navigationMenu?.type, canvas: 'edit' }, { // this applies to Navigation Menus as well. fromTemplateId: params.postId || navigationMenu?.id }); // A non-default setting for block editing mode indicates that the // editor should restrict "editing" actions. Therefore the `Edit` button // should not be displayed. if (!navigationMenu || blockEditingMode !== 'default') { return null; } return (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarButton, { ...linkProps, onClick: event => { linkProps.onClick(event); } }, (0,external_wp_i18n_namespaceObject.__)('Edit'))); } const navigation_menu_edit_withEditBlockControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { const { attributes, name } = props; const isDisplayed = name === 'core/navigation' && attributes.ref; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(BlockEdit, { ...props }), isDisplayed && (0,external_React_.createElement)(NavigationMenuEdit, { attributes: attributes })); }, 'withEditBlockControls'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-site/navigation-edit-button', navigation_menu_edit_withEditBlockControls); ;// 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 /** * WordPress dependencies */ /** * Reducer returning the settings. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function settings(state = {}, action) { switch (action.type) { case 'UPDATE_SETTINGS': return { ...state, ...action.settings }; } return state; } /** * Reducer keeping track of the currently edited Post Type, * Post Id and the context provided to fill the content of the block editor. * * @param {Object} state Current edited post. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function editedPost(state = {}, action) { switch (action.type) { case 'SET_EDITED_POST': return { postType: action.postType, id: action.id, context: action.context }; case 'SET_EDITED_POST_CONTEXT': return { ...state, context: action.context }; } return state; } /** * Reducer to set the save view panel open or closed. * * @param {Object} state Current state. * @param {Object} action Dispatched action. */ function saveViewPanel(state = false, action) { 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; } /** * Reducer used to track the site editor canvas container view. * Default is `undefined`, denoting the default, visual block editor. * This could be, for example, `'style-book'` (the style book). * * @param {string|undefined} state Current state. * @param {Object} action Dispatched action. */ function editorCanvasContainerView(state = undefined, action) { switch (action.type) { case 'SET_EDITOR_CANVAS_CONTAINER_VIEW': return action.view; } return state; } /* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ settings, editedPost, saveViewPanel, canvasMode, editorCanvasContainerView })); ;// 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: external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/constants.js /** * The identifier for the data store. * * @type {string} */ const constants_STORE_NAME = 'core/edit-site'; ;// 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: external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/private-actions.js /** * WordPress dependencies */ /** * Internal 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; registry.dispatch(external_wp_blockEditor_namespaceObject.store).__unstableSetEditorMode('edit'); dispatch({ type: 'SET_CANVAS_MODE', mode }); // 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 && mode === 'edit' && 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); }; /** * Action that switches the editor canvas container view. * * @param {?string} view Editor canvas container view. */ const setEditorCanvasContainerView = view => ({ dispatch }) => { dispatch({ type: 'SET_EDITOR_CANVAS_CONTAINER_VIEW', view }); }; /** * Action that removes an array of templates. * * @param {Array} items An array of template or template part objects to remove. */ const removeTemplates = items => async ({ registry }) => { const isTemplate = items[0].type === constants_TEMPLATE_POST_TYPE; const promiseResult = await Promise.allSettled(items.map(item => { return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', item.type, item.id, { force: true }, { throwOnError: true }); })); // If all the promises were fulfilled with sucess. if (promiseResult.every(({ status }) => status === 'fulfilled')) { let successMessage; if (items.length === 1) { // Depending on how the entity was retrieved its title might be // an object or simple string. const title = typeof items[0].title === 'string' ? items[0].title : items[0].title?.rendered; successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */ (0,external_wp_i18n_namespaceObject.__)('"%s" deleted.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)); } else { successMessage = isTemplate ? (0,external_wp_i18n_namespaceObject.__)('Templates deleted.') : (0,external_wp_i18n_namespaceObject.__)('Template parts deleted.'); } registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, { type: 'snackbar', id: 'site-editor-template-deleted-success' }); } else { // If there was at lease one failure. let errorMessage; // If we were trying to delete a single template. if (promiseResult.length === 1) { if (promiseResult[0].reason?.message) { errorMessage = promiseResult[0].reason.message; } else { errorMessage = isTemplate ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the template part.'); } // If we were trying to delete a multiple templates } else { const errorMessages = new Set(); const failedPromises = promiseResult.filter(({ status }) => status === 'rejected'); for (const failedPromise of failedPromises) { if (failedPromise.reason?.message) { errorMessages.add(failedPromise.reason.message); } } if (errorMessages.size === 0) { errorMessage = isTemplate ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the templates.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the template parts.'); } else if (errorMessages.size === 1) { errorMessage = isTemplate ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the templates: %s'), [...errorMessages][0]) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */ (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the template parts: %s'), [...errorMessages][0]); } else { errorMessage = isTemplate ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the templates: %s'), [...errorMessages].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */ (0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the template parts: %s'), [...errorMessages].join(',')); } } registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { type: 'snackbar' }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Dispatches an action that toggles a feature flag. * * @param {string} featureName Feature name. */ function actions_toggleFeature(featureName) { return function ({ registry }) { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).toggleFeature( featureName )", { since: '6.0', alternative: "dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )" }); registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-site', featureName); }; } /** * Action that changes the width of the editing canvas. * * @deprecated * * @param {string} deviceType * * @return {Object} Action object. */ const __experimentalSetPreviewDeviceType = deviceType => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType", { since: '6.5', version: '6.7', hint: 'registry.dispatch( editorStore ).setDeviceType' }); registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType(deviceType); }; /** * Action that sets a template, optionally fetching it from REST API. * * @return {Object} Action object. */ function setTemplate() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setTemplate", { since: '6.5', version: '6.8', hint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.' }); return { type: 'NOTHING' }; } /** * Action that adds a new template and sets it as the current template. * * @param {Object} template The template. * * @deprecated * * @return {Object} Action object used to set the current template. */ const addTemplate = template => async ({ dispatch, registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).addTemplate", { since: '6.5', version: '6.8', hint: 'use saveEntityRecord directly' }); const newTemplate = await registry.dispatch(external_wp_coreData_namespaceObject.store).saveEntityRecord('postType', constants_TEMPLATE_POST_TYPE, template); if (template.content) { registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', constants_TEMPLATE_POST_TYPE, newTemplate.id, { blocks: (0,external_wp_blocks_namespaceObject.parse)(template.content) }, { undoIgnore: true }); } dispatch({ type: 'SET_EDITED_POST', postType: constants_TEMPLATE_POST_TYPE, id: newTemplate.id }); }; /** * Action that removes a template. * * @param {Object} template The template object. */ const removeTemplate = template => { return removeTemplates([template]); }; /** * Action that sets a template part. * * @param {string} templatePartId The template part ID. * * @return {Object} Action object. */ function setTemplatePart(templatePartId) { return { type: 'SET_EDITED_POST', postType: TEMPLATE_PART_POST_TYPE, id: templatePartId }; } /** * Action that sets a navigation menu. * * @param {string} navigationMenuId The Navigation Menu Post ID. * * @return {Object} Action object. */ function setNavigationMenu(navigationMenuId) { return { type: 'SET_EDITED_POST', postType: NAVIGATION_POST_TYPE, id: navigationMenuId }; } /** * Action that sets an edited entity. * * @param {string} postType The entity's post type. * @param {string} postId The entity's ID. * @param {Object} context The entity's context. * * @return {Object} Action object. */ function setEditedEntity(postType, postId, context) { return { type: 'SET_EDITED_POST', postType, id: postId, context }; } /** * @deprecated */ function setHomeTemplateId() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setHomeTemplateId", { since: '6.2', version: '6.4' }); return { type: 'NOTHING' }; } /** * Set's the current block editor context. * * @param {Object} context The context object. * * @return {Object} Action object. */ function setEditedPostContext(context) { return { type: 'SET_EDITED_POST_CONTEXT', context }; } /** * Resolves the template for a page and displays both. If no path is given, attempts * to use the postId to generate a path like `?p=${ postId }`. * * @deprecated * * @return {number} The resolved template ID for the page route. */ function setPage() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setPage", { since: '6.5', version: '6.8', hint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.' }); return { type: 'NOTHING' }; } /** * Action that sets the active navigation panel menu. * * @deprecated * * @return {Object} Action object. */ function setNavigationPanelActiveMenu() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu", { since: '6.2', version: '6.4' }); return { type: 'NOTHING' }; } /** * Opens the navigation panel and sets its active menu at the same time. * * @deprecated */ function openNavigationPanelToMenu() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu", { since: '6.2', version: '6.4' }); return { type: 'NOTHING' }; } /** * Sets whether the navigation panel should be open. * * @deprecated */ function setIsNavigationPanelOpened() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened", { since: '6.2', version: '6.4' }); return { type: 'NOTHING' }; } /** * Returns an action object used to open/close the inserter. * * @deprecated * * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false). */ const setIsInserterOpened = value => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsInserterOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsInserterOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(value); }; /** * Returns an action object used to open/close the list view. * * @deprecated * * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed. */ const setIsListViewOpened = isOpen => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).setIsListViewOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsListViewOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(isOpen); }; /** * Returns an action object used to update the settings. * * @param {Object} settings New settings. * * @return {Object} Action object. */ function updateSettings(settings) { return { type: 'UPDATE_SETTINGS', settings }; } /** * Sets whether the save view panel should be open. * * @param {boolean} isOpen If true, opens the save view. If false, closes it. * It does not toggle the state, but sets it directly. */ function setIsSaveViewOpened(isOpen) { return { type: 'SET_IS_SAVE_VIEW_OPENED', isOpen }; } /** * Reverts a template to its original theme-provided file. * * @param {Object} template The template to revert. * @param {Object} [options] * @param {boolean} [options.allowUndo] Whether to allow the user to undo * reverting the template. Default true. */ const revertTemplate = (template, { allowUndo = true } = {}) => async ({ registry }) => { const noticeId = 'edit-site-template-reverted'; registry.dispatch(external_wp_notices_namespaceObject.store).removeNotice(noticeId); if (!isTemplateRevertable(template)) { registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('This template is not revertable.'), { type: 'snackbar' }); return; } try { const templateEntityConfig = registry.select(external_wp_coreData_namespaceObject.store).getEntityConfig('postType', template.type); if (!templateEntityConfig) { registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { type: 'snackbar' }); return; } const fileTemplatePath = (0,external_wp_url_namespaceObject.addQueryArgs)(`${templateEntityConfig.baseURL}/${template.id}`, { context: 'edit', source: 'theme' }); const fileTemplate = await external_wp_apiFetch_default()({ path: fileTemplatePath }); if (!fileTemplate) { registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice((0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error. Please reload.'), { type: 'snackbar' }); return; } const serializeBlocks = ({ blocks: blocksForSerialization = [] }) => (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocksForSerialization); const edited = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', template.type, template.id); // We are fixing up the undo level here to make sure we can undo // the revert in the header toolbar correctly. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, template.id, { content: serializeBlocks, // Required to make the `undo` behave correctly. blocks: edited.blocks, // Required to revert the blocks in the editor. source: 'custom' // required to avoid turning the editor into a dirty state }, { undoIgnore: true // Required to merge this edit with the last undo level. }); const blocks = (0,external_wp_blocks_namespaceObject.parse)(fileTemplate?.content?.raw); registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, fileTemplate.id, { content: serializeBlocks, blocks, source: 'theme' }); if (allowUndo) { const undoRevert = () => { registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('postType', template.type, edited.id, { content: serializeBlocks, blocks: edited.blocks, source: 'custom' }); }; registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Template reverted.'), { type: 'snackbar', id: noticeId, actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: undoRevert }] }); } } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('Template revert failed. Please reload.'); registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, { type: 'snackbar' }); } }; /** * Action that opens an editor sidebar. * * @param {?string} name Sidebar name to be opened. */ const openGeneralSidebar = name => ({ dispatch, registry }) => { const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree'); if (isDistractionFree) { dispatch.toggleDistractionFree(); } registry.dispatch(store).enableComplementaryArea(constants_STORE_NAME, name); }; /** * Action that closes the sidebar. */ const closeGeneralSidebar = () => ({ registry }) => { registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME); }; const switchEditorMode = mode => ({ dispatch, registry }) => { registry.dispatch('core/preferences').set('core', 'editorMode', mode); // Unselect blocks when we switch to a non visual mode. if (mode !== 'visual') { registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock(); } if (mode === 'visual') { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Visual editor selected'), 'assertive'); } else if (mode === 'text') { const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree'); if (isDistractionFree) { dispatch.toggleDistractionFree(); } (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Code editor selected'), 'assertive'); } }; /** * Sets whether or not the editor allows only page content to be edited. * * @param {boolean} hasPageContentFocus True to allow only page content to be * edited, false to allow template to be * edited. */ const setHasPageContentFocus = hasPageContentFocus => ({ dispatch, registry }) => { external_wp_deprecated_default()(`dispatch( 'core/edit-site' ).setHasPageContentFocus`, { since: '6.5' }); if (hasPageContentFocus) { registry.dispatch(external_wp_blockEditor_namespaceObject.store).clearSelectedBlock(); } dispatch({ type: 'SET_HAS_PAGE_CONTENT_FOCUS', hasPageContentFocus }); }; /** * Action that toggles Distraction free mode. * Distraction free mode expects there are no sidebars, as due to the * z-index values set, you can't close sidebars. */ const toggleDistractionFree = () => ({ dispatch, registry }) => { const isDistractionFree = registry.select(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree'); if (isDistractionFree) { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', false); } if (!isDistractionFree) { registry.batch(() => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', true); registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(false); registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(false); dispatch.closeGeneralSidebar(); }); } registry.batch(() => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'distractionFree', !isDistractionFree); registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Distraction free off.') : (0,external_wp_i18n_namespaceObject.__)('Distraction free on.'), { id: 'core/edit-site/distraction-free-mode/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { registry.batch(() => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'fixedToolbar', isDistractionFree ? true : false); registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core', 'distractionFree'); }); } }] }); }); }; ;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js /** * Memize options object. * * @typedef MemizeOptions * * @property {number} [maxSize] Maximum size of the cache. */ /** * Internal cache entry. * * @typedef MemizeCacheNode * * @property {?MemizeCacheNode|undefined} [prev] Previous node. * @property {?MemizeCacheNode|undefined} [next] Next node. * @property {Array<*>} args Function arguments for cache * entry. * @property {*} val Function result. */ /** * Properties of the enhanced function for controlling cache. * * @typedef MemizeMemoizedFunction * * @property {()=>void} clear Clear the cache. */ /** * Accepts a function to be memoized, and returns a new memoized function, with * optional options. * * @template {(...args: any[]) => any} F * * @param {F} fn Function to memoize. * @param {MemizeOptions} [options] Options object. * * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function. */ function memize(fn, options) { var size = 0; /** @type {?MemizeCacheNode|undefined} */ var head; /** @type {?MemizeCacheNode|undefined} */ var tail; options = options || {}; function memoized(/* ...args */) { var node = head, len = arguments.length, args, i; searchCache: while (node) { // Perform a shallow equality test to confirm that whether the node // under test is a candidate for the arguments passed. Two arrays // are shallowly equal if their length matches and each entry is // strictly equal between the two sets. Avoid abstracting to a // function which could incur an arguments leaking deoptimization. // Check whether node arguments match arguments length if (node.args.length !== arguments.length) { node = node.next; continue; } // Check whether node arguments match arguments values for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } // At this point we can assume we've found a match // Surface matched node to head if not already if (node !== head) { // As tail, shift to previous. Must only shift if not also // head, since if both head and tail, there is no previous. if (node === tail) { tail = node.prev; } // Adjust siblings to point to each other. If node was tail, // this also handles new tail's empty `next` assignment. /** @type {MemizeCacheNode} */ (node.prev).next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; /** @type {MemizeCacheNode} */ (head).prev = node; head = node; } // Return immediately return node.val; } // No cached value found. Continue to insertion phase: // Create a copy of arguments (avoid leaking deoptimization) args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args: args, // Generate the result from original function val: fn.apply(null, args), }; // Don't need to check whether node is already head, since it would // have been returned above already if it was // Shift existing head down list if (head) { head.prev = node; node.next = head; } else { // If no head, follows that there's no tail (at initial or reset) tail = node; } // Trim tail if we're reached max size and are pending cache insertion if (size === /** @type {MemizeOptions} */ (options).maxSize) { tail = /** @type {MemizeCacheNode} */ (tail).prev; /** @type {MemizeCacheNode} */ (tail).next = null; } else { size++; } head = node; return node.val; } memoized.clear = function () { head = null; tail = null; size = 0; }; // Ignore reason: There's not a clear solution to create an intersection of // the function with additional properties, where the goal is to retain the // function signature of the incoming argument and add control properties // on the return value. // @ts-ignore return memoized; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/utils.js /** * External dependencies */ /** * 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; } const memoizedGetFilteredTemplatePartBlocks = memize(getFilteredTemplatePartBlocks); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef {'template'|'template_type'} TemplateType Template type. */ /** * Returns whether the given feature is enabled or not. * * @deprecated * @param {Object} state Global application state. * @param {string} featureName Feature slug. * * @return {boolean} Is active. */ const selectors_isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (_, featureName) => { external_wp_deprecated_default()(`select( 'core/edit-site' ).isFeatureActive`, { since: '6.0', alternative: `select( 'core/preferences' ).get` }); return !!select(external_wp_preferences_namespaceObject.store).get('core/edit-site', featureName); }); /** * Returns the current editing canvas device type. * * @deprecated * * @param {Object} state Global application state. * * @return {string} Device type. */ const __experimentalGetPreviewDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, { since: '6.5', version: '6.7', alternative: `select( 'core/editor' ).getDeviceType` }); return select(external_wp_editor_namespaceObject.store).getDeviceType(); }); /** * Returns whether the current user can create media or not. * * @param {Object} state Global application state. * * @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')); /** * Returns any available Reusable blocks. * * @param {Object} state Global application state. * * @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' )", { since: '6.5', version: '6.8' }); const isWeb = external_wp_element_namespaceObject.Platform.OS === 'web'; return isWeb ? select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_block', { per_page: -1 }) : []; }); /** * Returns the site editor settings. * * @param {Object} state Global application state. * * @return {Object} Settings. */ function getSettings(state) { // It is important that we don't inject anything into these settings locally. // The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings. // If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected. return state.settings; } /** * @deprecated */ function getHomeTemplateId() { external_wp_deprecated_default()("select( 'core/edit-site' ).getHomeTemplateId", { since: '6.2', version: '6.4' }); } /** * Returns the current edited post type (wp_template or wp_template_part). * * @param {Object} state Global application state. * * @return {TemplateType?} Template type. */ function getEditedPostType(state) { return state.editedPost.postType; } /** * Returns the ID of the currently edited template or template part. * * @param {Object} state Global application state. * * @return {string?} Post ID. */ function getEditedPostId(state) { return state.editedPost.id; } /** * Returns the edited post's context object. * * @deprecated * @param {Object} state Global application state. * * @return {Object} Page. */ function getEditedPostContext(state) { return state.editedPost.context; } /** * Returns the current page object. * * @deprecated * @param {Object} state Global application state. * * @return {Object} Page. */ function getPage(state) { return { context: state.editedPost.context }; } /** * Returns true if the inserter is opened. * * @deprecated * * @param {Object} state Global application state. * * @return {boolean} Whether the inserter is opened. */ const isInserterOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).isInserterOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isInserterOpened` }); return select(external_wp_editor_namespaceObject.store).isInserterOpened(); }); /** * Get the insertion point for the inserter. * * @deprecated * * @param {Object} state Global application state. * * @return {Object} The root client ID, index to insert at and starting filter value. */ const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).__experimentalGetInsertionPoint`, { since: '6.5', version: '6.7' }); return unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); }); /** * Returns true if the list view is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the list view is opened. */ const isListViewOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).isListViewOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isListViewOpened` }); return select(external_wp_editor_namespaceObject.store).isListViewOpened(); }); /** * Returns the current opened/closed state of the save panel. * * @param {Object} state Global application state. * * @return {boolean} True if the save panel should be open; false if closed. */ function isSaveViewOpened(state) { return state.saveViewPanel; } /** * Returns the template parts and their blocks for the current edited template. * * @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 => () => { const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { per_page: -1 }); const clientIds = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/template-part'); const blocks = select(external_wp_blockEditor_namespaceObject.store).getBlocksByClientId(clientIds); return memoizedGetFilteredTemplatePartBlocks(blocks, templateParts); }); /** * Returns the current editing mode. * * @param {Object} state Global application state. * * @return {string} Editing mode. */ const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { return select(external_wp_preferences_namespaceObject.store).get('core', 'editorMode'); }); /** * @deprecated */ function getCurrentTemplateNavigationPanelSubMenu() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu", { since: '6.2', version: '6.4' }); } /** * @deprecated */ function getNavigationPanelActiveMenu() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu", { since: '6.2', version: '6.4' }); } /** * @deprecated */ function isNavigationOpened() { external_wp_deprecated_default()("dispatch( 'core/edit-site' ).isNavigationOpened", { since: '6.2', version: '6.4' }); } /** * Whether or not the editor has a page loaded into it. * * @see setPage * * @param {Object} state Global application state. * * @return {boolean} Whether or not the editor has a page loaded into it. */ function isPage(state) { return !!state.editedPost.context?.postId; } /** * Whether or not the editor allows only page content to be edited. * * @deprecated * * @return {boolean} Whether or not focus is on editing page content. */ function hasPageContentFocus() { external_wp_deprecated_default()(`select( 'core/edit-site' ).hasPageContentFocus`, { since: '6.5' }); 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; } /** * Returns the editor canvas container view. * * @param {Object} state Global application state. * * @return {string} Editor canvas container view. */ function getEditorCanvasContainerView(state) { return state.editorCanvasContainerView; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const storeConfig = { reducer: store_reducer, actions: store_actions_namespaceObject, selectors: store_selectors_namespaceObject }; const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); (0,external_wp_data_namespaceObject.register)(store_store); unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject); unlock(store_store).registerPrivateActions(private_actions_namespaceObject); ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// CONCATENATED MODULE: external ["wp","commands"] const external_wp_commands_namespaceObject = window["wp"]["commands"]; ;// CONCATENATED MODULE: external ["wp","coreCommands"] const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js /** * WordPress dependencies */ const navigation = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/icons/build-module/library/styles.js /** * WordPress dependencies */ const styles = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/page.js /** * WordPress dependencies */ const page = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), (0,external_React_.createElement)(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/layout.js /** * WordPress dependencies */ const layout = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/symbol.js /** * WordPress dependencies */ const symbol = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js /** * WordPress dependencies */ const chevronRight = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/icons/build-module/library/chevron-left.js /** * WordPress dependencies */ const chevronLeft = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/edit-site/build-module/components/sidebar-button/index.js /** * External dependencies */ /** * WordPress dependencies */ function SidebarButton(props) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { ...props, className: classnames_default()('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 { useLocation: sidebar_navigation_screen_useLocation } = 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 } = unlock(select(store_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 navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: classnames_default()('edit-site-sidebar-navigation-screen__main', { 'has-footer': !!footer }), spacing: 0, justify: "flex-start" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 4, alignment: "flex-start", className: "edit-site-sidebar-navigation-screen__title-icon" }, !isRoot && (0,external_React_.createElement)(SidebarButton, { onClick: () => { const backPath = backPathProp !== null && backPathProp !== void 0 ? backPathProp : location.state?.backPath; if (backPath) { navigator.goTo(backPath, { isBack: true }); } else { navigator.goToParent(); } }, icon: icon, label: (0,external_wp_i18n_namespaceObject.__)('Back'), showTooltip: false }), isRoot && (0,external_React_.createElement)(SidebarButton, { icon: icon, label: dashboardLinkText || (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard'), href: dashboardLink || 'index.php' }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { className: "edit-site-sidebar-navigation-screen__title", color: '#e0e0e0' /* $gray-200 */, level: 1, size: 20 }, !isPreviewingTheme() ? title : (0,external_wp_i18n_namespaceObject.sprintf)('Previewing %1$s: %2$s', previewingThemeName, title)), actions && (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen__actions" }, actions)), meta && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen__meta" }, meta)), (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen__content" }, description && (0,external_React_.createElement)("p", { className: "edit-site-sidebar-navigation-screen__description" }, description), content)), footer && (0,external_React_.createElement)("footer", { className: "edit-site-sidebar-navigation-screen__footer" }, footer)); } ;// 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({ 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_Icon)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js /** * WordPress dependencies */ const chevronLeftSmall = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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 = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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 */ function SidebarNavigationItem({ className, icon, withChevron = false, suffix, children, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, { className: classnames_default()('edit-site-sidebar-navigation-item', { 'with-suffix': !withChevron && suffix }, className), ...props }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start" }, icon && (0,external_React_.createElement)(build_module_icon, { style: { fill: 'currentcolor' }, icon: icon, size: 24 }), (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexBlock, null, children), withChevron && (0,external_React_.createElement)(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/icons/build-module/library/seen.js /** * WordPress dependencies */ const seen = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" })); /* harmony default export */ const library_seen = (seen); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js /** * WordPress dependencies */ const pencil = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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: external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js var cjs = __webpack_require__(66); var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); ;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor,prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/global-styles-provider.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { GlobalStylesContext: global_styles_provider_GlobalStylesContext, cleanEmptyObject: global_styles_provider_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function mergeBaseAndUserConfigs(base, user) { return cjs_default()(base, user, { // We only pass as arrays the presets, // in which case we want the new array of values // to override the old array (no merging). isMergeableObject: isPlainObject }); } function useGlobalStylesUserConfig() { const { globalStylesId, isReady, settings, styles } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const _globalStylesId = select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentGlobalStylesId(); const record = _globalStylesId ? getEditedEntityRecord('root', 'globalStyles', _globalStylesId) : undefined; let hasResolved = false; if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) { hasResolved = _globalStylesId ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : true; } return { globalStylesId: _globalStylesId, isReady: hasResolved, settings: record?.settings, styles: record?.styles }; }, []); const { getEditedEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const config = (0,external_wp_element_namespaceObject.useMemo)(() => { return { settings: settings !== null && settings !== void 0 ? settings : {}, styles: styles !== null && styles !== void 0 ? styles : {} }; }, [settings, styles]); const setConfig = (0,external_wp_element_namespaceObject.useCallback)((callback, options = {}) => { var _record$styles, _record$settings; const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId); const currentConfig = { styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {}, settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {} }; const updatedConfig = callback(currentConfig); editEntityRecord('root', 'globalStyles', globalStylesId, { styles: global_styles_provider_cleanEmptyObject(updatedConfig.styles) || {}, settings: global_styles_provider_cleanEmptyObject(updatedConfig.settings) || {} }, options); }, [globalStylesId]); return [isReady, config, setConfig]; } function useGlobalStylesBaseConfig() { const baseConfig = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeBaseGlobalStyles(); }, []); return [!!baseConfig, baseConfig]; } function useGlobalStylesContext() { const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig(); const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig(); const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!baseConfig || !userConfig) { return {}; } return mergeBaseAndUserConfigs(baseConfig, userConfig); }, [userConfig, baseConfig]); const context = (0,external_wp_element_namespaceObject.useMemo)(() => { return { isReady: isUserConfigReady && isBaseConfigReady, user: userConfig, base: baseConfig, merged: mergedConfig, setUserConfig }; }, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]); return context; } function GlobalStylesProvider({ children }) { const context = useGlobalStylesContext(); if (!context.isReady) { return null; } return (0,external_React_.createElement)(global_styles_provider_GlobalStylesContext.Provider, { value: context }, children); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useGlobalStyle: preview_useGlobalStyle, useGlobalStylesOutput } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const firstFrame = { start: { scale: 1, opacity: 1 }, hover: { scale: 0, opacity: 0 } }; const midFrame = { hover: { opacity: 1 }, start: { opacity: 0.5 } }; const secondFrame = { hover: { scale: 1, opacity: 1 }, start: { scale: 0, opacity: 0 } }; const normalizedWidth = 248; const normalizedHeight = 152; const normalizedColorSwatchSize = 32; // Throttle options for useThrottle. Must be defined outside of the component, // so that the object reference is the same on each render. const THROTTLE_OPTIONS = { leading: true, trailing: true }; const StylesPreview = ({ label, isFocused, withHoverView }) => { const [fontWeight] = preview_useGlobalStyle('typography.fontWeight'); const [fontFamily = 'serif'] = preview_useGlobalStyle('typography.fontFamily'); const [headingFontFamily = fontFamily] = preview_useGlobalStyle('elements.h1.typography.fontFamily'); const [headingFontWeight = fontWeight] = preview_useGlobalStyle('elements.h1.typography.fontWeight'); const [textColor = 'black'] = preview_useGlobalStyle('color.text'); const [headingColor = textColor] = preview_useGlobalStyle('elements.h1.color.text'); const [backgroundColor = 'white'] = preview_useGlobalStyle('color.background'); const [gradientValue] = preview_useGlobalStyle('color.gradient'); const [styles] = useGlobalStylesOutput(); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const [containerResizeListener, { width }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const [throttledWidth, setThrottledWidthState] = (0,external_wp_element_namespaceObject.useState)(width); 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 // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (width) { setThrottledWidth(width); } }, [width, setThrottledWidth]); // Must use useLayoutEffect to avoid a flash of the iframe at the wrong // size before the width is set. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1; const ratioDiff = newRatio - (ratioState || 0); // Only update the ratio state if the difference is big enough // or if the ratio state is not yet set. This is to avoid an // endless loop of updates at particular viewport heights when the // presence of a scrollbar causes the width to change slightly. const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1; if (isRatioDiffBigEnough || !ratioState) { setRatioState(newRatio); } }, [throttledWidth, ratioState]); // Set a fallbackRatio to use before the throttled ratio has been set. const fallbackRatio = width ? width / normalizedWidth : 1; // Use the throttled ratio if it has been calculated, otherwise // use the fallback ratio. The throttled ratio is used to avoid // an endless loop of updates at particular viewport heights. // See: https://github.com/WordPress/gutenberg/issues/55112 const ratio = ratioState ? ratioState : fallbackRatio; const { paletteColors, highlightedColors } = useStylesPreviewColors(); // Reset leaked styles from WP common.css and remove main content layout padding and border. const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { if (styles) { return [...styles, { css: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}', isGlobalStyles: true }]; } return styles; }, [styles]); const isReady = !!width; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { style: { position: 'relative' } }, containerResizeListener), isReady && (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.__unstableIframe, { className: "edit-site-global-styles-preview__iframe", style: { width: '100%', height: normalizedHeight * ratio }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), tabIndex: -1 }, (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: editorStyles }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { style: { height: normalizedHeight * ratio, width: '100%', background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor, cursor: withHoverView ? 'pointer' : undefined }, initial: "start", animate: (isHovered || isFocused) && !disableMotion && label ? 'hover' : 'start' }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: firstFrame, style: { height: '100%', overflow: 'hidden' } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 10 * ratio, justify: "center", style: { height: '100%', overflow: 'hidden' } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { style: { fontFamily: headingFontFamily, fontSize: 65 * ratio, color: headingColor, fontWeight: headingFontWeight }, animate: { scale: 1, opacity: 1 }, initial: { scale: 0.1, opacity: 0 }, transition: { delay: 0.3, type: 'tween' } }, "Aa"), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4 * ratio }, highlightedColors.map(({ slug, color }, index) => (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { key: slug, style: { height: normalizedColorSwatchSize * ratio, width: normalizedColorSwatchSize * ratio, background: color, borderRadius: normalizedColorSwatchSize * ratio / 2 }, animate: { scale: 1, opacity: 1 }, initial: { scale: 0.1, opacity: 0 }, transition: { delay: index === 1 ? 0.2 : 0.1 } }))))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: withHoverView && midFrame, style: { height: '100%', width: '100%', position: 'absolute', top: 0, overflow: 'hidden', filter: 'blur(60px)', opacity: 0.1 } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 0, justify: "flex-start", style: { height: '100%', overflow: 'hidden' } }, paletteColors.slice(0, 4).map(({ color }, index) => (0,external_React_.createElement)("div", { key: index, style: { height: '100%', background: color, flexGrow: 1 } })))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: secondFrame, style: { height: '100%', width: '100%', overflow: 'hidden', position: 'absolute', top: 0 } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3 * ratio, justify: "center", style: { height: '100%', overflow: 'hidden', padding: 10 * ratio, boxSizing: 'border-box' } }, label && (0,external_React_.createElement)("div", { style: { fontSize: 40 * ratio, fontFamily: headingFontFamily, color: headingColor, fontWeight: headingFontWeight, lineHeight: '1em', textAlign: 'center' } }, label)))))); }; /* harmony default export */ const preview = (StylesPreview); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/style-variations-container.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { GlobalStylesContext: style_variations_container_GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function Variation({ variation }) { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); const { base, user, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(style_variations_container_GlobalStylesContext); const context = (0,external_wp_element_namespaceObject.useMemo)(() => { var _variation$settings, _variation$styles; return { user: { settings: (_variation$settings = variation.settings) !== null && _variation$settings !== void 0 ? _variation$settings : {}, styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {} }, base, merged: mergeBaseAndUserConfigs(base, variation), setUserConfig: () => {} }; }, [variation, base]); const selectVariation = () => { setUserConfig(() => { return { settings: variation.settings, styles: variation.styles }; }); }; const selectOnEnter = event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { event.preventDefault(); selectVariation(); } }; const isActive = (0,external_wp_element_namespaceObject.useMemo)(() => { return 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); } return (0,external_React_.createElement)(style_variations_container_GlobalStylesContext.Provider, { value: context }, (0,external_React_.createElement)("div", { className: classnames_default()('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) }, (0,external_React_.createElement)("div", { className: "edit-site-global-styles-variations_item-preview" }, (0,external_React_.createElement)(preview, { label: variation?.title, isFocused: isFocused, withHoverView: true })))); } function StyleVariationsContainer() { const variations = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations(); }, []); const withEmptyVariation = (0,external_wp_element_namespaceObject.useMemo)(() => { return [{ title: (0,external_wp_i18n_namespaceObject.__)('Default'), settings: {}, styles: {} }, ...(variations !== null && variations !== void 0 ? variations : []).map(variation => { var _variation$settings2, _variation$styles2; return { ...variation, settings: (_variation$settings2 = variation.settings) !== null && _variation$settings2 !== void 0 ? _variation$settings2 : {}, styles: (_variation$styles2 = variation.styles) !== null && _variation$styles2 !== void 0 ? _variation$styles2 : {} }; })]; }, [variations]); return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 2, className: "edit-site-global-styles-style-variations-container" }, withEmptyVariation.map((variation, index) => (0,external_React_.createElement)(Variation, { key: index, variation: variation }))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resize-handle.js /** * WordPress dependencies */ const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels. function ResizeHandle({ variation = 'default', direction, resizeWidthBy }) { function handleKeyDown(event) { const { keyCode } = event; if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.LEFT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.RIGHT) { resizeWidthBy(DELTA_DISTANCE); } else if (direction === 'left' && keyCode === external_wp_keycodes_namespaceObject.RIGHT || direction === 'right' && keyCode === external_wp_keycodes_namespaceObject.LEFT) { resizeWidthBy(-DELTA_DISTANCE); } } return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("button", { className: `resizable-editor__drag-handle is-${direction} is-variation-${variation}`, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), "aria-describedby": `resizable-editor__resize-help-${direction}`, onKeyDown: handleKeyDown, type: "button" }), (0,external_React_.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { id: `resizable-editor__resize-help-${direction}` }, (0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to resize the canvas.'))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/block-editor/resizable-editor.js /** * WordPress dependencies */ /** * Internal dependencies */ // Removes the inline styles in the drag handles. const HANDLE_STYLES_OVERRIDE = { position: undefined, userSelect: undefined, cursor: undefined, width: undefined, height: undefined, top: undefined, right: undefined, bottom: undefined, left: undefined }; function ResizableEditor({ enableResizing, height, children }) { const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)('100%'); const resizableRef = (0,external_wp_element_namespaceObject.useRef)(); const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => { if (resizableRef.current) { setWidth(resizableRef.current.offsetWidth + deltaPixels); } }, []); return (0,external_React_.createElement)(external_wp_components_namespaceObject.ResizableBox, { ref: api => { resizableRef.current = api?.resizable; }, size: { width: enableResizing ? width : '100%', height: enableResizing && height ? height : '100%' }, onResizeStop: (event, direction, element) => { setWidth(element.style.width); }, minWidth: 300, maxWidth: "100%", maxHeight: "100%", enable: { left: enableResizing, right: enableResizing }, showHandle: enableResizing // The editor is centered horizontally, resizing it only // moves half the distance. Hence double the ratio to correctly // align the cursor to the resizer handle. , resizeRatio: 2, handleComponent: { left: (0,external_React_.createElement)(ResizeHandle, { direction: "left", resizeWidthBy: resizeWidthBy }), right: (0,external_React_.createElement)(ResizeHandle, { direction: "right", resizeWidthBy: resizeWidthBy }) }, handleClasses: undefined, handleStyles: { left: HANDLE_STYLES_OVERRIDE, right: HANDLE_STYLES_OVERRIDE } }, children); } /* harmony default export */ const resizable_editor = (ResizableEditor); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/editor-canvas-container/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * 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 ''; } } // Creates a private slot fill. const { createPrivateSlotFill } = unlock(external_wp_components_namespaceObject.privateApis); const SLOT_FILL_NAME = 'EditSiteEditorCanvasContainerSlot'; const { privateKey, Slot: EditorCanvasContainerSlot, Fill: EditorCanvasContainerFill } = createPrivateSlotFill(SLOT_FILL_NAME); function EditorCanvasContainer({ children, closeButtonLabel, onClose, enableResizing = false }) { const { editorCanvasContainerView, showListViewByDefault } = (0,external_wp_data_namespaceObject.useSelect)(select => { const _editorCanvasContainerView = unlock(select(store_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_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)(); const title = (0,external_wp_element_namespaceObject.useMemo)(() => getEditorCanvasContainerTitle(editorCanvasContainerView), [editorCanvasContainerView]); 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 shouldShowCloseButton = onClose || closeButtonLabel; return (0,external_React_.createElement)(EditorCanvasContainerFill, null, (0,external_React_.createElement)(resizable_editor, { enableResizing: enableResizing }, (0,external_React_.createElement)("section", { className: "edit-site-editor-canvas-container", ref: shouldShowCloseButton ? focusOnMountRef : null, onKeyDown: closeOnEscape, "aria-label": title }, shouldShowCloseButton && (0,external_React_.createElement)(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, showTooltip: false }), childrenWithProps))); } function useHasEditorCanvasContainer() { const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(privateKey); return !!fills?.length; } EditorCanvasContainer.Slot = EditorCanvasContainerSlot; /* harmony default export */ const editor_canvas_container = (EditorCanvasContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { ExperimentalBlockEditorProvider, useGlobalStyle: style_book_useGlobalStyle, GlobalStylesContext: style_book_GlobalStylesContext, useGlobalStylesOutputWithConfig } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { CompositeV2: Composite, CompositeItemV2: CompositeItem, useCompositeStoreV2: useCompositeStore, Tabs } = 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; } `; 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]; } function StyleBook({ enableResizing = true, isSelected, onClick, onSelect, showCloseButton = true, onClose, showTabs = true, userConfig = {} }) { const [resizeObserver, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const [textColor] = style_book_useGlobalStyle('color.text'); const [backgroundColor] = style_book_useGlobalStyle('color.background'); const examples = (0,external_wp_element_namespaceObject.useMemo)(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 { base: baseConfig } = (0,external_wp_element_namespaceObject.useContext)(style_book_GlobalStylesContext); const mergedConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) { return mergeBaseAndUserConfigs(baseConfig, userConfig); } return {}; }, [baseConfig, userConfig]); // 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 settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, __unstableIsPreviewMode: true }), [originalSettings]); const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig); settings.styles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles; return (0,external_React_.createElement)(editor_canvas_container, { onClose: onClose, enableResizing: enableResizing, closeButtonLabel: showCloseButton ? (0,external_wp_i18n_namespaceObject.__)('Close Style Book') : null }, (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-style-book', { 'is-wide': sizes.width > 600, 'is-button': !!onClick }), style: { color: textColor, background: backgroundColor } }, resizeObserver, showTabs ? (0,external_React_.createElement)("div", { className: "edit-site-style-book__tabs" }, (0,external_React_.createElement)(Tabs, null, (0,external_React_.createElement)(Tabs.TabList, null, tabs.map(tab => (0,external_React_.createElement)(Tabs.Tab, { tabId: tab.name, key: tab.name }, tab.title))), tabs.map(tab => (0,external_React_.createElement)(Tabs.TabPanel, { key: tab.name, tabId: tab.name, focusable: false }, (0,external_React_.createElement)(StyleBookBody, { category: tab.name, examples: examples, isSelected: isSelected, onSelect: onSelect, settings: settings, sizes: sizes, title: tab.title }))))) : (0,external_React_.createElement)(StyleBookBody, { examples: examples, isSelected: isSelected, onClick: onClick, onSelect: onSelect, settings: settings, sizes: sizes }))); } const StyleBookBody = ({ category, examples, isSelected, onClick, onSelect, settings, sizes, title }) => { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); // 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 = { role: 'button', onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), onKeyDown: event => { if (event.defaultPrevented) { return; } const { keyCode } = event; if (onClick && (keyCode === external_wp_keycodes_namespaceObject.ENTER || keyCode === external_wp_keycodes_namespaceObject.SPACE)) { event.preventDefault(); onClick(event); } }, onClick: event => { if (event.defaultPrevented) { return; } if (onClick) { event.preventDefault(); onClick(event); } }, readonly: true }; const buttonModeStyles = onClick ? 'body { cursor: pointer; } body * { pointer-events: none; }' : ''; return (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.__unstableIframe, { className: classnames_default()('edit-site-style-book__iframe', { 'is-focused': isFocused && !!onClick, 'is-button': !!onClick }), name: "style-book-canvas", tabIndex: 0, ...(onClick ? buttonModeProps : {}) }, (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: settings.styles }), (0,external_React_.createElement)("style", null, // 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), (0,external_React_.createElement)(Examples, { className: classnames_default()('edit-site-style-book__examples', { 'is-wide': sizes.width > 600 }), examples: examples, category: category, 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, key: category })); }; const Examples = (0,external_wp_element_namespaceObject.memo)(({ className, examples, category, label, isSelected, onSelect }) => { const compositeStore = useCompositeStore({ orientation: 'vertical' }); return (0,external_React_.createElement)(Composite, { store: compositeStore, className: className, "aria-label": label, role: "grid" }, examples.filter(example => category ? example.category === category : true).map(example => (0,external_React_.createElement)(Example, { key: example.name, id: `example-${example.name}`, title: example.title, blocks: example.blocks, isSelected: isSelected(example.name), onClick: () => { onSelect?.(example.name); } }))); }); const Example = ({ id, title, blocks, isSelected, onClick }) => { 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 }), [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]); return (0,external_React_.createElement)("div", { role: "row" }, (0,external_React_.createElement)("div", { role: "gridcell" }, (0,external_React_.createElement)(CompositeItem, { className: classnames_default()('edit-site-style-book__example', { 'is-selected': isSelected }), id: id, "aria-label": (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), render: (0,external_React_.createElement)("div", null), role: "button", onClick: onClick }, (0,external_React_.createElement)("span", { className: "edit-site-style-book__example-title" }, title), (0,external_React_.createElement)("div", { className: "edit-site-style-book__example-preview", "aria-hidden": true }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Disabled, { className: "edit-site-style-book__example-preview__content" }, (0,external_React_.createElement)(ExperimentalBlockEditorProvider, { value: renderedBlocks, settings: settings }, (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockList, { renderAppender: false }))))))); }; /* harmony default export */ const style_book = (StyleBook); ;// 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 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, 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"] const external_wp_date_namespaceObject = window["wp"]["date"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/backup.js /** * WordPress dependencies */ const backup = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js /** * WordPress dependencies */ function SidebarNavigationScreenDetailsPanelLabel({ children }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { className: "edit-site-sidebar-navigation-details-screen-panel__label" }, children); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js /** * External dependencies */ /** * WordPress dependencies */ function SidebarNavigationScreenDetailsPanelRow({ label, children, className, ...extraProps }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { key: label, spacing: 5, alignment: "left", className: classnames_default()('edit-site-sidebar-navigation-details-screen-panel__row', className), ...extraProps }, children); } ;// 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 (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { className: "edit-site-sidebar-navigation-details-screen-panel__value" }, 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 (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: "edit-site-sidebar-navigation-details-screen-panel", spacing: spacing }, title && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { className: "edit-site-sidebar-navigation-details-screen-panel__heading", level: 2 }, 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 }) { /* * 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 = {}; if (record?._links?.['predecessor-version']?.[0]?.id) { hrefProps.href = (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', { revision: record?._links['predecessor-version'][0].id }); hrefProps.as = 'a'; } return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-details-footer" }, (0,external_React_.createElement)(SidebarNavigationItem, { "aria-label": (0,external_wp_i18n_namespaceObject.__)('Revisions'), ...hrefProps, ...otherProps }, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, { justify: "space-between" }, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelLabel, null, (0,external_wp_i18n_namespaceObject.__)('Last modified')), (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelValue, null, (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: (0,external_React_.createElement)("time", { dateTime: record.modified }) })), (0,external_React_.createElement)(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_store); const { setCanvasMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const hasGlobalStyleVariations = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).__experimentalGetCurrentThemeGlobalStylesVariations()?.length, []); if (hasGlobalStyleVariations) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { ...props, as: SidebarNavigationItem, path: "/wp_global_styles" }); } return (0,external_React_.createElement)(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 } = unlock(select(store_store)); return { storedSettings: getSettings() }; }, []); // 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 (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { settings: storedSettings, onChange: sidebar_navigation_screen_global_styles_noop, onInput: sidebar_navigation_screen_global_styles_noop }, (0,external_React_.createElement)(StyleVariationsContainer, null)); } function SidebarNavigationScreenGlobalStyles() { const { revisions, isLoading: isLoadingRevisions } = useGlobalStylesRevisions(); const { openGeneralSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_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 } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const { isViewMode, isStyleBookOpened, revisionsCount } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _globalStyles$_links$; const { getCanvasMode, getEditorCanvasContainerView } = unlock(select(store_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 openGlobalStyles = (0,external_wp_element_namespaceObject.useCallback)(async () => { return Promise.all([setCanvasMode('edit'), openGeneralSidebar('edit-site/global-styles')]); }, [setCanvasMode, openGeneralSidebar]); 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 (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(SidebarNavigationScreen, { title: (0,external_wp_i18n_namespaceObject.__)('Styles'), description: (0,external_wp_i18n_namespaceObject.__)('Choose a different style combination for the theme styles.'), content: (0,external_React_.createElement)(SidebarNavigationScreenGlobalStylesContent, null), footer: shouldShowGlobalStylesFooter && (0,external_React_.createElement)(SidebarNavigationScreenDetailsFooter, { record: revisions?.[0], onClick: openRevisions }), actions: (0,external_React_.createElement)(external_React_.Fragment, null, !isMobileViewport && (0,external_React_.createElement)(SidebarButton, { icon: library_seen, label: (0,external_wp_i18n_namespaceObject.__)('Style Book'), onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined), isPressed: isStyleBookOpened }), (0,external_React_.createElement)(SidebarButton, { icon: edit, label: (0,external_wp_i18n_namespaceObject.__)('Edit styles'), onClick: async () => await openGlobalStyles() })) }), isStyleBookOpened && !isMobileViewport && isViewMode && (0,external_React_.createElement)(style_book, { enableResizing: false, isSelected: () => false, onClick: openStyleBook, onSelect: openStyleBook, showCloseButton: false, showTabs: false })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/template-part-hint.js /** * WordPress dependencies */ const PREFERENCE_NAME = 'isTemplatePartMoveHintVisible'; function TemplatePartHint() { const showTemplatePartHint = (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$get; return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', PREFERENCE_NAME)) !== null && _select$get !== void 0 ? _select$get : true; }, []); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); if (!showTemplatePartHint) { return null; } return (0,external_React_.createElement)(external_wp_components_namespaceObject.Notice, { politeness: "polite", className: "edit-site-sidebar__notice", onRemove: () => { setPreference('core', PREFERENCE_NAME, false); } }, (0,external_wp_i18n_namespaceObject.__)('Looking for template parts? Find them in "Patterns".')); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-main/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function SidebarNavigationScreenMain() { const { location } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { setEditorCanvasContainerView } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); // Clear the editor canvas container view when accessing the main navigation screen. (0,external_wp_element_namespaceObject.useEffect)(() => { if (location?.path === '/') { setEditorCanvasContainerView(undefined); } }, [setEditorCanvasContainerView, location?.path]); return (0,external_React_.createElement)(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: (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { as: SidebarNavigationItem, path: "/navigation", withChevron: true, icon: library_navigation }, (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_React_.createElement)(SidebarNavigationItemGlobalStyles, { withChevron: true, icon: library_styles }, (0,external_wp_i18n_namespaceObject.__)('Styles')), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { as: SidebarNavigationItem, path: "/page", withChevron: true, icon: library_page }, (0,external_wp_i18n_namespaceObject.__)('Pages')), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { as: SidebarNavigationItem, path: "/wp_template", withChevron: true, icon: library_layout }, (0,external_wp_i18n_namespaceObject.__)('Templates')), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, { as: SidebarNavigationItem, path: "/patterns", withChevron: true, icon: library_symbol }, (0,external_wp_i18n_namespaceObject.__)('Patterns'))), (0,external_React_.createElement)(TemplatePartHint, null)) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/home.js /** * WordPress dependencies */ const home = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" })); /* harmony default export */ const library_home = (home); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js /** * WordPress dependencies */ const verse = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" })); /* harmony default export */ const library_verse = (verse); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pin.js /** * WordPress dependencies */ const pin = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" })); /* harmony default export */ const library_pin = (pin); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive.js /** * WordPress dependencies */ const archive = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" })); /* harmony default export */ const library_archive = (archive); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js /** * WordPress dependencies */ const search = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" })); /* harmony default export */ const library_search = (search); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/not-found.js /** * WordPress dependencies */ const notFound = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z" })); /* harmony default export */ const not_found = (notFound); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js /** * WordPress dependencies */ const list = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" })); /* harmony default export */ const library_list = (list); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/category.js /** * WordPress dependencies */ const category = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/comment-author-avatar.js /** * WordPress dependencies */ const commentAuthorAvatar = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", clipRule: "evenodd" })); /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-meta.js /** * WordPress dependencies */ const blockMeta = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z", clipRule: "evenodd" })); /* harmony default export */ const block_meta = (blockMeta); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/calendar.js /** * WordPress dependencies */ const calendar = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" })); /* harmony default export */ const library_calendar = (calendar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js /** * WordPress dependencies */ const tag = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" })); /* harmony default export */ const library_tag = (tag); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js /** * WordPress dependencies */ const media = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" })); /* harmony default export */ const library_media = (media); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js /** * WordPress dependencies */ const plus = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/icons/build-module/library/post.js /** * WordPress dependencies */ const post = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" })); /* harmony default export */ const library_post = (post); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef IHasNameAndId * @property {string|number} id The entity's id. * @property {string} name The entity's name. */ const utils_getValueFromObjectPath = (object, path) => { let value = object; path.split('.').forEach(fieldName => { value = value?.[fieldName]; }); return value; }; /** * Helper util to map records to add a `name` prop from a * provided path, in order to handle all entities in the same * fashion(implementing`IHasNameAndId` interface). * * @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. */ const mapToIHasNameAndId = (entities, path) => { return (entities || []).map(entity => ({ ...entity, name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(utils_getValueFromObjectPath(entity, path)) })); }; /** * @typedef {Object} EntitiesInfo * @property {boolean} hasEntities If an entity has available records(posts, terms, etc..). * @property {number[]} existingEntitiesIds An array of the existing entities ids. */ const useExistingTemplates = () => { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', constants_TEMPLATE_POST_TYPE, { per_page: -1 }), []); }; const useDefaultTemplateTypes = () => { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplateTypes(), []); }; const usePublicPostTypes = () => { const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostTypes({ per_page: -1 }), []); return (0,external_wp_element_namespaceObject.useMemo)(() => { const excludedPostTypes = ['attachment']; return postTypes?.filter(({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug)); }, [postTypes]); }; const usePublicTaxonomies = () => { const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTaxonomies({ per_page: -1 }), []); return (0,external_wp_element_namespaceObject.useMemo)(() => { return taxonomies?.filter(({ visibility }) => visibility?.publicly_queryable); }, [taxonomies]); }; function usePostTypeNeedsUniqueIdentifier(publicPostTypes) { const postTypeLabels = (0,external_wp_element_namespaceObject.useMemo)(() => publicPostTypes?.reduce((accumulator, { labels }) => { const singularName = labels.singular_name.toLowerCase(); accumulator[singularName] = (accumulator[singularName] || 0) + 1; return accumulator; }, {})); return (0,external_wp_element_namespaceObject.useCallback)(({ labels, slug }) => { const singularName = labels.singular_name.toLowerCase(); return postTypeLabels[singularName] > 1 && singularName !== slug; }, [postTypeLabels]); } function usePostTypeArchiveMenuItems() { const publicPostTypes = usePublicPostTypes(); const postTypesWithArchives = (0,external_wp_element_namespaceObject.useMemo)(() => publicPostTypes?.filter(postType => postType.has_archive), [publicPostTypes]); const existingTemplates = useExistingTemplates(); const needsUniqueIdentifier = usePostTypeNeedsUniqueIdentifier(postTypesWithArchives); return (0,external_wp_element_namespaceObject.useMemo)(() => postTypesWithArchives?.filter(postType => !(existingTemplates || []).some(existingTemplate => existingTemplate.slug === 'archive-' + postType.slug)).map(postType => { let title; if (needsUniqueIdentifier(postType)) { title = (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.__)('Archive: %1$s (%2$s)'), postType.labels.singular_name, postType.slug); } else { title = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0,external_wp_i18n_namespaceObject.__)('Archive: %s'), postType.labels.singular_name); } return { slug: 'archive-' + postType.slug, description: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0,external_wp_i18n_namespaceObject.__)('Displays an archive with the latest posts of type: %s.'), postType.labels.singular_name), title, // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: postType.icon?.startsWith('dashicons-') ? postType.icon.slice(10) : library_archive, templatePrefix: 'archive' }; }) || [], [postTypesWithArchives, existingTemplates, needsUniqueIdentifier]); } const usePostTypeMenuItems = onClickMenuItem => { const publicPostTypes = usePublicPostTypes(); const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); const needsUniqueIdentifier = usePostTypeNeedsUniqueIdentifier(publicPostTypes); // `page`is a special case in template hierarchy. const templatePrefixes = (0,external_wp_element_namespaceObject.useMemo)(() => publicPostTypes?.reduce((accumulator, { slug }) => { let suffix = slug; if (slug !== 'page') { suffix = `single-${suffix}`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicPostTypes]); const postTypesInfo = useEntitiesInfo('postType', templatePrefixes); const existingTemplateSlugs = (existingTemplates || []).map(({ slug }) => slug); const menuItems = (publicPostTypes || []).reduce((accumulator, postType) => { const { slug, labels, icon } = postType; // We need to check if the general template is part of the // defaultTemplateTypes. If it is, just use that info and // augment it with the specific template functionality. const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find(({ slug: _slug }) => _slug === generalTemplateSlug); const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug); const _needsUniqueIdentifier = needsUniqueIdentifier(postType); let menuItemTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0,external_wp_i18n_namespaceObject.__)('Single item: %s'), labels.singular_name); if (_needsUniqueIdentifier) { menuItemTitle = (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); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0,external_wp_i18n_namespaceObject.__)('Displays a single item: %s.'), labels.singular_name), // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: icon?.startsWith('dashicons-') ? icon.slice(10) : library_post, templatePrefix: templatePrefixes[slug] }; const hasEntities = postTypesInfo?.[slug]?.hasEntities; // We have a different template creation flow only if they have entities. if (hasEntities) { menuItem.onClick = template => { onClickMenuItem({ type: 'postType', slug, config: { recordNamePath: 'title.rendered', queryArgs: ({ search }) => { return { _fields: 'id,title,slug,link', orderBy: search ? 'relevance' : 'modified', exclude: postTypesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: suggestion => { const templateSlug = `${templatePrefixes[slug]}-${suggestion.slug}`; return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, hasGeneralTemplate, template }); }; } // We don't need to add the menu item if there are no // entities and the general template exists. if (!hasGeneralTemplate || hasEntities) { accumulator.push(menuItem); } return accumulator; }, []); // Split menu items into two groups: one for the default post types // and one for the rest. const postTypesMenuItems = (0,external_wp_element_namespaceObject.useMemo)(() => menuItems.reduce((accumulator, postType) => { const { slug } = postType; let key = 'postTypesMenuItems'; if (slug === 'page') { key = 'defaultPostTypesMenuItems'; } accumulator[key].push(postType); return accumulator; }, { defaultPostTypesMenuItems: [], postTypesMenuItems: [] }), [menuItems]); return postTypesMenuItems; }; const useTaxonomiesMenuItems = onClickMenuItem => { const publicTaxonomies = usePublicTaxonomies(); const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); // `category` and `post_tag` are special cases in template hierarchy. const templatePrefixes = (0,external_wp_element_namespaceObject.useMemo)(() => publicTaxonomies?.reduce((accumulator, { slug }) => { let suffix = slug; if (!['category', 'post_tag'].includes(slug)) { suffix = `taxonomy-${suffix}`; } if (slug === 'post_tag') { suffix = `tag`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicTaxonomies]); // We need to keep track of naming conflicts. If a conflict // occurs, we need to add slug. const taxonomyLabels = publicTaxonomies?.reduce((accumulator, { labels }) => { const singularName = labels.singular_name.toLowerCase(); accumulator[singularName] = (accumulator[singularName] || 0) + 1; return accumulator; }, {}); const needsUniqueIdentifier = (labels, slug) => { if (['category', 'post_tag'].includes(slug)) { return false; } const singularName = labels.singular_name.toLowerCase(); return taxonomyLabels[singularName] > 1 && singularName !== slug; }; const taxonomiesInfo = useEntitiesInfo('taxonomy', templatePrefixes); const existingTemplateSlugs = (existingTemplates || []).map(({ slug }) => slug); const menuItems = (publicTaxonomies || []).reduce((accumulator, taxonomy) => { const { slug, labels } = taxonomy; // We need to check if the general template is part of the // defaultTemplateTypes. If it is, just use that info and // augment it with the specific template functionality. const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find(({ slug: _slug }) => _slug === generalTemplateSlug); const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug); const _needsUniqueIdentifier = needsUniqueIdentifier(labels, slug); let menuItemTitle = labels.singular_name; if (_needsUniqueIdentifier) { menuItemTitle = (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); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the taxonomy e.g: "Product Categories". (0,external_wp_i18n_namespaceObject.__)('Displays taxonomy: %s.'), labels.singular_name), icon: block_meta, templatePrefix: templatePrefixes[slug] }; const hasEntities = taxonomiesInfo?.[slug]?.hasEntities; // We have a different template creation flow only if they have entities. if (hasEntities) { menuItem.onClick = template => { onClickMenuItem({ type: 'taxonomy', slug, config: { queryArgs: ({ search }) => { return { _fields: 'id,name,slug,link', orderBy: search ? 'name' : 'count', exclude: taxonomiesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: suggestion => { const templateSlug = `${templatePrefixes[slug]}-${suggestion.slug}`; return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, hasGeneralTemplate, template }); }; } // We don't need to add the menu item if there are no // entities and the general template exists. if (!hasGeneralTemplate || hasEntities) { accumulator.push(menuItem); } return accumulator; }, []); // Split menu items into two groups: one for the default taxonomies // and one for the rest. const taxonomiesMenuItems = (0,external_wp_element_namespaceObject.useMemo)(() => menuItems.reduce((accumulator, taxonomy) => { const { slug } = taxonomy; let key = 'taxonomiesMenuItems'; if (['category', 'tag'].includes(slug)) { key = 'defaultTaxonomiesMenuItems'; } accumulator[key].push(taxonomy); return accumulator; }, { defaultTaxonomiesMenuItems: [], taxonomiesMenuItems: [] }), [menuItems]); return taxonomiesMenuItems; }; const USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX = { user: 'author' }; const USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS = { user: { who: 'authors' } }; function useAuthorMenuItem(onClickMenuItem) { const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); const authorInfo = useEntitiesInfo('root', USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX, USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS); let authorMenuItem = defaultTemplateTypes?.find(({ slug }) => slug === 'author'); if (!authorMenuItem) { authorMenuItem = { description: (0,external_wp_i18n_namespaceObject.__)('Displays latest posts written by a single author.'), slug: 'author', title: 'Author' }; } const hasGeneralTemplate = !!existingTemplates?.find(({ slug }) => slug === 'author'); if (authorInfo.user?.hasEntities) { authorMenuItem = { ...authorMenuItem, templatePrefix: 'author' }; authorMenuItem.onClick = template => { onClickMenuItem({ type: 'root', slug: 'user', config: { queryArgs: ({ search }) => { return { _fields: 'id,name,slug,link', orderBy: search ? 'name' : 'registered_date', exclude: authorInfo.user.existingEntitiesIds, who: 'authors' }; }, getSpecificTemplate: suggestion => { const templateSlug = `author-${suggestion.slug}`; return { title: templateSlug, slug: templateSlug, templatePrefix: 'author' }; } }, labels: { singular_name: (0,external_wp_i18n_namespaceObject.__)('Author'), search_items: (0,external_wp_i18n_namespaceObject.__)('Search Authors'), not_found: (0,external_wp_i18n_namespaceObject.__)('No authors found.'), all_items: (0,external_wp_i18n_namespaceObject.__)('All Authors') }, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || authorInfo.user?.hasEntities) { return authorMenuItem; } } /** * Helper hook that filters all the existing templates by the given * object with the entity's slug as key and the template prefix as value. * * Example: * `existingTemplates` is: [ { slug: 'tag-apple' }, { slug: 'page-about' }, { slug: 'tag' } ] * `templatePrefixes` is: { post_tag: 'tag' } * It will return: { post_tag: ['apple'] } * * Note: We append the `-` to the given template prefix in this function for our checks. * * @param {Record} templatePrefixes An object with the entity's slug as key and the template prefix as value. * @return {Record} An object with the entity's slug as key and an array with the existing template slugs as value. */ const useExistingTemplateSlugs = templatePrefixes => { const existingTemplates = useExistingTemplates(); const existingSlugs = (0,external_wp_element_namespaceObject.useMemo)(() => { return Object.entries(templatePrefixes || {}).reduce((accumulator, [slug, prefix]) => { const slugsWithTemplates = (existingTemplates || []).reduce((_accumulator, existingTemplate) => { const _prefix = `${prefix}-`; if (existingTemplate.slug.startsWith(_prefix)) { _accumulator.push(existingTemplate.slug.substring(_prefix.length)); } return _accumulator; }, []); if (slugsWithTemplates.length) { accumulator[slug] = slugsWithTemplates; } return accumulator; }, {}); }, [templatePrefixes, existingTemplates]); return existingSlugs; }; /** * Helper hook that finds the existing records with an associated template, * as they need to be excluded from the template suggestions. * * @param {string} entityName The entity's name. * @param {Record} templatePrefixes An object with the entity's slug as key and the template prefix as value. * @param {Record} additionalQueryParameters An object with the entity's slug as key and additional query parameters as value. * @return {Record} An object with the entity's slug as key and the existing records as value. */ const useTemplatesToExclude = (entityName, templatePrefixes, additionalQueryParameters = {}) => { const slugsToExcludePerEntity = useExistingTemplateSlugs(templatePrefixes); const recordsToExcludePerEntity = (0,external_wp_data_namespaceObject.useSelect)(select => { return Object.entries(slugsToExcludePerEntity || {}).reduce((accumulator, [slug, slugsWithTemplates]) => { const entitiesWithTemplates = select(external_wp_coreData_namespaceObject.store).getEntityRecords(entityName, slug, { _fields: 'id', context: 'view', slug: slugsWithTemplates, ...additionalQueryParameters[slug] }); if (entitiesWithTemplates?.length) { accumulator[slug] = entitiesWithTemplates; } return accumulator; }, {}); }, [slugsToExcludePerEntity]); return recordsToExcludePerEntity; }; /** * Helper hook that returns information about an entity having * records that we can create a specific template for. * * For example we can search for `terms` in `taxonomy` entity or * `posts` in `postType` entity. * * First we need to find the existing records with an associated template, * to query afterwards for any remaining record, by excluding them. * * @param {string} entityName The entity's name. * @param {Record} templatePrefixes An object with the entity's slug as key and the template prefix as value. * @param {Record} additionalQueryParameters An object with the entity's slug as key and additional query parameters as value. * @return {Record} An object with the entity's slug as key and the EntitiesInfo as value. */ const useEntitiesInfo = (entityName, templatePrefixes, additionalQueryParameters = {}) => { const recordsToExcludePerEntity = useTemplatesToExclude(entityName, templatePrefixes, additionalQueryParameters); const entitiesInfo = (0,external_wp_data_namespaceObject.useSelect)(select => { return Object.keys(templatePrefixes || {}).reduce((accumulator, slug) => { const existingEntitiesIds = recordsToExcludePerEntity?.[slug]?.map(({ id }) => id) || []; accumulator[slug] = { hasEntities: !!select(external_wp_coreData_namespaceObject.store).getEntityRecords(entityName, slug, { per_page: 1, _fields: 'id', context: 'view', exclude: existingEntitiesIds, ...additionalQueryParameters[slug] })?.length, existingEntitiesIds }; return accumulator; }, {}); }, [templatePrefixes, recordsToExcludePerEntity]); 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 } = unlock(external_wp_components_namespaceObject.privateApis); const add_custom_template_modal_content_EMPTY_ARRAY = []; function SuggestionListItem({ suggestion, search, onSelect, entityForSuggestions }) { const baseCssClass = 'edit-site-custom-template-modal__suggestions_list__list-item'; return (0,external_React_.createElement)(add_custom_template_modal_content_CompositeItem, { render: (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { role: "option", className: baseCssClass, onClick: () => onSelect(entityForSuggestions.config.getSpecificTemplate(suggestion)) }) }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { size: "body", lineHeight: 1.53846153846 // 20px , weight: 500, className: `${baseCssClass}__title` }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextHighlight, { text: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(suggestion.name), highlight: search })), suggestion.link && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { size: "body", lineHeight: 1.53846153846 // 20px , className: `${baseCssClass}__info` }, suggestion.link)); } function useSearchSuggestions(entityForSuggestions, search) { const { config } = entityForSuggestions; const query = (0,external_wp_element_namespaceObject.useMemo)(() => ({ order: 'asc', context: 'view', search, per_page: search ? 20 : 10, ...config.queryArgs(search) }), [search, config]); const { records: searchResults, hasResolved: searchHasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(entityForSuggestions.type, entityForSuggestions.slug, query); const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(add_custom_template_modal_content_EMPTY_ARRAY); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!searchHasResolved) return; let newSuggestions = add_custom_template_modal_content_EMPTY_ARRAY; if (searchResults?.length) { newSuggestions = searchResults; if (config.recordNamePath) { newSuggestions = mapToIHasNameAndId(newSuggestions, config.recordNamePath); } } // Update suggestions only when the query has resolved, so as to keep // the previous results in the UI. setSuggestions(newSuggestions); }, [searchResults, searchHasResolved]); return suggestions; } function SuggestionList({ 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 { labels } = entityForSuggestions; const [showSearchControl, setShowSearchControl] = (0,external_wp_element_namespaceObject.useState)(false); if (!showSearchControl && suggestions?.length > 9) { setShowSearchControl(true); } return (0,external_React_.createElement)(external_React_.Fragment, null, showSearchControl && (0,external_React_.createElement)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, onChange: setSearch, value: search, label: labels.search_items, placeholder: labels.search_items }), !!suggestions?.length && (0,external_React_.createElement)(add_custom_template_modal_content_Composite, { store: composite, role: "listbox", className: "edit-site-custom-template-modal__suggestions_list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suggestions list') }, suggestions.map(suggestion => (0,external_React_.createElement)(SuggestionListItem, { key: suggestion.slug, suggestion: suggestion, search: debouncedSearch, onSelect: onSelect, entityForSuggestions: entityForSuggestions }))), debouncedSearch && !suggestions?.length && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "p", className: "edit-site-custom-template-modal__no-results" }, labels.not_found)); } function AddCustomTemplateModalContent({ onSelect, entityForSuggestions }) { const [showSearchEntities, setShowSearchEntities] = (0,external_wp_element_namespaceObject.useState)(entityForSuggestions.hasGeneralTemplate); return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, className: "edit-site-custom-template-modal__contents-wrapper", alignment: "left" }, !showSearchEntities && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "p" }, (0,external_wp_i18n_namespaceObject.__)('Select whether to create a single template for all items or a specific one.')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Flex, { className: "edit-site-custom-template-modal__contents", gap: "4", align: "initial" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, as: external_wp_components_namespaceObject.Button, onClick: () => { const { slug, title, description, templatePrefix } = entityForSuggestions.template; onSelect({ slug, title, description, templatePrefix }); } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846 // 20px }, entityForSuggestions.labels.all_items), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "span", lineHeight: 1.53846153846 // 20px }, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. (0,external_wp_i18n_namespaceObject.__)('For all items'))), (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, as: external_wp_components_namespaceObject.Button, onClick: () => { setShowSearchEntities(true); } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846 // 20px }, entityForSuggestions.labels.singular_name), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "span", lineHeight: 1.53846153846 // 20px }, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. (0,external_wp_i18n_namespaceObject.__)('For a specific item'))))), showSearchEntities && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { as: "p" }, (0,external_wp_i18n_namespaceObject.__)('This template will be used only for the specific item chosen.')), (0,external_React_.createElement)(SuggestionList, { entityForSuggestions: entityForSuggestions, onSelect: onSelect }))); } /* harmony default export */ const add_custom_template_modal_content = (AddCustomTemplateModalContent); ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } 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; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } 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); }); }; } 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); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; 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); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } 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; if (async) { 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 (typeof dispose !== "function") throw new TypeError("Object not disposable."); env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } function next() { while (env.stack.length) { var rec = 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(); }); } catch (e) { fail(e); } } if (env.hasError) throw env.error; } return next(); } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, }); ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, az: { regexp: /\u0130/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { I: "\u0069\u0307", J: "\u006A\u0307", Į: "\u012F\u0307", Ì: "\u0069\u0307\u0300", Í: "\u0069\u0307\u0301", Ĩ: "\u0069\u0307\u0303", }, }, }; /** * Localized lower case. */ function localeLowerCase(str, locale) { var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; if (lang) return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); return lowerCase(str); } /** * Lower case as a function. */ function lowerCase(str) { return str.toLowerCase(); } ;// CONCATENATED MODULE: ./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]; // Remove all non-word characters. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; /** * Normalize the string into something other libraries can manipulate easier. */ function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; // Trim the delimiter from around the output string. while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; // Transform each token independently. return result.slice(start, end).split("\0").map(transform).join(delimiter); } /** * Replace `re` in the input string with the replacement value. */ function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function (input, re) { return input.replace(re, value); }, input); } ;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } ;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } 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 /** * External dependencies */ /** * WordPress dependencies */ function AddCustomGenericTemplateModalContent({ onClose, createTemplate }) { const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const defaultTitle = (0,external_wp_i18n_namespaceObject.__)('Custom Template'); const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); async function onCreateTemplate(event) { event.preventDefault(); if (isBusy) { return; } setIsBusy(true); try { await createTemplate({ slug: 'wp-custom-template-' + paramCase(title || defaultTitle), title: title || defaultTitle }, false); } finally { setIsBusy(false); } } return (0,external_React_.createElement)("form", { onSubmit: onCreateTemplate }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 6 }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, 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.') }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { className: "edit-site-custom-generic-template__modal-actions", justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => { onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", isBusy: isBusy, "aria-disabled": isBusy }, (0,external_wp_i18n_namespaceObject.__)('Create'))))); } /* harmony default export */ const add_custom_generic_template_modal_content = (AddCustomGenericTemplateModalContent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/template-actions-loading-screen.js /** * WordPress dependencies */ function TemplateActionsLoadingScreen() { const baseCssClass = 'edit-site-template-actions-loading-screen-modal'; return (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { isFullScreen: true, isDismissible: false, shouldCloseOnClickOutside: false, shouldCloseOnEsc: false, onRequestClose: () => {}, __experimentalHideHeader: true, className: baseCssClass }, (0,external_React_.createElement)("div", { className: `${baseCssClass}__content` }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Spinner, null))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/new-template.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Internal dependencies */ const { useHistory: new_template_useHistory } = 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, home: library_verse, single: library_pin, page: library_page, archive: library_archive, search: library_search, 404: not_found, index: library_list, category: library_category, author: comment_author_avatar, taxonomy: block_meta, date: library_calendar, tag: library_tag, attachment: library_media }; function TemplateListItem({ title, direction, className, description, icon, onClick, children }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { className: className, onClick: onClick, label: description, showTooltip: !!description }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Flex, { as: "span", spacing: 2, align: "center", justify: "center", style: { width: '100%' }, direction: direction }, (0,external_React_.createElement)("div", { className: "edit-site-add-new-template__template-icon" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { icon: icon })), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: "edit-site-add-new-template__template-name", alignment: "center", spacing: 0 }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { weight: 500, lineHeight: 1.53846153846 // 20px }, title), children))); } const modalContentMap = { templatesList: 1, customTemplate: 2, customGenericTemplate: 3 }; function NewTemplate({ postType, toggleProps, showIcon = true }) { const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false); const [modalContent, setModalContent] = (0,external_wp_element_namespaceObject.useState)(modalContentMap.templatesList); const [entityForSuggestions, setEntityForSuggestions] = (0,external_wp_element_namespaceObject.useState)({}); const [isCreatingTemplate, setIsCreatingTemplate] = (0,external_wp_element_namespaceObject.useState)(false); const history = new_template_useHistory(); 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 { homeUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getUnstableBase // Site index. } = select(external_wp_coreData_namespaceObject.store); return { homeUrl: getUnstableBase()?.home }; }, []); const TEMPLATE_SHORT_DESCRIPTIONS = { 'front-page': homeUrl, date: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The homepage url. (0,external_wp_i18n_namespaceObject.__)('E.g. %s'), homeUrl + '/' + new Date().getFullYear()) }; async function createTemplate(template, isWPSuggestion = true) { if (isCreatingTemplate) { return; } setIsCreatingTemplate(true); try { const { title, description, slug } = template; const newTemplate = await saveEntityRecord('postType', constants_TEMPLATE_POST_TYPE, { description, // Slugs need to be strings, so this is for template `404` slug: slug.toString(), status: 'publish', title, // This adds a post meta field in template that is part of `is_custom` value calculation. is_wp_suggestion: isWPSuggestion }, { throwOnError: true }); // Navigate to the created template editor. history.push({ postId: newTemplate.id, postType: newTemplate.type, canvas: 'edit' }); 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)(newTemplate.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 template.'); createErrorNotice(errorMessage, { type: 'snackbar' }); } finally { setIsCreatingTemplate(false); } } const onModalClose = () => { setShowModal(false); setModalContent(modalContentMap.templatesList); }; const missingTemplates = useMissingTemplates(setEntityForSuggestions, () => setModalContent(modalContentMap.customTemplate)); if (!missingTemplates.length) { return null; } const { as: Toggle = external_wp_components_namespaceObject.Button, ...restToggleProps } = toggleProps !== null && toggleProps !== void 0 ? toggleProps : {}; let modalTitle = (0,external_wp_i18n_namespaceObject.__)('Add template'); if (modalContent === modalContentMap.customTemplate) { modalTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0,external_wp_i18n_namespaceObject.__)('Add template: %s'), entityForSuggestions.labels.singular_name); } else if (modalContent === modalContentMap.customGenericTemplate) { modalTitle = (0,external_wp_i18n_namespaceObject.__)('Create custom template'); } return (0,external_React_.createElement)(external_React_.Fragment, null, isCreatingTemplate && (0,external_React_.createElement)(TemplateActionsLoadingScreen, null), (0,external_React_.createElement)(Toggle, { ...restToggleProps, onClick: () => setShowModal(true), icon: showIcon ? library_plus : null, label: postType.labels.add_new_item }, showIcon ? null : postType.labels.add_new_item), showModal && (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: modalTitle, className: classnames_default()('edit-site-add-new-template__modal', { 'edit-site-add-new-template__modal_template_list': modalContent === modalContentMap.templatesList, 'edit-site-custom-template-modal': modalContent === modalContentMap.customTemplate }), onRequestClose: onModalClose, overlayClassName: modalContent === modalContentMap.customGenericTemplate ? 'edit-site-custom-generic-template__modal' : undefined }, modalContent === modalContentMap.templatesList && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalGrid, { columns: 3, gap: 4, align: "flex-start", justify: "center", className: "edit-site-add-new-template__template-list__contents" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Flex, { className: "edit-site-add-new-template__template-list__prompt" }, (0,external_wp_i18n_namespaceObject.__)('Select what the new template should apply to:')), missingTemplates.map(template => { const { title, slug, onClick } = template; return (0,external_React_.createElement)(TemplateListItem, { key: slug, title: title, direction: "column", className: "edit-site-add-new-template__template-button", description: TEMPLATE_SHORT_DESCRIPTIONS[slug], icon: TEMPLATE_ICONS[slug] || library_layout, onClick: () => onClick ? onClick(template) : createTemplate(template) }); }), (0,external_React_.createElement)(TemplateListItem, { title: (0,external_wp_i18n_namespaceObject.__)('Custom template'), direction: "row", className: "edit-site-add-new-template__custom-template-button", icon: edit, onClick: () => setModalContent(modalContentMap.customGenericTemplate) }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalText, { lineHeight: 1.53846153846 // 20px }, (0,external_wp_i18n_namespaceObject.__)('A custom template can be manually applied to any post or page.')))), modalContent === modalContentMap.customTemplate && (0,external_React_.createElement)(add_custom_template_modal_content, { onSelect: createTemplate, entityForSuggestions: entityForSuggestions }), modalContent === modalContentMap.customGenericTemplate && (0,external_React_.createElement)(add_custom_generic_template_modal_content, { onClose: onModalClose, createTemplate: createTemplate }))); } function useMissingTemplates(setEntityForSuggestions, onClick) { const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); const existingTemplateSlugs = (existingTemplates || []).map(({ slug }) => slug); const missingDefaultTemplates = (defaultTemplateTypes || []).filter(template => DEFAULT_TEMPLATE_SLUGS.includes(template.slug) && !existingTemplateSlugs.includes(template.slug)); const onClickMenuItem = _entityForSuggestions => { onClick?.(); setEntityForSuggestions(_entityForSuggestions); }; // We need to replace existing default template types with // the create specific template functionality. The original // info (title, description, etc.) is preserved in the // used hooks. const enhancedMissingDefaultTemplateTypes = [...missingDefaultTemplates]; const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } = useTaxonomiesMenuItems(onClickMenuItem); const { defaultPostTypesMenuItems, postTypesMenuItems } = usePostTypeMenuItems(onClickMenuItem); const authorMenuItem = useAuthorMenuItem(onClickMenuItem); [...defaultTaxonomiesMenuItems, ...defaultPostTypesMenuItems, authorMenuItem].forEach(menuItem => { if (!menuItem) { return; } const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex(template => template.slug === menuItem.slug); // Some default template types might have been filtered above from // `missingDefaultTemplates` because they only check for the general // template. So here we either replace or append the item, augmented // with the check if it has available specific item to create a // template for. if (matchIndex > -1) { enhancedMissingDefaultTemplateTypes[matchIndex] = menuItem; } else { enhancedMissingDefaultTemplateTypes.push(menuItem); } }); // Update the sort order to match the DEFAULT_TEMPLATE_SLUGS order. enhancedMissingDefaultTemplateTypes?.sort((template1, template2) => { return DEFAULT_TEMPLATE_SLUGS.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS.indexOf(template2.slug); }); const missingTemplates = [...enhancedMissingDefaultTemplateTypes, ...usePostTypeArchiveMenuItems(), ...postTypesMenuItems, ...taxonomiesMenuItems]; return missingTemplates; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/add-new-template/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function AddNewTemplate({ templateType = constants_TEMPLATE_POST_TYPE, ...props }) { const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getPostType(templateType), [templateType]); if (!postType) { return null; } if (templateType === constants_TEMPLATE_POST_TYPE) { return (0,external_React_.createElement)(NewTemplate, { ...props, postType: postType }); } return null; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const TemplateItem = ({ postType, postId, ...props }) => { const linkInfo = useLink({ postType, postId }); return (0,external_React_.createElement)(SidebarNavigationItem, { ...linkInfo, ...props }); }; function SidebarNavigationScreenTemplates() { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { records: templates, isResolving: isLoading } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', constants_TEMPLATE_POST_TYPE, { per_page: -1 }); const browseAllLink = useLink({ path: '/wp_template/all' }); const canCreate = !isMobileViewport; return (0,external_React_.createElement)(SidebarNavigationScreen, { title: (0,external_wp_i18n_namespaceObject.__)('Templates'), description: (0,external_wp_i18n_namespaceObject.__)('Express the layout of your site with templates.'), actions: canCreate && (0,external_React_.createElement)(AddNewTemplate, { templateType: constants_TEMPLATE_POST_TYPE, toggleProps: { as: SidebarButton } }), content: (0,external_React_.createElement)(external_React_.Fragment, null, isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading templates…'), !isLoading && (0,external_React_.createElement)(SidebarTemplatesList, { templates: templates })), footer: !isMobileViewport && (0,external_React_.createElement)(SidebarNavigationItem, { withChevron: true, ...browseAllLink }, (0,external_wp_i18n_namespaceObject.__)('Manage all templates')) }); } function TemplatesGroup({ title, templates }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, !!title && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, { className: "edit-site-sidebar-navigation-screen-templates__templates-group-title" }, title), templates.map(template => (0,external_React_.createElement)(TemplateItem, { postType: constants_TEMPLATE_POST_TYPE, postId: template.id, key: template.id, withChevron: true }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title?.rendered || template.slug)))); } function SidebarTemplatesList({ templates }) { if (!templates?.length) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('No templates found'))); } const sortedTemplates = templates ? [...templates] : []; sortedTemplates.sort((a, b) => a.title.rendered.localeCompare(b.title.rendered)); const { hierarchyTemplates, customTemplates, ...plugins } = sortedTemplates.reduce((accumulator, template) => { const { original_source: originalSource, author_text: authorText } = template; if (originalSource === 'plugin') { if (!accumulator[authorText]) { accumulator[authorText] = []; } accumulator[authorText].push(template); } else if (template.is_custom) { accumulator.customTemplates.push(template); } else { accumulator.hierarchyTemplates.push(template); } return accumulator; }, { hierarchyTemplates: [], customTemplates: [] }); return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3 }, !!hierarchyTemplates.length && (0,external_React_.createElement)(TemplatesGroup, { templates: hierarchyTemplates }), !!customTemplates.length && (0,external_React_.createElement)(TemplatesGroup, { title: (0,external_wp_i18n_namespaceObject.__)('Custom'), templates: customTemplates }), Object.entries(plugins).map(([plugin, pluginTemplates]) => { return (0,external_React_.createElement)(TemplatesGroup, { key: plugin, title: plugin, templates: pluginTemplates }); })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-template/template-areas.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplateAreaButton({ postId, area, title }) { const templatePartArea = (0,external_wp_data_namespaceObject.useSelect)(select => { const defaultAreas = select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(); return defaultAreas.find(defaultArea => defaultArea.area === area); }, [area]); const linkInfo = useLink({ postType: TEMPLATE_PART_POST_TYPE, postId }); return (0,external_React_.createElement)(SidebarNavigationItem, { className: "edit-site-sidebar-navigation-screen-template__template-area-button", ...linkInfo, icon: templatePartArea?.icon, withChevron: true }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { limit: 20, ellipsizeMode: "tail", numberOfLines: 1, className: "edit-site-sidebar-navigation-screen-template__template-area-label-text" }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title))); } function TemplateAreas() { const { templatePartAreas, currentTemplateParts } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getCurrentTemplateTemplateParts } = unlock(select(store_store)); return { templatePartAreas: getSettings()?.defaultTemplatePartAreas, currentTemplateParts: getCurrentTemplateTemplateParts() }; }, []); /* * Merge data in currentTemplateParts with templatePartAreas, * which contains the template icon and fallback labels */ const templateAreas = (0,external_wp_element_namespaceObject.useMemo)(() => { // Keep track of template part IDs that have already been added to the array. const templatePartIds = new Set(); const filterOutDuplicateTemplateParts = currentTemplatePart => { // If the template part has already been added to the array, skip it. if (templatePartIds.has(currentTemplatePart.templatePart.id)) { return; } // Add to the array of template part IDs. templatePartIds.add(currentTemplatePart.templatePart.id); return currentTemplatePart; }; return currentTemplateParts.length && templatePartAreas ? currentTemplateParts.filter(filterOutDuplicateTemplateParts).map(({ templatePart, block }) => ({ ...templatePartAreas?.find(({ area }) => area === templatePart?.area), ...templatePart, clientId: block.clientId })) : []; }, [currentTemplateParts, templatePartAreas]); if (!templateAreas.length) { return null; } return (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanel, { title: (0,external_wp_i18n_namespaceObject.__)('Areas'), spacing: 3 }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, templateAreas.map(({ clientId, label, area, theme, slug, title }) => (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, { key: clientId }, (0,external_React_.createElement)(TemplateAreaButton, { postId: `${theme}//${slug}`, title: title?.rendered || label, area: area }))))); } ;// 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_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/icons/build-module/library/plugins.js /** * WordPress dependencies */ const plugins = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" })); /* harmony default export */ const library_plugins = (plugins); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/globe.js /** * WordPress dependencies */ const globe = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z" })); /* harmony default export */ const library_globe = (globe); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/list/added-by.js // @ts-check /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {'wp_template'|'wp_template_part'} TemplateType */ /** * @typedef {'theme'|'plugin'|'site'|'user'} AddedByType * * @typedef AddedByData * @type {Object} * @property {AddedByType} type The type of the data. * @property {JSX.Element} icon The icon to display. * @property {string} [imageUrl] The optional image URL to display. * @property {string} [text] The text to display. * @property {boolean} isCustomized Whether the template has been customized. * * @param {TemplateType} postType The template post type. * @param {number} postId The template post id. * @return {AddedByData} The added by object or null. */ function useAddedBy(postType, postId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord, getMedia, getUser, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const template = getEditedEntityRecord('postType', postType, postId); const originalSource = template?.original_source; const authorText = template?.author_text; switch (originalSource) { case 'theme': { return { type: originalSource, icon: library_layout, text: authorText, isCustomized: template.source === TEMPLATE_ORIGINS.custom }; } case 'plugin': { return { type: originalSource, icon: library_plugins, text: authorText, isCustomized: template.source === TEMPLATE_ORIGINS.custom }; } case 'site': { const siteData = getEntityRecord('root', '__unstableBase'); return { type: originalSource, icon: library_globe, imageUrl: siteData?.site_logo ? getMedia(siteData.site_logo)?.source_url : undefined, text: authorText, isCustomized: false }; } default: { const user = getUser(template.author); return { type: 'user', icon: comment_author_avatar, imageUrl: user?.avatar_urls?.[48], text: authorText, isCustomized: false }; } } }, [postType, postId]); } /** * @param {Object} props * @param {string} props.imageUrl */ function AvatarImage({ imageUrl }) { const [isImageLoaded, setIsImageLoaded] = (0,external_wp_element_namespaceObject.useState)(false); return (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-list-added-by__avatar', { 'is-loaded': isImageLoaded }) }, (0,external_React_.createElement)("img", { onLoad: () => setIsImageLoaded(true), alt: "", src: imageUrl })); } /** * @param {Object} props * @param {TemplateType} props.postType The template post type. * @param {number} props.postId The template post id. */ function AddedBy({ postType, postId }) { const { text, icon, imageUrl, isCustomized } = useAddedBy(postType, postId); return createElement(HStack, { alignment: "left" }, imageUrl ? createElement(AvatarImage, { imageUrl: imageUrl }) : createElement("div", { className: "edit-site-list-added-by__icon" }, createElement(Icon, { icon: icon })), createElement("span", null, text, isCustomized && createElement("span", { className: "edit-site-list-added-by__customized-info" }, postType === TEMPLATE_POST_TYPE ? _x('Customized', 'template') : _x('Customized', 'template part')))); } ;// 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/components/template-actions/rename-menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function RenameMenuItem({ template, onClose }) { const title = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered); const [editedTitle, setEditedTitle] = (0,external_wp_element_namespaceObject.useState)(title); const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); 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); if (template.type === constants_TEMPLATE_POST_TYPE && !template.is_custom) { return null; } async function onTemplateRename(event) { event.preventDefault(); try { await editEntityRecord('postType', template.type, template.id, { title: editedTitle }); // Update state before saving rerenders the list. setEditedTitle(''); setIsModalOpen(false); onClose(); // Persist edited entity. await saveSpecifiedEntityEdits('postType', template.type, template.id, ['title'], // Only save title to avoid persisting other edits. { throwOnError: true }); createSuccessNotice(template.type === constants_TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.__)('Template renamed.') : (0,external_wp_i18n_namespaceObject.__)('Template part renamed.'), { type: 'snackbar' }); } catch (error) { const fallbackErrorMessage = template.type === constants_TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while renaming the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while renaming the template part.'); const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : fallbackErrorMessage; createErrorNotice(errorMessage, { type: 'snackbar' }); } } return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsModalOpen(true); setEditedTitle(title); } }, (0,external_wp_i18n_namespaceObject.__)('Rename')), isModalOpen && (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: "edit-site-list__rename-modal" }, (0,external_React_.createElement)("form", { onSubmit: onTemplateRename }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: editedTitle, onChange: setEditedTitle, required: true }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { setIsModalOpen(false); } }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit" }, (0,external_wp_i18n_namespaceObject.__)('Save'))))))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/template-actions/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplateActions({ postType, postId, className, toggleProps, onRemove }) { const template = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId), [postType, postId]); const { removeTemplate, revertTemplate } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { saveEditedEntityRecord } = (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 isRemovable = isTemplateRemovable(template); const isRevertable = isTemplateRevertable(template); if (!isRemovable && !isRevertable) { return null; } async function revertAndSaveTemplate() { try { await revertTemplate(template, { allowUndo: false }); await saveEditedEntityRecord('postType', template.type, template.id); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */ (0,external_wp_i18n_namespaceObject.__)('"%s" reverted.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title.rendered)), { type: 'snackbar', id: 'edit-site-template-reverted' }); } catch (error) { const fallbackErrorMessage = template.type === constants_TEMPLATE_POST_TYPE ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the template part.'); const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : fallbackErrorMessage; createErrorNotice(errorMessage, { type: 'snackbar' }); } } return (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), className: className, toggleProps: toggleProps }, ({ onClose }) => (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, isRemovable && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(RenameMenuItem, { template: template, onClose: onClose }), (0,external_React_.createElement)(DeleteMenuItem, { onRemove: () => { removeTemplate(template); onRemove?.(); onClose(); }, title: template.title.rendered })), isRevertable && (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { info: (0,external_wp_i18n_namespaceObject.__)('Use the template as supplied by the theme.'), onClick: () => { revertAndSaveTemplate(); onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Clear customizations')))); } function DeleteMenuItem({ onRemove, title }) { const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { isDestructive: true, onClick: () => setIsModalOpen(true) }, (0,external_wp_i18n_namespaceObject.__)('Delete')), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: isModalOpen, onConfirm: onRemove, onCancel: () => setIsModalOpen(false), confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete') }, (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The template or template part's title. (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete "%s"?'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-template/home-template-details.js /** * WordPress dependencies */ /** * Internal dependencies */ const EMPTY_OBJECT = {}; function HomeTemplateDetails() { const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { allowCommentsOnNewPosts, postsPerPage, postsPageTitle, postsPageId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEntityRecord('root', 'site'); const _postsPageRecord = siteSettings?.page_for_posts ? getEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT; return { allowCommentsOnNewPosts: siteSettings?.default_comment_status === 'open', postsPageTitle: _postsPageRecord?.title?.rendered, postsPageId: _postsPageRecord?.id, postsPerPage: siteSettings?.posts_per_page }; }, []); const [commentsOnNewPostsValue, setCommentsOnNewPostsValue] = (0,external_wp_element_namespaceObject.useState)(''); const [postsCountValue, setPostsCountValue] = (0,external_wp_element_namespaceObject.useState)(1); const [postsPageTitleValue, setPostsPageTitleValue] = (0,external_wp_element_namespaceObject.useState)(''); /* * This hook serves to set the server-retrieved values, * postsPageTitle, allowCommentsOnNewPosts, postsPerPage, * to local state. */ (0,external_wp_element_namespaceObject.useEffect)(() => { setCommentsOnNewPostsValue(allowCommentsOnNewPosts); setPostsPageTitleValue(postsPageTitle); setPostsCountValue(postsPerPage); }, [postsPageTitle, allowCommentsOnNewPosts, postsPerPage]); const setAllowCommentsOnNewPosts = newValue => { setCommentsOnNewPostsValue(newValue); editEntityRecord('root', 'site', undefined, { default_comment_status: newValue ? 'open' : null }); }; const setPostsPageTitle = newValue => { setPostsPageTitleValue(newValue); editEntityRecord('postType', 'page', postsPageId, { title: newValue }); }; const setPostsPerPage = newValue => { setPostsCountValue(newValue); editEntityRecord('root', 'site', undefined, { posts_per_page: newValue }); }; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanel, { spacing: 6 }, postsPageId && (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalInputControl, { className: "edit-site-sidebar-navigation-screen__input-control", placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'), size: '__unstable-large', value: postsPageTitleValue, onChange: (0,external_wp_compose_namespaceObject.debounce)(setPostsPageTitle, 300), label: (0,external_wp_i18n_namespaceObject.__)('Blog title'), help: (0,external_wp_i18n_namespaceObject.__)('Set the Posts Page title. Appears in search results, and when the page is shared on social media.') })), (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, { className: "edit-site-sidebar-navigation-screen__input-control", placeholder: 0, value: postsCountValue, size: '__unstable-large', spinControls: "custom", step: "1", min: "1", onChange: setPostsPerPage, label: (0,external_wp_i18n_namespaceObject.__)('Posts per page'), help: (0,external_wp_i18n_namespaceObject.__)('Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.') }))), (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanel, { title: (0,external_wp_i18n_namespaceObject.__)('Discussion'), spacing: 3 }, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.CheckboxControl, { className: "edit-site-sidebar-navigation-screen__input-control", label: (0,external_wp_i18n_namespaceObject.__)('Allow comments on new posts'), help: (0,external_wp_i18n_namespaceObject.__)('Changes will apply to new posts only. Individual posts may override these settings.'), checked: commentsOnNewPostsValue, onChange: setAllowCommentsOnNewPosts })))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-template/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useTemplateDetails(postType, postId) { const { getDescription, getTitle, record } = useEditedEntityRecord(postType, postId); const currentTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme(), []); const addedBy = useAddedBy(postType, postId); const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet; const title = getTitle(); let descriptionText = getDescription(); if (!descriptionText && addedBy.text) { descriptionText = (0,external_wp_i18n_namespaceObject.__)('This is a custom template that can be applied manually to any Post or Page.'); } const content = record?.slug === 'home' || record?.slug === 'index' ? (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(HomeTemplateDetails, null), (0,external_React_.createElement)(TemplateAreas, null)) : (0,external_React_.createElement)(TemplateAreas, null); const footer = record?.modified ? (0,external_React_.createElement)(SidebarNavigationScreenDetailsFooter, { record: record }) : null; const description = (0,external_React_.createElement)(external_React_.Fragment, null, descriptionText, addedBy.text && !isAddedByActiveTheme && (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-template__added-by-description" }, (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-template__added-by-description-author" }, (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-template__added-by-description-author-icon" }, addedBy.imageUrl ? (0,external_React_.createElement)("img", { src: addedBy.imageUrl, alt: "", width: "24", height: "24" }) : (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { icon: addedBy.icon })), addedBy.text), addedBy.isCustomized && (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-template__added-by-description-customized" }, (0,external_wp_i18n_namespaceObject._x)('(Customized)', 'template')))); return { title, description, content, footer }; } function SidebarNavigationScreenTemplate() { const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { params: { postType, postId } } = navigator; const { setCanvasMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const { title, content, description, footer } = useTemplateDetails(postType, postId); return (0,external_React_.createElement)(SidebarNavigationScreen, { title: title, actions: (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(TemplateActions, { postType: postType, postId: postId, toggleProps: { as: SidebarButton }, onRemove: () => { navigator.goTo(`/${postType}/all`); } }), (0,external_React_.createElement)(SidebarButton, { onClick: () => setCanvasMode('edit'), label: (0,external_wp_i18n_namespaceObject.__)('Edit'), icon: library_pencil })), description: description, content: content, footer: footer }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/file.js /** * WordPress dependencies */ const file = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/icons/build-module/library/symbol-filled.js /** * WordPress dependencies */ const symbolFilled = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/icons/build-module/library/upload.js /** * WordPress dependencies */ const upload = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" })); /* harmony default export */ const library_upload = (upload); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/template-part-create.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const useExistingTemplateParts = () => { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, { per_page: -1 }), []); }; /** * Return a unique template part title based on * the given title and existing template parts. * * @param {string} title The original template part title. * @param {Object} templateParts The array of template part entities. * @return {string} A unique template part title. */ const getUniqueTemplatePartTitle = (title, templateParts) => { const lowercaseTitle = title.toLowerCase(); const existingTitles = templateParts.map(templatePart => templatePart.title.rendered.toLowerCase()); if (!existingTitles.includes(lowercaseTitle)) { return title; } let suffix = 2; while (existingTitles.includes(`${lowercaseTitle} ${suffix}`)) { suffix++; } return `${title} ${suffix}`; }; /** * Get a valid slug for a template part. * Currently template parts only allow latin chars. * The fallback slug will receive suffix by default. * * @param {string} title The template part title. * @return {string} A valid template part slug. */ const getCleanTemplatePartSlug = title => { return paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/create-template-part-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function CreateTemplatePartModal({ modalTitle = (0,external_wp_i18n_namespaceObject.__)('Create template part'), ...restProps }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: modalTitle, onRequestClose: restProps.closeModal, overlayClassName: "edit-site-create-template-part-modal" }, (0,external_React_.createElement)(CreateTemplatePartModalContents, { ...restProps })); } function CreateTemplatePartModalContents({ defaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY, blocks = [], confirmLabel = (0,external_wp_i18n_namespaceObject.__)('Create'), closeModal, onCreate, onError, defaultTitle = '' }) { const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const existingTemplateParts = useExistingTemplateParts(); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(defaultTitle); const [area, setArea] = (0,external_wp_element_namespaceObject.useState)(defaultArea); const [isSubmitting, setIsSubmitting] = (0,external_wp_element_namespaceObject.useState)(false); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CreateTemplatePartModal); const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); async function createTemplatePart() { if (!title || isSubmitting) { return; } try { setIsSubmitting(true); const uniqueTitle = getUniqueTemplatePartTitle(title, existingTemplateParts); const cleanSlug = getCleanTemplatePartSlug(uniqueTitle); const templatePart = await saveEntityRecord('postType', TEMPLATE_PART_POST_TYPE, { slug: cleanSlug, title: uniqueTitle, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), area }, { throwOnError: true }); await onCreate(templatePart); // TODO: Add a success notice? } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the template part.'); createErrorNotice(errorMessage, { type: 'snackbar' }); onError?.(); } finally { setIsSubmitting(false); } } return (0,external_React_.createElement)("form", { onSubmit: async event => { event.preventDefault(); await createTemplatePart(); } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "4" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, required: true }), (0,external_React_.createElement)(external_wp_components_namespaceObject.BaseControl, { label: (0,external_wp_i18n_namespaceObject.__)('Area'), id: `edit-site-create-template-part-modal__area-selection-${instanceId}`, className: "edit-site-create-template-part-modal__area-base-control" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalRadioGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Area'), className: "edit-site-create-template-part-modal__area-radio-group", id: `edit-site-create-template-part-modal__area-selection-${instanceId}`, onChange: setArea, checked: area }, templatePartAreas.map(({ icon, label, area: value, description }) => (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalRadio, { key: label, value: value, className: "edit-site-create-template-part-modal__area-radio" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Flex, { align: "start", justify: "start" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { icon: icon })), (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexBlock, { className: "edit-site-create-template-part-modal__option-label" }, label, (0,external_React_.createElement)("div", null, description)), (0,external_React_.createElement)(external_wp_components_namespaceObject.FlexItem, { className: "edit-site-create-template-part-modal__checkbox" }, area === value && (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { icon: library_check }))))))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => { closeModal(); } }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", "aria-disabled": !title || isSubmitting, isBusy: isSubmitting }, confirmLabel)))); } ;// 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, useLocation: add_new_pattern_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const { CreatePatternModal, useAddPatternCategory } = unlock(external_wp_patterns_namespaceObject.privateApis); function AddNewPattern() { const history = add_new_pattern_useHistory(); const { params } = add_new_pattern_useLocation(); const [showPatternModal, setShowPatternModal] = (0,external_wp_element_namespaceObject.useState)(false); const [showTemplatePartModal, setShowTemplatePartModal] = (0,external_wp_element_namespaceObject.useState)(false); const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.is_block_theme; }, []); const { createPatternFromFile } = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_patterns_namespaceObject.store)); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const patternUploadInputRef = (0,external_wp_element_namespaceObject.useRef)(); function handleCreatePattern({ pattern, categoryId }) { setShowPatternModal(false); history.push({ postId: pattern.id, postType: PATTERN_TYPES.user, categoryType: PATTERN_TYPES.theme, categoryId, 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' }); } function handleError() { setShowPatternModal(false); setShowTemplatePartModal(false); } const controls = [{ icon: library_symbol, onClick: () => setShowPatternModal(true), title: (0,external_wp_i18n_namespaceObject.__)('Create pattern') }]; if (isBlockBasedTheme) { controls.push({ icon: symbol_filled, onClick: () => setShowTemplatePartModal(true), title: (0,external_wp_i18n_namespaceObject.__)('Create template part') }); } controls.push({ icon: library_upload, onClick: () => { patternUploadInputRef.current.click(); }, title: (0,external_wp_i18n_namespaceObject.__)('Import pattern from JSON') }); const { categoryMap, findOrCreateTerm } = useAddPatternCategory(); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { controls: controls, toggleProps: { as: SidebarButton }, icon: library_plus, label: (0,external_wp_i18n_namespaceObject.__)('Create pattern') }), showPatternModal && (0,external_React_.createElement)(CreatePatternModal, { onClose: () => setShowPatternModal(false), onSuccess: handleCreatePattern, onError: handleError }), showTemplatePartModal && (0,external_React_.createElement)(CreateTemplatePartModal, { closeModal: () => setShowTemplatePartModal(false), blocks: [], onCreate: handleCreateTemplatePart, onError: handleError }), (0,external_React_.createElement)("input", { type: "file", accept: ".json", hidden: true, ref: patternUploadInputRef, onChange: async event => { const file = event.target.files?.[0]; if (!file) return; try { let currentCategoryId; // When we're not handling template parts, we should // add or create the proper pattern category. if (params.categoryType !== TEMPLATE_PART_POST_TYPE) { const currentCategory = categoryMap.values().find(term => term.name === params.categoryId); if (!!currentCategory) { currentCategoryId = currentCategory.id || (await findOrCreateTerm(currentCategory.label)); } } const pattern = await createPatternFromFile(file, currentCategoryId ? [currentCategoryId] : undefined); // 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 && params.categoryId !== 'my-patterns') { history.push({ path: `/patterns`, categoryType: PATTERN_TYPES.theme, categoryId: PATTERN_DEFAULT_CATEGORY }); } createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The imported pattern's title. (0,external_wp_i18n_namespaceObject.__)('Imported "%s" from JSON.'), pattern.title.raw), { type: 'snackbar', id: 'import-pattern-success' }); } catch (err) { createErrorNotice(err.message, { type: 'snackbar', id: 'import-pattern-error' }); } finally { event.target.value = ''; } } })); } ;// 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({ path: '/patterns', categoryType: type, categoryId: id }); if (!count) { return; } return (0,external_React_.createElement)(SidebarNavigationItem, { ...linkInfo, icon: icon, suffix: (0,external_React_.createElement)("span", null, count), "aria-current": isActive ? 'true' : undefined }, label); } ;// 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 } = unlock(select(store_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/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/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_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/rememo/rememo.js /** @typedef {(...args: any[]) => *[]} GetDependants */ /** @typedef {() => void} Clear */ /** * @typedef {{ * getDependants: GetDependants, * clear: Clear * }} EnhancedSelector */ /** * Internal cache entry. * * @typedef CacheNode * * @property {?CacheNode|undefined} [prev] Previous node. * @property {?CacheNode|undefined} [next] Next node. * @property {*[]} args Function arguments for cache entry. * @property {*} val Function result. */ /** * @typedef Cache * * @property {Clear} clear Function to clear cache. * @property {boolean} [isUniqueByDependants] Whether dependants are valid in * considering cache uniqueness. A cache is unique if dependents are all arrays * or objects. * @property {CacheNode?} [head] Cache head. * @property {*[]} [lastDependants] Dependants from previous invocation. */ /** * Arbitrary value used as key for referencing cache object in WeakMap tree. * * @type {{}} */ var LEAF_KEY = {}; /** * Returns the first argument as the sole entry in an array. * * @template T * * @param {T} value Value to return. * * @return {[T]} Value returned as entry in array. */ function arrayOf(value) { return [value]; } /** * Returns true if the value passed is object-like, or false otherwise. A value * is object-like if it can support property assignment, e.g. object or array. * * @param {*} value Value to test. * * @return {boolean} Whether value is object-like. */ function isObjectLike(value) { return !!value && 'object' === typeof value; } /** * Creates and returns a new cache object. * * @return {Cache} Cache object. */ function createCache() { /** @type {Cache} */ var cache = { clear: function () { cache.head = null; }, }; return cache; } /** * Returns true if entries within the two arrays are strictly equal by * reference from a starting index. * * @param {*[]} a First array. * @param {*[]} b Second array. * @param {number} fromIndex Index from which to start comparison. * * @return {boolean} Whether arrays are shallowly equal. */ function isShallowEqual(a, b, fromIndex) { var i; if (a.length !== b.length) { return false; } for (i = fromIndex; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; } /** * Returns a memoized selector function. The getDependants function argument is * called before the memoized selector and is expected to return an immutable * reference or array of references on which the selector depends for computing * its own return value. The memoize cache is preserved only as long as those * dependant references remain the same. If getDependants returns a different * reference(s), the cache is cleared and the selector value regenerated. * * @template {(...args: *[]) => *} S * * @param {S} selector Selector function. * @param {GetDependants=} getDependants Dependant getter returning an array of * references used in cache bust consideration. */ /* harmony default export */ function rememo(selector, getDependants) { /** @type {WeakMap<*,*>} */ var rootCache; /** @type {GetDependants} */ var normalizedGetDependants = getDependants ? getDependants : arrayOf; /** * Returns the cache for a given dependants array. When possible, a WeakMap * will be used to create a unique cache for each set of dependants. This * is feasible due to the nature of WeakMap in allowing garbage collection * to occur on entries where the key object is no longer referenced. Since * WeakMap requires the key to be an object, this is only possible when the * dependant is object-like. The root cache is created as a hierarchy where * each top-level key is the first entry in a dependants set, the value a * WeakMap where each key is the next dependant, and so on. This continues * so long as the dependants are object-like. If no dependants are object- * like, then the cache is shared across all invocations. * * @see isObjectLike * * @param {*[]} dependants Selector dependants. * * @return {Cache} Cache object. */ function getCache(dependants) { var caches = rootCache, isUniqueByDependants = true, i, dependant, map, cache; for (i = 0; i < dependants.length; i++) { dependant = dependants[i]; // Can only compose WeakMap from object-like key. if (!isObjectLike(dependant)) { isUniqueByDependants = false; break; } // Does current segment of cache already have a WeakMap? if (caches.has(dependant)) { // Traverse into nested WeakMap. caches = caches.get(dependant); } else { // Create, set, and traverse into a new one. map = new WeakMap(); caches.set(dependant, map); caches = map; } } // We use an arbitrary (but consistent) object as key for the last item // in the WeakMap to serve as our running cache. if (!caches.has(LEAF_KEY)) { cache = createCache(); cache.isUniqueByDependants = isUniqueByDependants; caches.set(LEAF_KEY, cache); } return caches.get(LEAF_KEY); } /** * Resets root memoization cache. */ function clear() { rootCache = new WeakMap(); } /* eslint-disable jsdoc/check-param-names */ /** * The augmented selector call, considering first whether dependants have * changed before passing it to underlying memoize function. * * @param {*} source Source object for derivation. * @param {...*} extraArgs Additional arguments to pass to selector. * * @return {*} Selector result. */ /* eslint-enable jsdoc/check-param-names */ function callSelector(/* source, ...extraArgs */) { var len = arguments.length, cache, node, i, args, dependants; // Create copy of arguments (avoid leaking deoptimization). args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } dependants = normalizedGetDependants.apply(null, args); cache = getCache(dependants); // If not guaranteed uniqueness by dependants (primitive type), shallow // compare against last dependants and, if references have changed, // destroy cache to recalculate result. if (!cache.isUniqueByDependants) { if ( cache.lastDependants && !isShallowEqual(dependants, cache.lastDependants, 0) ) { cache.clear(); } cache.lastDependants = dependants; } node = cache.head; while (node) { // Check whether node arguments match arguments if (!isShallowEqual(node.args, args, 1)) { node = node.next; continue; } // At this point we can assume we've found a match // Surface matched node to head if not already if (node !== cache.head) { // Adjust siblings to point to each other. /** @type {CacheNode} */ (node.prev).next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = cache.head; node.prev = null; /** @type {CacheNode} */ (cache.head).prev = node; cache.head = node; } // Return immediately return node.val; } // No cached value found. Continue to insertion phase: node = /** @type {CacheNode} */ ({ // Generate the result from original function val: selector.apply(null, args), }); // Avoid including the source object in the cache. args[0] = null; node.args = args; // Don't need to check whether node is already head, since it would // have been returned above already if it was // Shift existing head down list if (cache.head) { cache.head.prev = node; node.next = cache.head; } cache.head = node; return node.val; } callSelector.getDependants = normalizedGetDependants; callSelector.clear = clear; clear(); return /** @type {S & EnhancedSelector} */ (callSelector); } // 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/edit-site/build-module/components/page-patterns/search-items.js /** * External dependencies */ /** * 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; /** * Extracts words from an input string. * * @param {string} input The input string. * * @return {Array} Words, extracted from the input string. */ function extractWords(input = '') { return noCase(input, { splitRegexp: [/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu, // One lowercase or digit, followed by one uppercase. /([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu // One uppercase followed by one uppercase and one lowercase. ], stripRegexp: /(\p{C}|\p{P}|\p{S})+/giu // Anything that's not a punctuation, symbol or control/format character. }).split(' ').filter(Boolean); } /** * Sanitizes the search input string. * * @param {string} input The search input to normalize. * * @return {string} The normalized search input. */ function normalizeSearchInput(input = '') { // Disregard diacritics. // Input: "média" input = remove_accents_default()(input); // Accommodate leading slash, matching autocomplete expectations. // Input: "/media" input = input.replace(/^\//, ''); // Lowercase. // Input: "MEDIA" input = input.toLowerCase(); return input; } /** * Converts the search term into a list of normalized terms. * * @param {string} input The search term to normalize. * * @return {string[]} The normalized list of search terms. */ const getNormalizedSearchTerms = (input = '') => { return extractWords(normalizeSearchInput(input)); }; 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 === 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 = normalizeSearchInput(searchTerm); const normalizedTitle = normalizeSearchInput(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 /** * External dependencies */ /** * 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, templatePart }); const selectTemplatePartsAsPatterns = rememo((select, categoryId, search = '') => { var _getEntityRecords; const { getEntityRecords, getIsResolving } = 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 = getIsResolving('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).getIsResolving('getEntityRecords', ['postType', TEMPLATE_PART_POST_TYPE, { per_page: -1 }]), select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas()]); const selectThemePatterns = rememo(select => { var _settings$__experimen; const { getSettings } = unlock(select(store_store)); const { getIsResolving } = 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: getIsResolving('getBlockPatterns') }; }, select => [select(external_wp_coreData_namespaceObject.store).getBlockPatterns(), select(external_wp_coreData_namespaceObject.store).getIsResolving('getBlockPatterns'), unlock(select(store_store)).getSettings()]); const selectPatterns = rememo((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, patternPost }); const selectUserPatterns = rememo((select, syncStatus, search = '') => { const { getEntityRecords, getIsResolving, 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 = getIsResolving('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).getIsResolving('getEntityRecords', ['postType', PATTERN_TYPES.user, { per_page: -1 }]), select(external_wp_coreData_namespaceObject.store).getUserPatternCategories()]); const usePatterns = (categoryType, categoryId, { search = '', syncStatus } = {}) => { return (0,external_wp_data_namespaceObject.useSelect)(select => { if (categoryType === TEMPLATE_PART_POST_TYPE) { return selectTemplatePartsAsPatterns(select, categoryId, search); } else if (categoryType === PATTERN_TYPES.theme) { return selectPatterns(select, categoryId, syncStatus, search); } else if (categoryType === PATTERN_TYPES.user) { return selectUserPatterns(select, syncStatus, search); } return { patterns: EMPTY_PATTERN_LIST, isResolving: false }; }, [categoryId, categoryType, search, syncStatus]); }; /* harmony default export */ const use_patterns = (usePatterns); ;// 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/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 */ function TemplatePartGroup({ areas, currentArea, currentType }) { return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen-patterns__group-header" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2 }, (0,external_wp_i18n_namespaceObject.__)('Template parts'))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group" }, Object.entries(areas).map(([area, { label, templateParts }]) => (0,external_React_.createElement)(CategoryItem, { key: area, count: templateParts?.length, icon: (0,external_wp_editor_namespaceObject.getTemplatePartIcon)(area), label: label, id: area, type: TEMPLATE_PART_POST_TYPE, isActive: currentArea === area && currentType === TEMPLATE_PART_POST_TYPE })))); } function PatternCategoriesGroup({ categories, currentCategory, currentType }) { return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group" }, categories.map(category => (0,external_React_.createElement)(CategoryItem, { key: category.name, count: category.count, label: category.label, icon: library_file, id: category.name, type: "pattern", isActive: currentCategory === `${category.name}` && (currentType === PATTERN_TYPES.theme || currentType === PATTERN_TYPES.user) })))); } function SidebarNavigationScreenPatterns() { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { categoryType, categoryId } = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href); const currentCategory = categoryId || PATTERN_DEFAULT_CATEGORY; const currentType = categoryType || PATTERN_TYPES.theme; 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, []); const isTemplatePartsMode = (0,external_wp_data_namespaceObject.useSelect)(select => { const settings = select(store_store).getSettings(); return !!settings.supportsTemplatePartsMode; }, []); const templatePartsLink = useLink({ path: '/wp_template_part/all', // If a classic theme that supports template parts accessed // the Patterns page directly, preserve that state in the URL. didAccessPatternsPage: !isBlockBasedTheme && isTemplatePartsMode ? 1 : undefined }); const footer = !isMobileViewport ? (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_React_.createElement)(SidebarNavigationItem, { as: "a", href: "edit.php?post_type=wp_block", withChevron: true }, (0,external_wp_i18n_namespaceObject.__)('Manage all of my patterns')), (isBlockBasedTheme || isTemplatePartsMode) && (0,external_React_.createElement)(SidebarNavigationItem, { withChevron: true, ...templatePartsLink }, (0,external_wp_i18n_namespaceObject.__)('Manage all template parts'))) : undefined; return (0,external_React_.createElement)(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.'), actions: (0,external_React_.createElement)(AddNewPattern, null), footer: footer, content: (0,external_React_.createElement)(external_React_.Fragment, null, isLoading && (0,external_wp_i18n_namespaceObject.__)('Loading patterns…'), !isLoading && (0,external_React_.createElement)(external_React_.Fragment, null, !hasTemplateParts && !hasPatterns && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('No template parts or patterns found'))), hasPatterns && (0,external_React_.createElement)(PatternCategoriesGroup, { categories: patternCategories, currentCategory: currentCategory, currentType: currentType }), hasTemplateParts && (0,external_React_.createElement)(TemplatePartGroup, { areas: templatePartAreas, currentArea: currentCategory, currentType: currentType }))) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: use_init_edited_entity_from_url_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const postTypesWithoutParentTemplate = [constants_TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user]; function useResolveEditedEntityAndContext({ path, postId, postType }) { const { hasLoadedAllDependencies, homepageId, url, frontPageTemplateId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSite, getUnstableBase, getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const siteData = getSite(); const base = getUnstableBase(); const templates = getEntityRecords('postType', constants_TEMPLATE_POST_TYPE, { per_page: -1 }); let _frontPateTemplateId; if (templates) { const frontPageTemplate = templates.find(t => t.slug === 'front-page'); _frontPateTemplateId = frontPageTemplate ? frontPageTemplate.id : false; } return { hasLoadedAllDependencies: !!base && !!siteData, homepageId: siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) ? siteData.page_on_front.toString() : null, url: base?.home, frontPageTemplateId: _frontPateTemplateId }; }, []); /** * 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)) { 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; } // First see if the post/page has an assigned template and fetch it. const currentTemplateSlug = editedEntity.template; if (currentTemplateSlug) { const currentTemplate = getEntityRecords('postType', constants_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, post... we need to resolve its template. if (postType && postId) { return resolveTemplateForPostTypeAndId(postType, postId); } // Some URLs in list views are different if (path === '/pages' && postId) { return resolveTemplateForPostTypeAndId('page', 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, hasLoadedAllDependencies, url, postId, postType, path, frontPageTemplateId]); const context = (0,external_wp_element_namespaceObject.useMemo)(() => { if (postTypesWithoutParentTemplate.includes(postType)) { return {}; } if (postType && postId) { return { postType, postId }; } // Some URLs in list views are different if (path === '/pages' && postId) { return { postType: 'page', postId }; } if (homepageId) { return { postType: 'page', postId: homepageId }; } return {}; }, [homepageId, postType, postId, path]); if (path === '/wp_template/all' && postId) { return { isReady: true, postType: 'wp_template', postId, context }; } if (path === '/wp_template_part/all' && postId) { return { isReady: true, postType: 'wp_template_part', postId, context }; } if (postTypesWithoutParentTemplate.includes(postType)) { return { isReady: true, postType, postId, context }; } if (hasLoadedAllDependencies) { return { isReady: resolvedTemplateId !== undefined, postType: constants_TEMPLATE_POST_TYPE, postId: resolvedTemplateId, context }; } return { isReady: false }; } function useInitEditedEntityFromURL() { const { params = {} } = use_init_edited_entity_from_url_useLocation(); const { postType, postId, context, isReady } = useResolveEditedEntityAndContext(params); const { setEditedEntity } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isReady) { setEditedEntity(postType, postId, context); } }, [isReady, postType, postId, context, setEditedEntity]); } ;// CONCATENATED MODULE: ./node_modules/upper-case-first/dist.es2015/index.js /** * Upper case the first character of an input string. */ function upperCaseFirst(input) { return input.charAt(0).toUpperCase() + input.substr(1); } ;// CONCATENATED MODULE: ./node_modules/sentence-case/dist.es2015/index.js function sentenceCaseTransform(input, index) { var result = input.toLowerCase(); if (index === 0) return upperCaseFirst(result); return result; } function sentenceCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: " ", transform: sentenceCaseTransform }, options)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js /** * WordPress dependencies */ const chevronUp = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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 = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/sync-state-with-url/use-sync-path-with-url.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: use_sync_path_with_url_useLocation, useHistory: use_sync_path_with_url_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); function getPathFromURL(urlParams) { var _urlParams$path; let path = (_urlParams$path = urlParams?.path) !== null && _urlParams$path !== void 0 ? _urlParams$path : '/'; // Compute the navigator path based on the URL params. if (urlParams?.postType && urlParams?.postId) { switch (urlParams.postType) { case PATTERN_TYPES.user: case constants_TEMPLATE_POST_TYPE: case TEMPLATE_PART_POST_TYPE: case 'page': path = `/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`; break; default: path = `/navigation/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`; } } return path; } function isSubset(subset, superset) { return Object.entries(subset).every(([key, value]) => { return superset[key] === value; }); } function useSyncPathWithURL() { const history = use_sync_path_with_url_useHistory(); const { params: urlParams } = use_sync_path_with_url_useLocation(); const { location: navigatorLocation, params: navigatorParams, goTo } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const isMounting = (0,external_wp_element_namespaceObject.useRef)(true); (0,external_wp_element_namespaceObject.useEffect)(() => { // The navigatorParams are only initially filled properly when the // navigator screens mount. so we ignore the first synchronisation. if (isMounting.current) { isMounting.current = false; return; } function updateUrlParams(newUrlParams) { if (isSubset(newUrlParams, urlParams)) { return; } const updatedParams = { ...urlParams, ...newUrlParams }; history.push(updatedParams); } if (navigatorParams?.postType && navigatorParams?.postId) { updateUrlParams({ postType: navigatorParams?.postType, postId: navigatorParams?.postId, path: undefined, layout: undefined }); } else if (navigatorLocation.path.startsWith('/page/') && navigatorParams?.postId) { updateUrlParams({ postType: 'page', postId: navigatorParams?.postId, path: undefined, layout: undefined }); } else if (navigatorLocation.path === '/patterns') { updateUrlParams({ postType: undefined, postId: undefined, canvas: undefined, path: navigatorLocation.path }); } else if (navigatorLocation.path === '/wp_template/all' && !window?.__experimentalAdminViews) { // When the experiment is disabled, we only support table layout. // Clear it out from the URL, so layouts other than table cannot be accessed. updateUrlParams({ postType: undefined, categoryType: undefined, categoryId: undefined, path: navigatorLocation.path, layout: undefined }); } else if ( // These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has. // The "type" property should be kept as well. navigatorLocation.path === '/pages' && window?.__experimentalAdminViews || navigatorLocation.path === '/wp_template/all' && window?.__experimentalAdminViews || navigatorLocation.path === '/wp_template_part/all' && window?.__experimentalAdminViews) { updateUrlParams({ postType: undefined, categoryType: undefined, categoryId: undefined, path: navigatorLocation.path }); } else { updateUrlParams({ postType: undefined, postId: undefined, categoryType: undefined, categoryId: undefined, layout: undefined, path: navigatorLocation.path === '/' ? undefined : navigatorLocation.path }); } }, // Trigger only when navigator changes to prevent infinite loops. // eslint-disable-next-line react-hooks/exhaustive-deps [navigatorLocation?.path, navigatorParams]); (0,external_wp_element_namespaceObject.useEffect)(() => { const path = getPathFromURL(urlParams); if (navigatorLocation.path !== path) { goTo(path); } }, // Trigger only when URL changes to prevent infinite loops. // eslint-disable-next-line react-hooks/exhaustive-deps [urlParams]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js /** * WordPress dependencies */ const POPOVER_PROPS = { className: 'block-editor-block-settings-menu__popover', placement: 'bottom-start' }; /** * Internal dependencies */ const { useLocation: leaf_more_menu_useLocation, useHistory: leaf_more_menu_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); function LeafMoreMenu(props) { const location = leaf_more_menu_useLocation(); 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) { history.push({ postType: attributes.type, postId: attributes.id, ...(isPreviewingTheme() && { wp_theme_preview: currentlyPreviewingTheme() }) }, { backPath: getPathFromURL(location.params) }); } if (name === 'core/page-list-item' && attributes.id && history) { history.push({ postType: 'page', postId: attributes.id, ...(isPreviewingTheme() && { wp_theme_preview: currentlyPreviewingTheme() }) }, { backPath: getPathFromURL(location.params) }); } }, [history]); return (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), className: "block-editor-block-settings-menu", popoverProps: POPOVER_PROPS, noIcons: true, ...props }, ({ onClose }) => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { icon: chevron_up, onClick: () => { moveBlocksUp([clientId], rootClientId); onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Move up')), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { icon: chevron_down, onClick: () => { moveBlocksDown([clientId], rootClientId); onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Move down')), block.attributes?.type === 'page' && block.attributes?.id && (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { onGoToPage(block); onClose(); } }, goToLabel)), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { removeBlocks([clientId], false); onClose(); } }, 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 } = 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 (0,external_React_.createElement)(external_React_.Fragment, null, !isLoading && (0,external_React_.createElement)(PrivateListView, { rootClientId: listViewRootClientId, onSelect: offCanvasOnselect, blockSettingsMenu: LeafMoreMenu, showAppender: false }), (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor" }, (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockList, null))); } ;// 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 } = unlock(select(store_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 (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { settings: storedSettings, value: blocks, onChange: navigation_menu_editor_noop, onInput: navigation_menu_editor_noop }, (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__content" }, (0,external_React_.createElement)(NavigationMenuContent, { rootClientId: blocks[0].clientId }))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js /** * WordPress dependencies */ /** * Internal dependencies */ function useNavigationMenuTitle(id) { return (0,external_wp_data_namespaceObject.useSelect)(select => { if (!id) { return undefined; } const editedRecord = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, id); // Do not display a 'trashed' navigation menu. return editedRecord.status === 'trash' ? undefined : editedRecord.title; }, [id]); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartNavigationMenu({ id }) { const title = useNavigationMenuTitle(id); if (!id || title === undefined) { return null; } return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title", size: "11", upperCase: true, weight: 500 }, title || (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_React_.createElement)(NavigationMenuEditor, { navigationMenuId: id })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartNavigationMenuListItem({ id }) { const title = useNavigationMenuTitle(id); const linkInfo = useLink({ postId: id, postType: NAVIGATION_POST_TYPE }); if (!id || title === undefined) { return null; } return (0,external_React_.createElement)(SidebarNavigationItem, { withChevron: true, ...linkInfo }, title || (0,external_wp_i18n_namespaceObject.__)('(no title)')); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartNavigationMenuList({ menus }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu-list" }, menus.map(menuId => (0,external_React_.createElement)(TemplatePartNavigationMenuListItem, { key: menuId, id: menuId }))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartNavigationMenus({ menus }) { if (!menus.length) return null; // if there is a single menu then render TemplatePartNavigationMenu if (menus.length === 1) { return (0,external_React_.createElement)(TemplatePartNavigationMenu, { id: menus[0] }); } // if there are multiple menus then render TemplatePartNavigationMenuList return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title", size: "11", upperCase: true, weight: 500 }, (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_React_.createElement)(TemplatePartNavigationMenuList, { menus: menus })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js /** * WordPress dependencies */ /** * Internal dependencies */ function getBlocksFromRecord(record) { if (record?.blocks) { return record?.blocks; } return record?.content && typeof record.content !== 'function' ? (0,external_wp_blocks_namespaceObject.parse)(record.content) : []; } /** * Retrieves a list of specific blocks from a given tree of blocks. * * @param {string} targetBlockType The name of the block type to find. * @param {Array} blocks A list of blocks from a template part entity. * * @return {Array} A list of any navigation blocks found in the blocks. */ function getBlocksOfTypeFromBlocks(targetBlockType, blocks) { if (!targetBlockType || !blocks?.length) { return []; } const findInBlocks = _blocks => { if (!_blocks) { return []; } const navigationBlocks = []; for (const block of _blocks) { if (block.name === targetBlockType) { navigationBlocks.push(block); } if (block?.innerBlocks) { const innerNavigationBlocks = findInBlocks(block.innerBlocks); if (innerNavigationBlocks.length) { navigationBlocks.push(...innerNavigationBlocks); } } } return navigationBlocks; }; return findInBlocks(blocks); } function useNavigationMenuContent(postType, postId) { const { record } = useEditedEntityRecord(postType, postId); // Only managing navigation menus in template parts is supported // to match previous behaviour. This could potentially be expanded // to patterns as well. if (postType !== TEMPLATE_PART_POST_TYPE) { return; } const blocks = getBlocksFromRecord(record); const navigationBlocks = getBlocksOfTypeFromBlocks('core/navigation', blocks); if (!navigationBlocks.length) { return; } const navigationMenuIds = navigationBlocks?.map(block => block.attributes.ref); // Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template. // Also, filter out undefined values, as blocks don't have an id when initially added. const uniqueNavigationMenuIds = [...new Set(navigationMenuIds)].filter(menuId => menuId); if (!uniqueNavigationMenuIds?.length) { return; } return (0,external_React_.createElement)(TemplatePartNavigationMenus, { menus: uniqueNavigationMenuIds }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function usePatternDetails(postType, postId) { const { getDescription, getTitle, record } = useEditedEntityRecord(postType, postId); const templatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).__experimentalGetDefaultTemplatePartAreas(), []); const { currentTheme, userPatternCategories } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentTheme, getUserPatternCategories } = select(external_wp_coreData_namespaceObject.store); return { currentTheme: getCurrentTheme(), userPatternCategories: getUserPatternCategories() }; }, []); const addedBy = useAddedBy(postType, postId); const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet; const title = getTitle(); let description = getDescription(); if (!description && addedBy.text) { description = postType === PATTERN_TYPES.user ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: pattern title e.g: "Header". (0,external_wp_i18n_namespaceObject.__)('This is the %s pattern.'), getTitle()) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: template part title e.g: "Header". (0,external_wp_i18n_namespaceObject.__)('This is the %s template part.'), getTitle()); } if (!description && postType === PATTERN_TYPES.user && record?.title) { description = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: user created pattern title e.g. "Footer". (0,external_wp_i18n_namespaceObject.__)('This is the %s pattern.'), record.title); } const footer = record?.modified ? (0,external_React_.createElement)(SidebarNavigationScreenDetailsFooter, { record: record }) : null; const details = []; if (postType === PATTERN_TYPES.user || postType === TEMPLATE_PART_POST_TYPE) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Syncing'), value: record.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced ? (0,external_wp_i18n_namespaceObject._x)('Not synced', 'Text that indicates that the pattern is not synchronized') : (0,external_wp_i18n_namespaceObject._x)('Synced', 'Text that indicates that the pattern is synchronized') }); if (record.wp_pattern_category?.length === 0) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Categories'), value: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') }); } if (record.wp_pattern_category?.length > 0) { const patternCategories = new Map(); userPatternCategories.forEach(userCategory => patternCategories.set(userCategory.id, userCategory)); const categories = record.wp_pattern_category.filter(category => patternCategories.get(category)).map(category => patternCategories.get(category).label); details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Categories'), value: categories.length > 0 ? categories.join(', ') : '' }); } } if (postType === TEMPLATE_PART_POST_TYPE) { const templatePartArea = templatePartAreas.find(area => area.area === record.area); let areaDetailValue = templatePartArea?.label; if (!areaDetailValue) { areaDetailValue = record.area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Sentenced cased template part area e.g: "My custom area". (0,external_wp_i18n_namespaceObject.__)('%s (removed)'), sentenceCase(record.area)) : (0,external_wp_i18n_namespaceObject.__)('None'); } details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Area'), value: areaDetailValue }); } if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && !isAddedByActiveTheme) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Added by'), value: (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-pattern__added-by-description-author" }, addedBy.text) }); } if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && (record.origin === TEMPLATE_ORIGINS.plugin || record.has_theme_file === true)) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Customized'), value: (0,external_React_.createElement)("span", { className: "edit-site-sidebar-navigation-screen-pattern__added-by-description-customized" }, addedBy.isCustomized ? (0,external_wp_i18n_namespaceObject.__)('Yes') : (0,external_wp_i18n_namespaceObject.__)('No')) }); } const content = (0,external_React_.createElement)(external_React_.Fragment, null, useNavigationMenuContent(postType, postId), !!details.length && (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanel, { spacing: 5, title: (0,external_wp_i18n_namespaceObject.__)('Details') }, details.map(({ label, value }) => (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, { key: label }, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelLabel, null, label), (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelValue, null, value))))); return { title, description, content, footer }; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function SidebarNavigationScreenPattern() { const navigator = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { params: { postType, postId } } = navigator; const { categoryType } = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href); const { setCanvasMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); useInitEditedEntityFromURL(); const patternDetails = usePatternDetails(postType, postId); // The absence of a category type in the query params for template parts // indicates the user has arrived at the template part via the "manage all" // page and the back button should return them to that list page. const backPath = !categoryType && postType === TEMPLATE_PART_POST_TYPE ? '/wp_template_part/all' : '/patterns'; return (0,external_React_.createElement)(SidebarNavigationScreen, { actions: (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(TemplateActions, { postType: postType, postId: postId, toggleProps: { as: SidebarButton }, onRemove: () => { navigator.goTo(backPath); } }), (0,external_React_.createElement)(SidebarButton, { onClick: () => setCanvasMode('edit'), label: (0,external_wp_i18n_namespaceObject.__)('Edit'), icon: library_pencil })), backPath: backPath, ...patternDetails }); } ;// 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 RenameModal({ menuTitle, onClose, onSave }) { const [editedMenuTitle, setEditedMenuTitle] = (0,external_wp_element_namespaceObject.useState)(menuTitle); const titleHasChanged = editedMenuTitle !== menuTitle; const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); return (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: onClose }, (0,external_React_.createElement)("form", { className: "sidebar-navigation__rename-modal-form" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: editedMenuTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('Navigation title'), onChange: setEditedMenuTitle }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: 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(); } }, (0,external_wp_i18n_namespaceObject.__)('Save')))))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js /** * WordPress dependencies */ function delete_modal_RenameModal({ onClose, onConfirm }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: true, onConfirm: e => { e.preventDefault(); onConfirm(); // Immediate close avoids ability to hit delete multiple times. onClose(); }, onCancel: onClose, confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete') }, (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 more_menu_POPOVER_PROPS = { position: 'bottom right' }; function ScreenNavigationMoreMenu(props) { const { onDelete, onSave, onDuplicate, menuTitle } = props; const [renameModalOpen, setRenameModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const [deleteModalOpen, setDeleteModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const closeModals = () => { setRenameModalOpen(false); setDeleteModalOpen(false); }; const openRenameModal = () => setRenameModalOpen(true); const openDeleteModal = () => setDeleteModalOpen(true); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { className: "sidebar-navigation__more-menu", label: (0,external_wp_i18n_namespaceObject.__)('Actions'), icon: more_vertical, popoverProps: more_menu_POPOVER_PROPS }, ({ onClose }) => (0,external_React_.createElement)("div", null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { openRenameModal(); // Close the dropdown after opening the modal. onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Rename')), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { onDuplicate(); onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Duplicate')), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { isDestructive: true, onClick: () => { openDeleteModal(); // Close the dropdown after opening the modal. onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Delete'))))), deleteModalOpen && (0,external_React_.createElement)(delete_modal_RenameModal, { onClose: closeModals, onConfirm: onDelete }), renameModalOpen && (0,external_React_.createElement)(RenameModal, { onClose: closeModals, menuTitle: menuTitle, onSave: onSave })); } ;// 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/edit-button.js /** * WordPress dependencies */ /** * Internal dependencies */ function EditButton({ postId }) { const linkInfo = useLink({ postId, postType: NAVIGATION_POST_TYPE, canvas: 'edit' }); return (0,external_React_.createElement)(SidebarButton, { ...linkInfo, label: (0,external_wp_i18n_namespaceObject.__)('Edit'), icon: library_pencil }); } ;// 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, handleDelete, handleDuplicate, handleSave }) { const menuTitle = navigationMenu?.title?.rendered; return (0,external_React_.createElement)(SidebarNavigationScreenWrapper, { actions: (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(ScreenNavigationMoreMenu, { menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), onDelete: handleDelete, onSave: handleSave, onDuplicate: handleDuplicate }), (0,external_React_.createElement)(EditButton, { postId: navigationMenu?.id })), 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.') }, (0,external_React_.createElement)(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 postType = `wp_navigation`; function SidebarNavigationScreenNavigationMenu() { const { params: { postId } } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); 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 (0,external_React_.createElement)(SidebarNavigationScreenWrapper, { description: (0,external_wp_i18n_namespaceObject.__)('Navigation menus are a curated collection of blocks that allow visitors to get around your site.') }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" })); } if (!isLoading && !navigationMenu) { return (0,external_React_.createElement)(SidebarNavigationScreenWrapper, { description: (0,external_wp_i18n_namespaceObject.__)('Navigation Menu missing.') }); } if (!navigationMenu?.content?.raw) { return (0,external_React_.createElement)(SidebarNavigationScreenWrapper, { actions: (0,external_React_.createElement)(ScreenNavigationMoreMenu, { menuTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menuTitle), onDelete: _handleDelete, onSave: _handleSave, onDuplicate: _handleDuplicate }), title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status), description: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') }); } return (0,external_React_.createElement)(SingleNavigationMenu, { navigationMenu: navigationMenu, 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 */ function useDeleteNavigationMenu() { const { goTo } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); 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 handleDelete = async navigationMenu => { const postId = navigationMenu?.id; try { await deleteEntityRecord('postType', postType, postId, { force: true }, { throwOnError: true }); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Deleted Navigation menu'), { type: 'snackbar' }); goTo('/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 { goTo } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); 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' }); goTo(`/navigation/${postType}/${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() { 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 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 (0,external_React_.createElement)(SidebarNavigationScreenWrapper, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" })); } if (!isLoading && !hasNavigationMenus) { return (0,external_React_.createElement)(SidebarNavigationScreenWrapper, { description: (0,external_wp_i18n_namespaceObject.__)('No Navigation Menus found.') }); } // if single menu then render it if (navigationMenus?.length === 1) { return (0,external_React_.createElement)(SingleNavigationMenu, { navigationMenu: firstNavigationMenu, handleDelete: () => handleDelete(firstNavigationMenu), handleDuplicate: () => handleDuplicate(firstNavigationMenu), handleSave: edits => handleSave(firstNavigationMenu, edits) }); } return (0,external_React_.createElement)(SidebarNavigationScreenWrapper, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, navigationMenus?.map(({ id, title, status }, index) => (0,external_React_.createElement)(NavMenuItem, { postId: id, key: id, withChevron: true, icon: library_navigation }, buildMenuLabel(title?.rendered, index + 1, status))))); } function SidebarNavigationScreenWrapper({ children, actions, title, description }) { return (0,external_React_.createElement)(SidebarNavigationScreen, { title: title || (0,external_wp_i18n_namespaceObject.__)('Navigation'), actions: actions, description: description || (0,external_wp_i18n_namespaceObject.__)('Manage your Navigation menus.'), content: children }); } const NavMenuItem = ({ postId, ...props }) => { const linkInfo = useLink({ postId, postType: NAVIGATION_POST_TYPE }); return (0,external_React_.createElement)(SidebarNavigationItem, { ...linkInfo, ...props }); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js /** * WordPress dependencies */ const blockTable = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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/format-list-bullets-rtl.js /** * WordPress dependencies */ const formatListBulletsRTL = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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 = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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 /** * WordPress dependencies */ const funnel = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" })); /* harmony default export */ const library_funnel = (funnel); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/unseen.js /** * WordPress dependencies */ const unseen = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, (0,external_React_.createElement)(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 */ function SingleSelectionCheckbox({ selection, onSelectionChange, item, data, getItemId, primaryField, disabled }) { const id = getItemId(item); const isSelected = 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 })); } else { selectionLabel = isSelected ? (0,external_wp_i18n_namespaceObject.__)('Select a new item') : (0,external_wp_i18n_namespaceObject.__)('Deselect item'); } return (0,external_React_.createElement)(external_wp_components_namespaceObject.CheckboxControl, { className: "dataviews-view-table-selection-checkbox", __nextHasNoMarginBottom: true, 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/lock-unlock.js /** * WordPress dependencies */ const { lock: lock_unlock_lock, unlock: lock_unlock_unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/dataviews'); ;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/item-actions.js /** * WordPress dependencies */ /** * Internal dependencies */ const { DropdownMenuV2: DropdownMenu, DropdownMenuGroupV2: DropdownMenuGroup, DropdownMenuItemV2: DropdownMenuItem, DropdownMenuItemLabelV2: DropdownMenuItemLabel, kebabCase } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); function ButtonTrigger({ action, onClick }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { label: action.label, icon: action.icon, isDestructive: action.isDestructive, size: "compact", onClick: onClick }); } function DropdownMenuItemTrigger({ action, onClick }) { return (0,external_React_.createElement)(DropdownMenuItem, { onClick: onClick, hideOnClick: !action.RenderModal }, (0,external_React_.createElement)(DropdownMenuItemLabel, null, action.label)); } function ActionWithModal({ action, item, ActionTrigger }) { const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const actionTriggerProps = { action, onClick: () => setIsModalOpen(true) }; const { RenderModal, hideModalHeader } = action; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(ActionTrigger, { ...actionTriggerProps }), isModalOpen && (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: action.modalHeader || action.label, __experimentalHideHeader: !!hideModalHeader, onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(action.id)}` }, (0,external_React_.createElement)(RenderModal, { items: [item], closeModal: () => setIsModalOpen(false) }))); } function ActionsDropdownMenuGroup({ actions, item }) { return (0,external_React_.createElement)(DropdownMenuGroup, null, actions.map(action => { if (!!action.RenderModal) { return (0,external_React_.createElement)(ActionWithModal, { key: action.id, action: action, item: item, ActionTrigger: DropdownMenuItemTrigger }); } return (0,external_React_.createElement)(DropdownMenuItemTrigger, { key: action.id, action: action, onClick: () => action.callback([item]) }); })); } function ItemActions({ item, actions, isCompact }) { const { primaryActions, secondaryActions } = (0,external_wp_element_namespaceObject.useMemo)(() => { return actions.reduce((accumulator, action) => { // If an action is eligible for all items, doesn't need // to provide the `isEligible` function. if (action.isEligible && !action.isEligible(item)) { return accumulator; } if (action.isPrimary && !!action.icon) { accumulator.primaryActions.push(action); } else { accumulator.secondaryActions.push(action); } return accumulator; }, { primaryActions: [], secondaryActions: [] }); }, [actions, item]); if (isCompact) { return (0,external_React_.createElement)(CompactItemActions, { item: item, primaryActions: primaryActions, secondaryActions: secondaryActions }); } return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 1, justify: "flex-end", style: { flexShrink: '0', width: 'auto' } }, !!primaryActions.length && primaryActions.map(action => { if (!!action.RenderModal) { return (0,external_React_.createElement)(ActionWithModal, { key: action.id, action: action, item: item, ActionTrigger: ButtonTrigger }); } return (0,external_React_.createElement)(ButtonTrigger, { key: action.id, action: action, onClick: () => action.callback([item]) }); }), (0,external_React_.createElement)(DropdownMenu, { trigger: (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { size: "compact", icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), disabled: !secondaryActions.length }), placement: "bottom-end" }, (0,external_React_.createElement)(ActionsDropdownMenuGroup, { actions: secondaryActions, item: item }))); } function CompactItemActions({ item, primaryActions, secondaryActions }) { return (0,external_React_.createElement)(DropdownMenu, { trigger: (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { size: "compact", icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), disabled: !primaryActions.length && !secondaryActions.length }), placement: "bottom-end" }, !!primaryActions.length && (0,external_React_.createElement)(ActionsDropdownMenuGroup, { actions: primaryActions, item: item }), !!secondaryActions.length && (0,external_React_.createElement)(ActionsDropdownMenuGroup, { actions: secondaryActions, item: item })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/utils.js /** * Internal dependencies */ /** * Helper util to sort data by text fields, when sorting is done client side. * * @param {Object} params Function params. * @param {Object[]} params.data Data to sort. * @param {Object} params.view Current view object. * @param {Object[]} params.fields Array of available fields. * @param {string[]} params.textFields Array of the field ids to sort. * * @return {Object[]} Sorted data. */ const sortByTextFields = ({ data, view, fields, textFields }) => { const sortedData = [...data]; const fieldId = view.sort.field; if (textFields.includes(fieldId)) { const fieldToSort = fields.find(field => { return field.id === fieldId; }); sortedData.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); }); } return sortedData; }; /** * Helper util to get the paginated data and the paginateInfo needed, * when pagination is done client side. * * @param {Object} params Function params. * @param {Object[]} params.data Available data. * @param {Object} params.view Current view object. * * @return {Object} Paginated data and paginationInfo. */ function getPaginationResults({ data, view }) { const start = (view.page - 1) * view.perPage; const totalItems = data?.length || 0; data = data?.slice(start, start + view.perPage); return { data, paginationInfo: { totalItems, totalPages: Math.ceil(totalItems / view.perPage) } }; } const sanitizeOperators = field => { let operators = field.filterBy?.operators; if (!operators || !Array.isArray(operators)) { operators = Object.keys(OPERATORS); } return operators.filter(operator => Object.keys(OPERATORS).includes(operator)); }; ;// 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 } = 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(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(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(item)); }, [action, selectedItems]); const { RenderModal, hideModalHeader } = action; const onCloseModal = (0,external_wp_element_namespaceObject.useCallback)(() => { setActionWithModal(undefined); }, [setActionWithModal]); return (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: !hideModalHeader && action.label, __experimentalHideHeader: !!hideModalHeader, onRequestClose: onCloseModal, overlayClassName: "dataviews-action-modal" }, (0,external_React_.createElement)(RenderModal, { items: eligibleItems, closeModal: onCloseModal, onPerform: () => onMenuOpenChange(false) })); } function BulkActionItem({ action, selectedItems, setActionWithModal }) { const eligibleItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return selectedItems.filter(item => action.isEligible(item)); }, [action, selectedItems]); const shouldShowModal = !!action.RenderModal; return (0,external_React_.createElement)(bulk_actions_DropdownMenuItem, { key: action.id, disabled: eligibleItems.length === 0, hideOnClick: !shouldShowModal, onClick: async () => { if (shouldShowModal) { setActionWithModal(action); } else { await action.callback(eligibleItems); } }, suffix: eligibleItems.length > 0 ? eligibleItems.length : undefined }, action.label); } function ActionsMenuGroup({ actions, selectedItems, setActionWithModal }) { return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(bulk_actions_DropdownMenuGroup, null, actions.map(action => (0,external_React_.createElement)(BulkActionItem, { key: action.id, action: action, selectedItems: selectedItems, setActionWithModal: setActionWithModal }))), (0,external_React_.createElement)(DropdownMenuSeparator, null)); } 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(item)); }); }, [data, bulkActions]); const numberSelectableItems = selectableItems.length; const areAllSelected = selection && selection.length === numberSelectableItems; const selectedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return data.filter(item => selection.includes(getItemId(item))); }, [selection, data, getItemId]); const hasNonSelectableItemSelected = (0,external_wp_element_namespaceObject.useMemo)(() => { return selectedItems.some(item => { return !selectableItems.includes(item); }); }, [selectedItems, selectableItems]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasNonSelectableItemSelected) { onSelectionChange(selectedItems.filter(selectedItem => { return selectableItems.some(item => { return getItemId(selectedItem) === getItemId(item); }); })); } }, [hasNonSelectableItemSelected, selectedItems, selectableItems, getItemId, onSelectionChange]); if (bulkActions.length === 0) { return null; } return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(bulk_actions_DropdownMenu, { open: isMenuOpen, onOpenChange: onMenuOpenChange, label: (0,external_wp_i18n_namespaceObject.__)('Bulk actions'), style: { minWidth: '240px' }, trigger: (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { className: "dataviews-bulk-edit-button", __next40pxDefaultSize: true, variant: "tertiary", size: "compact" }, selection.length ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of items. */ (0,external_wp_i18n_namespaceObject._n)('Edit %d item', 'Edit %d items', selection.length), selection.length) : (0,external_wp_i18n_namespaceObject.__)('Bulk edit')) }, (0,external_React_.createElement)(ActionsMenuGroup, { actions: bulkActions, setActionWithModal: setActionWithModal, selectedItems: selectedItems }), (0,external_React_.createElement)(bulk_actions_DropdownMenuGroup, null, (0,external_React_.createElement)(bulk_actions_DropdownMenuItem, { disabled: areAllSelected, hideOnClick: false, onClick: () => { onSelectionChange(selectableItems); }, suffix: numberSelectableItems }, (0,external_wp_i18n_namespaceObject.__)('Select all')), (0,external_React_.createElement)(bulk_actions_DropdownMenuItem, { disabled: selection.length === 0, hideOnClick: false, onClick: () => { onSelectionChange([]); } }, (0,external_wp_i18n_namespaceObject.__)('Deselect')))), actionWithModal && (0,external_React_.createElement)(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 } = lock_unlock_unlock(external_wp_components_namespaceObject.privateApis); function WithSeparators({ children }) { return external_wp_element_namespaceObject.Children.toArray(children).filter(Boolean).map((child, i) => (0,external_React_.createElement)(external_wp_element_namespaceObject.Fragment, { key: i }, i > 0 && (0,external_React_.createElement)(view_table_DropdownMenuSeparator, null), child)); } const sortArrows = { asc: '↑', desc: '↓' }; 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.type === constants_ENUMERATION_TYPE && !!operators.length && !field.filterBy?.isPrimary; if (!isSortable && !isHidable && !canAddFilter) { return field.header; } return (0,external_React_.createElement)(view_table_DropdownMenu, { align: "start", trigger: (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { size: "compact", className: "dataviews-view-table-header-button", ref: ref, variant: "tertiary" }, field.header, isSorted && (0,external_React_.createElement)("span", { "aria-hidden": "true" }, isSorted && sortArrows[view.sort.direction])), style: { minWidth: '240px' } }, (0,external_React_.createElement)(WithSeparators, null, isSortable && (0,external_React_.createElement)(view_table_DropdownMenuGroup, null, Object.entries(SORTING_DIRECTIONS).map(([direction, info]) => { const isChecked = isSorted && view.sort.direction === direction; const value = `${field.id}-${direction}`; return (0,external_React_.createElement)(DropdownMenuRadioItem, { key: value // 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 } }); } }, (0,external_React_.createElement)(view_table_DropdownMenuItemLabel, null, info.label)); })), canAddFilter && (0,external_React_.createElement)(view_table_DropdownMenuGroup, null, (0,external_React_.createElement)(view_table_DropdownMenuItem, { prefix: (0,external_React_.createElement)(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] }] }); } }, (0,external_React_.createElement)(view_table_DropdownMenuItemLabel, null, (0,external_wp_i18n_namespaceObject.__)('Add filter')))), isHidable && (0,external_React_.createElement)(view_table_DropdownMenuItem, { prefix: (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { icon: library_unseen }), onClick: () => { onHide(field); onChangeView({ ...view, hiddenFields: view.hiddenFields.concat(field.id) }); } }, (0,external_React_.createElement)(view_table_DropdownMenuItemLabel, null, (0,external_wp_i18n_namespaceObject.__)('Hide'))))); }); function BulkSelectionCheckbox({ selection, onSelectionChange, data, actions }) { const selectableItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return data.filter(item => { return actions.some(action => action.supportsBulk && action.isEligible(item)); }); }, [data, actions]); const areAllSelected = selection.length === selectableItems.length; return (0,external_React_.createElement)(external_wp_components_namespaceObject.CheckboxControl, { className: "dataviews-view-table-selection-checkbox", __nextHasNoMarginBottom: true, checked: areAllSelected, indeterminate: !areAllSelected && selection.length, onChange: () => { if (areAllSelected) { onSelectionChange([]); } else { onSelectionChange(selectableItems); } }, 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); return (0,external_React_.createElement)("tr", { className: classnames_default()('dataviews-view-table__row', { 'is-selected': hasPossibleBulkAction && selection.includes(id) }) }, hasBulkActions && (0,external_React_.createElement)("td", { className: "dataviews-view-table__checkbox-column", style: { width: 20, minWidth: 20 } }, (0,external_React_.createElement)("div", { className: "dataviews-view-table__cell-content-wrapper" }, (0,external_React_.createElement)(SingleSelectionCheckbox, { id: id, item: item, selection: selection, onSelectionChange: onSelectionChange, getItemId: getItemId, data: data, primaryField: primaryField, disabled: !hasPossibleBulkAction }))), visibleFields.map(field => (0,external_React_.createElement)("td", { key: field.id, style: { width: field.width || undefined, minWidth: field.minWidth || undefined, maxWidth: field.maxWidth || undefined } }, (0,external_React_.createElement)("div", { className: classnames_default()('dataviews-view-table__cell-content-wrapper', { 'dataviews-view-table__primary-field': primaryField?.id === field.id }) }, field.render({ item })))), !!actions?.length && (0,external_React_.createElement)("td", { className: "dataviews-view-table__actions-column" }, (0,external_React_.createElement)(ItemActions, { item: item, actions: actions }))); } function ViewTable({ view, onChangeView, fields, actions, data, getItemId, isLoading = false, deferredRendering, selection, onSelectionChange, setOpenedFilter }) { 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 asyncData = (0,external_wp_compose_namespaceObject.useAsyncList)(data); 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(); return; } const onHide = field => { const hidden = headerMenuRefs.current.get(field.id); const fallback = headerMenuRefs.current.get(hidden.fallback); setNextHeaderMenuToFocus(fallback?.node); }; const visibleFields = fields.filter(field => !view.hiddenFields.includes(field.id) && ![view.layout.mediaField].includes(field.id)); const usedData = deferredRendering ? asyncData : data; const hasData = !!usedData?.length; const sortValues = { asc: 'ascending', desc: 'descending' }; const primaryField = fields.find(field => field.id === view.layout.primaryField); return (0,external_React_.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_React_.createElement)("table", { className: "dataviews-view-table", "aria-busy": isLoading, "aria-describedby": tableNoticeId }, (0,external_React_.createElement)("thead", null, (0,external_React_.createElement)("tr", { className: "dataviews-view-table__row" }, hasBulkActions && (0,external_React_.createElement)("th", { className: "dataviews-view-table__checkbox-column", style: { width: 20, minWidth: 20 }, "data-field-id": "selection", scope: "col" }, (0,external_React_.createElement)(BulkSelectionCheckbox, { selection: selection, onSelectionChange: onSelectionChange, data: data, actions: actions })), visibleFields.map((field, index) => (0,external_React_.createElement)("th", { key: field.id, 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], scope: "col" }, (0,external_React_.createElement)(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 }))), !!actions?.length && (0,external_React_.createElement)("th", { "data-field-id": "actions", className: "dataviews-view-table__actions-column" }, (0,external_React_.createElement)("span", { className: "dataviews-view-table-header" }, (0,external_wp_i18n_namespaceObject.__)('Actions'))))), (0,external_React_.createElement)("tbody", null, hasData && usedData.map((item, index) => (0,external_React_.createElement)(TableRow, { key: getItemId(item), item: item, hasBulkActions: hasBulkActions, actions: actions, id: getItemId(item) || index, visibleFields: visibleFields, primaryField: primaryField, selection: selection, getItemId: getItemId, onSelectionChange: onSelectionChange, data: data })))), (0,external_React_.createElement)("div", { className: classnames_default()({ 'dataviews-loading': isLoading, 'dataviews-no-results': !hasData && !isLoading }), id: tableNoticeId }, !hasData && (0,external_React_.createElement)("p", null, isLoading ? (0,external_wp_i18n_namespaceObject.__)('Loading…') : (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 }) { const [hasNoPointerEvents, setHasNoPointerEvents] = (0,external_wp_element_namespaceObject.useState)(false); const hasBulkAction = useHasAPossibleBulkAction(actions, item); const id = getItemId(item); const isSelected = selection.includes(id); return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, key: id, className: classnames_default()('dataviews-view-grid__card', { 'is-selected': hasBulkAction && isSelected, 'has-no-pointer-events': hasNoPointerEvents }), onMouseDown: event => { if (hasBulkAction && (event.ctrlKey || event.metaKey)) { setHasNoPointerEvents(true); 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); })); } } }, onClick: () => { if (hasNoPointerEvents) { setHasNoPointerEvents(false); } } }, (0,external_React_.createElement)("div", { className: "dataviews-view-grid__media" }, mediaField?.render({ item })), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "space-between", className: "dataviews-view-grid__title-actions" }, (0,external_React_.createElement)(SingleSelectionCheckbox, { id: id, item: item, selection: selection, onSelectionChange: onSelectionChange, getItemId: getItemId, data: data, primaryField: primaryField, disabled: !hasBulkAction }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { className: "dataviews-view-grid__primary-field" }, primaryField?.render({ item })), (0,external_React_.createElement)(ItemActions, { item: item, actions: actions, isCompact: true })), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataviews-view-grid__fields", spacing: 3 }, visibleFields.map(field => { const renderedValue = field.render({ item }); if (!renderedValue) { return null; } return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: "dataviews-view-grid__field", key: field.id, spacing: 1 }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Tooltip, { text: field.header, placement: "left" }, (0,external_React_.createElement)("div", { className: "dataviews-view-grid__field-value" }, renderedValue))); }))); } function ViewGrid({ data, fields, view, actions, isLoading, getItemId, deferredRendering, selection, onSelectionChange }) { 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.mediaField, view.layout.primaryField].includes(field.id)); const shownData = (0,external_wp_compose_namespaceObject.useAsyncList)(data, { step: 3 }); const usedData = deferredRendering ? shownData : data; const hasData = !!usedData?.length; return (0,external_React_.createElement)(external_React_.Fragment, null, hasData && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalGrid, { gap: 6, columns: 2, alignment: "top", className: "dataviews-view-grid", "aria-busy": isLoading }, usedData.map(item => { return (0,external_React_.createElement)(GridItem, { key: getItemId(item), selection: selection, data: data, onSelectionChange: onSelectionChange, getItemId: getItemId, item: item, actions: actions, mediaField: mediaField, primaryField: primaryField, visibleFields: visibleFields }); })), !hasData && (0,external_React_.createElement)("div", { className: classnames_default()({ 'dataviews-loading': isLoading, 'dataviews-no-results': !isLoading }) }, (0,external_React_.createElement)("p", null, isLoading ? (0,external_wp_i18n_namespaceObject.__)('Loading…') : (0,external_wp_i18n_namespaceObject.__)('No results')))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/info.js /** * WordPress dependencies */ const info = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z" })); /* harmony default export */ const library_info = (info); ;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/view-list.js /** * External dependencies */ /** * WordPress dependencies */ function ViewList({ view, fields, data, isLoading, getItemId, onSelectionChange, onDetailsChange, selection, deferredRendering }) { const shownData = (0,external_wp_compose_namespaceObject.useAsyncList)(data, { step: 3 }); const usedData = deferredRendering ? shownData : data; 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 onEnter = item => event => { const { keyCode } = event; if ([external_wp_keycodes_namespaceObject.ENTER, external_wp_keycodes_namespaceObject.SPACE].includes(keyCode)) { onSelectionChange([item]); } }; const hasData = usedData?.length; if (!hasData) { return (0,external_React_.createElement)("div", { className: classnames_default()({ 'dataviews-loading': isLoading, 'dataviews-no-results': !hasData && !isLoading }) }, !hasData && (0,external_React_.createElement)("p", null, isLoading ? (0,external_wp_i18n_namespaceObject.__)('Loading…') : (0,external_wp_i18n_namespaceObject.__)('No results'))); } return (0,external_React_.createElement)("ul", { className: "dataviews-view-list" }, usedData.map(item => { return (0,external_React_.createElement)("li", { key: getItemId(item), className: classnames_default()({ 'is-selected': selection.includes(item.id) }) }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { className: "dataviews-view-list__item-wrapper" }, (0,external_React_.createElement)("div", { role: "button", tabIndex: 0, "aria-pressed": selection.includes(item.id), onKeyDown: onEnter(item), className: "dataviews-view-list__item", onClick: () => onSelectionChange([item]) }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 3, justify: "start", alignment: "flex-start" }, (0,external_React_.createElement)("div", { className: "dataviews-view-list__media-wrapper" }, mediaField?.render({ item }) || (0,external_React_.createElement)("div", { className: "dataviews-view-list__media-placeholder" })), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1 }, (0,external_React_.createElement)("span", { className: "dataviews-view-list__primary-field" }, primaryField?.render({ item })), (0,external_React_.createElement)("div", { className: "dataviews-view-list__fields" }, visibleFields.map(field => { return (0,external_React_.createElement)("span", { key: field.id, className: "dataviews-view-list__field" }, field.render({ item })); }))))), onDetailsChange && (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { className: "dataviews-view-list__details-button", onClick: () => onDetailsChange([item]), icon: library_info, label: (0,external_wp_i18n_namespaceObject.__)('View details'), size: "compact" }))); })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/dataviews/build-module/constants.js /** * WordPress dependencies */ /** * Internal dependencies */ // Field types. const constants_ENUMERATION_TYPE = 'enumeration'; // Filter operators. const constants_OPERATOR_IN = 'in'; const constants_OPERATOR_NOT_IN = 'notIn'; const OPERATORS = { [constants_OPERATOR_IN]: { key: 'in-filter', label: (0,external_wp_i18n_namespaceObject.__)('Is') }, [constants_OPERATOR_NOT_IN]: { key: 'not-in-filter', label: (0,external_wp_i18n_namespaceObject.__)('Is not') } }; // Sorting const SORTING_DIRECTIONS = { asc: { label: (0,external_wp_i18n_namespaceObject.__)('Sort ascending') }, desc: { label: (0,external_wp_i18n_namespaceObject.__)('Sort descending') } }; // View layouts. const constants_LAYOUT_TABLE = 'table'; const constants_LAYOUT_GRID = 'grid'; const constants_LAYOUT_LIST = 'list'; 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/edit-site/build-module/components/sidebar-dataviews/dataview-item.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: dataview_item_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function DataViewItem({ title, slug, customViewId, type, icon, isActive, isCustom, suffix }) { const { params: { path, layout } } = dataview_item_useLocation(); const iconToUse = icon || VIEW_LAYOUTS.find(v => v.type === type).icon; const linkInfo = useLink({ path, layout, activeView: isCustom === 'true' ? customViewId : slug, isCustom }); return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", className: classnames_default()('edit-site-sidebar-dataviews-dataview-item', { 'is-selected': isActive }) }, (0,external_React_.createElement)(SidebarNavigationItem, { icon: iconToUse, ...linkInfo, "aria-current": isActive ? 'true' : undefined }, 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 (0,external_React_.createElement)(DataViewItem, { key: text, slug: text, title: text, icon: icon, isActive: isActive, isCustom: "false" }); } function DataviewsTemplatesSidebarContent({ activeView, postType, title }) { const { records } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', postType, { 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 (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_React_.createElement)(DataViewItem, { slug: 'all', title: title, icon: library_layout, isActive: activeView === 'all', isCustom: "false" }), firstItemPerAuthorText.map(template => { return (0,external_React_.createElement)(TemplateDataviewItem, { key: template.author_text, template: template, isActive: activeView === 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 config = { [constants_TEMPLATE_POST_TYPE]: { title: (0,external_wp_i18n_namespaceObject.__)('Manage templates'), description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'), contentTitle: (0,external_wp_i18n_namespaceObject.__)('All templates') }, [TEMPLATE_PART_POST_TYPE]: { title: (0,external_wp_i18n_namespaceObject.__)('Manage template parts'), description: (0,external_wp_i18n_namespaceObject.__)('Create new template parts, or reset any customizations made to the template parts supplied by your theme.'), backPath: '/patterns', contentTitle: (0,external_wp_i18n_namespaceObject.__)('All template parts') } }; const { useLocation: sidebar_navigation_screen_templates_browse_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function SidebarNavigationScreenTemplatesBrowse() { const { params: { postType } } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { params: { didAccessPatternsPage, activeView = 'all' } } = sidebar_navigation_screen_templates_browse_useLocation(); const isTemplatePartsMode = (0,external_wp_data_namespaceObject.useSelect)(select => { return !!select(store_store).getSettings().supportsTemplatePartsMode; }, []); return (0,external_React_.createElement)(SidebarNavigationScreen // If a classic theme that supports template parts has never // accessed the Patterns page, return to the dashboard. , { isRoot: isTemplatePartsMode && !didAccessPatternsPage, title: config[postType].title, description: config[postType].description, backPath: config[postType].backPath, content: (0,external_React_.createElement)(DataviewsTemplatesSidebarContent, { activeView: activeView, postType: postType, title: config[postType].contentTitle }) }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function SaveButton({ className = 'edit-site-save-button__button', variant = 'primary', showTooltip = true, defaultLabel, icon, __next40pxDefaultSize = false }) { const { isDirty, isSaving, isSaveViewOpen, previewingThemeName } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord, isResolving } = select(external_wp_coreData_namespaceObject.store); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const { isSaveViewOpened } = select(store_store); const isActivatingTheme = isResolving('activateTheme'); const currentlyPreviewingThemeId = currentlyPreviewingTheme(); return { isDirty: dirtyEntityRecords.length > 0, 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 }; }, []); const { setIsSaveViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const activateSaveEnabled = isPreviewingTheme() || isDirty; const disabled = isSaving || !activateSaveEnabled; 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 (isDirty) { 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'); } else if (disabled) { return (0,external_wp_i18n_namespaceObject.__)('Saved'); } else if (defaultLabel) { return defaultLabel; } return (0,external_wp_i18n_namespaceObject.__)('Save'); }; const label = getLabel(); return (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: variant, className: className, "aria-disabled": disabled, "aria-expanded": isSaveViewOpen, isBusy: isSaving, onClick: disabled ? undefined : () => setIsSaveViewOpened(true), 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: "compact" }, label); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: save_hub_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const PUBLISH_ON_SAVE_ENTITIES = [{ kind: 'postType', name: NAVIGATION_POST_TYPE }]; function SaveHub() { const saveNoticeId = 'site-edit-save-notice'; const { params } = save_hub_useLocation(); const { __unstableMarkLastChangeAsPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { createSuccessNotice, createErrorNotice, removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = select(external_wp_coreData_namespaceObject.store); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); let calcDirtyCurrentEntity = null; if (dirtyEntityRecords.length === 1) { // if we are on global styles if (params.path?.includes('wp_global_styles')) { calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === 'globalStyles'); } // if we are on pages else if (params.postId) { calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === params.postType && String(record.key) === params.postId); } } return { dirtyCurrentEntity: calcDirtyCurrentEntity, isDirty: dirtyEntityRecords.length > 0, isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)), countUnsavedChanges: dirtyEntityRecords.length }; }, [params.path, params.postType, params.postId]); const { editEntityRecord, saveEditedEntityRecord, __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const disabled = isSaving || !isDirty && !isPreviewingTheme(); // if we have only one unsaved change and it matches current context, we can show a more specific label let label = dirtyCurrentEntity ? (0,external_wp_i18n_namespaceObject.__)('Save') : (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…', countUnsavedChanges), countUnsavedChanges); if (isSaving) { label = (0,external_wp_i18n_namespaceObject.__)('Saving'); } const { homeUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getUnstableBase // Site index. } = select(external_wp_coreData_namespaceObject.store); return { homeUrl: getUnstableBase()?.home }; }, []); const saveCurrentEntity = async () => { if (!dirtyCurrentEntity) return; removeNotice(saveNoticeId); const { kind, name, key, property } = dirtyCurrentEntity; try { if ('root' === dirtyCurrentEntity.kind && 'site' === name) { await saveSpecifiedEntityEdits('root', 'site', undefined, [property]); } else { if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) { editEntityRecord(kind, name, key, { status: 'publish' }); } await saveEditedEntityRecord(kind, name, key); } __unstableMarkLastChangeAsPersistent(); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Site updated.'), { type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('View site'), url: homeUrl }], id: saveNoticeId }); } catch (error) { createErrorNotice(`${(0,external_wp_i18n_namespaceObject.__)('Saving failed.')} ${error}`); } }; return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { className: "edit-site-save-hub", alignment: "right", spacing: 4 }, dirtyCurrentEntity ? (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: saveCurrentEntity, isBusy: isSaving, disabled: isSaving, "aria-disabled": isSaving, className: "edit-site-save-hub__button", __next40pxDefaultSize: true }, label) : (0,external_React_.createElement)(SaveButton, { className: "edit-site-save-hub__button", variant: disabled ? null : 'primary', showTooltip: false, icon: disabled && !isSaving ? library_check : null, defaultLabel: label, __next40pxDefaultSize: true })); } ;// 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); async function createPage(event) { event.preventDefault(); if (isCreatingPage) { return; } setIsCreatingPage(true); try { const newPage = await saveEntityRecord('postType', 'page', { status: 'draft', title, slug: title || (0,external_wp_i18n_namespaceObject.__)('No title') }, { 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.'), 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 (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Draft a new page'), onRequestClose: onClose }, (0,external_React_.createElement)("form", { onSubmit: createPage }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3 }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { label: (0,external_wp_i18n_namespaceObject.__)('Page title'), onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), value: title }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, justify: "end" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: onClose }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", isBusy: isCreatingPage, "aria-disabled": isCreatingPage }, (0,external_wp_i18n_namespaceObject.__)('Create draft')))))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pages/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useHistory: sidebar_navigation_screen_pages_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); const PageItem = ({ postType = 'page', postId, ...props }) => { const linkInfo = useLink({ postType, postId }, { backPath: '/page' }); return (0,external_React_.createElement)(SidebarNavigationItem, { ...linkInfo, ...props }); }; function SidebarNavigationScreenPages() { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { records: pages, isResolving: isLoadingPages } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { status: 'any', per_page: -1 }); const { records: templates, isResolving: isLoadingTemplates } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', constants_TEMPLATE_POST_TYPE, { per_page: -1 }); const dynamicPageTemplates = templates?.filter(({ slug }) => ['404', 'search'].includes(slug)); const homeTemplate = templates?.find(template => template.slug === 'front-page') || templates?.find(template => template.slug === 'home') || templates?.find(template => template.slug === 'index'); const getPostsPageTemplate = () => templates?.find(template => template.slug === 'home') || templates?.find(template => template.slug === 'index'); const pagesAndTemplates = pages?.concat(dynamicPageTemplates, [homeTemplate]); const { frontPage, postsPage } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEntityRecord('root', 'site'); return { frontPage: siteSettings?.page_on_front, postsPage: siteSettings?.page_for_posts }; }, []); const isHomePageBlog = frontPage === postsPage; const reorderedPages = pages && [...pages]; if (!isHomePageBlog && reorderedPages?.length) { const homePageIndex = reorderedPages.findIndex(item => item.id === frontPage); const homePage = reorderedPages.splice(homePageIndex, 1); reorderedPages?.splice(0, 0, ...homePage); const postsPageIndex = reorderedPages.findIndex(item => item.id === postsPage); const blogPage = reorderedPages.splice(postsPageIndex, 1); reorderedPages.splice(1, 0, ...blogPage); } const [showAddPage, setShowAddPage] = (0,external_wp_element_namespaceObject.useState)(false); const history = sidebar_navigation_screen_pages_useHistory(); const handleNewPage = ({ type, id }) => { // Navigate to the created template editor. history.push({ postId: id, postType: type, canvas: 'edit' }); setShowAddPage(false); }; const getPageProps = id => { let itemIcon = library_page; const postsPageTemplateId = postsPage && postsPage === id ? getPostsPageTemplate()?.id : null; switch (id) { case frontPage: itemIcon = library_home; break; case postsPage: itemIcon = library_verse; break; } return { icon: itemIcon, postType: postsPageTemplateId ? constants_TEMPLATE_POST_TYPE : 'page', postId: postsPageTemplateId || id }; }; const pagesLink = useLink({ path: '/pages' }); return (0,external_React_.createElement)(external_React_.Fragment, null, showAddPage && (0,external_React_.createElement)(AddNewPageModal, { onSave: handleNewPage, onClose: () => setShowAddPage(false) }), (0,external_React_.createElement)(SidebarNavigationScreen, { title: (0,external_wp_i18n_namespaceObject.__)('Pages'), description: (0,external_wp_i18n_namespaceObject.__)('Browse and manage pages.'), actions: (0,external_React_.createElement)(SidebarButton, { icon: library_plus, label: (0,external_wp_i18n_namespaceObject.__)('Draft a new page'), onClick: () => setShowAddPage(true) }), content: (0,external_React_.createElement)(external_React_.Fragment, null, (isLoadingPages || isLoadingTemplates) && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('Loading pages…'))), !(isLoadingPages || isLoadingTemplates) && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, !pagesAndTemplates?.length && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItem, null, (0,external_wp_i18n_namespaceObject.__)('No page found')), isHomePageBlog && homeTemplate && (0,external_React_.createElement)(PageItem, { postType: constants_TEMPLATE_POST_TYPE, postId: homeTemplate.id, key: homeTemplate.id, icon: library_home, withChevron: true }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(homeTemplate.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)')))), reorderedPages?.map(({ id, title }) => (0,external_React_.createElement)(PageItem, { ...getPageProps(id), key: id, withChevron: true }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)'))))))), footer: (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0 }, dynamicPageTemplates?.map(item => (0,external_React_.createElement)(PageItem, { postType: constants_TEMPLATE_POST_TYPE, postId: item.id, key: item.id, icon: library_layout, withChevron: true }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1 }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)'))))), !isMobileViewport && (0,external_React_.createElement)(SidebarNavigationItem, { className: "edit-site-sidebar-navigation-screen-pages__see-all", ...pagesLink }, (0,external_wp_i18n_namespaceObject.__)('Manage all pages'))) })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js /** * WordPress dependencies */ const pages = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }), (0,external_React_.createElement)(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" }), (0,external_React_.createElement)(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/drafts.js /** * WordPress dependencies */ const drafts = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M8 2H6a2 2 0 0 0-2 2v2.4h1.5V4a.5.5 0 0 1 .5-.5h2V2ZM4 13.6V16a2 2 0 0 0 2 2h2v-1.5H6a.5.5 0 0 1-.5-.5v-2.4H4Zm0-1.2h1.5V7.6H4v4.8ZM9 2v1.5h4V2H9Zm5 0v1.5h2a.5.5 0 0 1 .5.5v2.4H18V4a2 2 0 0 0-2-2h-2Zm4 5.6h-1.5v4.8H18V7.6Zm0 6h-1.5V16a.5.5 0 0 1-.5.5h-2V18h2a2 2 0 0 0 2-2v-2.4ZM13 18v-1.5H9V18h4ZM7 7.25h8v-1.5H7v1.5Zm0 3.25h6V9H7v1.5ZM21.75 19V6h-1.5v13c0 .69-.56 1.25-1.25 1.25H8v1.5h11A2.75 2.75 0 0 0 21.75 19Z" })); /* harmony default export */ const library_drafts = (drafts); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/trash.js /** * WordPress dependencies */ const trash = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/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_TABLE, 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_TABLE] } }; 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.__)('Drafts'), slug: 'drafts', icon: library_drafts, view: { ...DEFAULT_PAGE_BASE, filters: [{ field: 'status', operator: OPERATOR_IN, value: 'draft' }] } }, { title: (0,external_wp_i18n_namespaceObject.__)('Trash'), slug: 'trash', icon: library_trash, view: { ...DEFAULT_PAGE_BASE, filters: [{ field: 'status', operator: OPERATOR_IN, value: 'trash' }] } }] }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/add-new-view.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useHistory: add_new_view_useHistory, useLocation: add_new_view_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function AddNewItemModalContent({ type, setIsAdding }) { const { params: { path } } = add_new_view_useLocation(); const history = add_new_view_useHistory(); 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); return (0,external_React_.createElement)("form", { onSubmit: async event => { event.preventDefault(); setIsSaving(true); const { getEntityRecords } = (0,external_wp_data_namespaceObject.resolveSelect)(external_wp_coreData_namespaceObject.store); let dataViewTaxonomyId; const dataViewTypeRecords = await getEntityRecords('taxonomy', 'wp_dataviews_type', { slug: type }); if (dataViewTypeRecords && dataViewTypeRecords.length > 0) { dataViewTaxonomyId = dataViewTypeRecords[0].id; } else { const record = await saveEntityRecord('taxonomy', 'wp_dataviews_type', { name: type }); if (record && record.id) { dataViewTaxonomyId = record.id; } } const savedRecord = await saveEntityRecord('postType', 'wp_dataviews', { title, status: 'publish', wp_dataviews_type: dataViewTaxonomyId, content: JSON.stringify(DEFAULT_VIEWS[type][0].view) }); history.push({ path, activeView: savedRecord.id, isCustom: 'true' }); setIsSaving(false); setIsAdding(false); } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('My view'), className: "patterns-create-modal__name-input" }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => { setIsAdding(false); } }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", "aria-disabled": !title || isSaving, isBusy: isSaving }, (0,external_wp_i18n_namespaceObject.__)('Create'))))); } function AddNewItem({ type }) { const [isAdding, setIsAdding] = (0,external_wp_element_namespaceObject.useState)(false); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(SidebarNavigationItem, { icon: library_plus, onClick: () => { setIsAdding(true); }, className: "dataviews__siderbar-content-add-new-item" }, (0,external_wp_i18n_namespaceObject.__)('New view')), isAdding && (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Add new view'), onRequestClose: () => { setIsAdding(false); } }, (0,external_React_.createElement)(AddNewItemModalContent, { type: type, setIsAdding: setIsAdding }))); } ;// 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, useLocation: custom_dataviews_list_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const custom_dataviews_list_EMPTY_ARRAY = []; function RenameItemModalContent({ dataviewId, currentTitle, setIsRenaming }) { const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(currentTitle); return (0,external_React_.createElement)("form", { onSubmit: async event => { event.preventDefault(); await editEntityRecord('postType', 'wp_dataviews', dataviewId, { title }); setIsRenaming(false); } }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('My view'), className: "patterns-create-modal__name-input" }), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => { setIsRenaming(false); } }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", "aria-disabled": !title }, (0,external_wp_i18n_namespaceObject.__)('Rename'))))); } function CustomDataViewItem({ dataviewId, isActive }) { const { params: { path } } = custom_dataviews_list_useLocation(); const history = custom_dataviews_list_useHistory(); const { dataview } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); return { dataview: getEditedEntityRecord('postType', 'wp_dataviews', dataviewId) }; }, [dataviewId]); const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const type = (0,external_wp_element_namespaceObject.useMemo)(() => { const viewContent = JSON.parse(dataview.content); return viewContent.type; }, [dataview.content]); const [isRenaming, setIsRenaming] = (0,external_wp_element_namespaceObject.useState)(false); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(DataViewItem, { title: dataview.title, type: type, isActive: isActive, isCustom: "true", customViewId: dataviewId, suffix: (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), className: "edit-site-sidebar-dataviews-dataview-item__dropdown-menu", toggleProps: { style: { color: 'inherit' }, size: 'small' } }, ({ onClose }) => (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsRenaming(true); onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Rename')), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: async () => { await deleteEntityRecord('postType', 'wp_dataviews', dataview.id, { force: true }); if (isActive) { history.replace({ path }); } onClose(); }, isDestructive: true }, (0,external_wp_i18n_namespaceObject.__)('Delete')))) }), isRenaming && (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename view'), onRequestClose: () => { setIsRenaming(false); } }, (0,external_React_.createElement)(RenameItemModalContent, { dataviewId: dataviewId, setIsRenaming: setIsRenaming, currentTitle: dataview.title }))); } function useCustomDataViews(type) { const customDataViews = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const dataViewTypeRecords = getEntityRecords('taxonomy', 'wp_dataviews_type', { slug: type }); if (!dataViewTypeRecords || dataViewTypeRecords.length === 0) { return custom_dataviews_list_EMPTY_ARRAY; } const dataViews = getEntityRecords('postType', 'wp_dataviews', { wp_dataviews_type: dataViewTypeRecords[0].id, orderby: 'date', order: 'asc' }); if (!dataViews) { return custom_dataviews_list_EMPTY_ARRAY; } return dataViews; }); return customDataViews; } function CustomDataViewsList({ type, activeView, isCustom }) { const customDataViews = useCustomDataViews(type); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen-dataviews__group-header" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2 }, (0,external_wp_i18n_namespaceObject.__)('Custom Views'))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, customDataViews.map(customViewRecord => { return (0,external_React_.createElement)(CustomDataViewItem, { key: customViewRecord.id, dataviewId: customViewRecord.id, isActive: isCustom === 'true' && Number(activeView) === customViewRecord.id }); }), (0,external_React_.createElement)(AddNewItem, { type: type }))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-dataviews/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: sidebar_dataviews_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); const PATH_TO_TYPE = { '/pages': 'page' }; function DataViewsSidebarContent() { const { params: { path, activeView = 'all', isCustom = 'false' } } = sidebar_dataviews_useLocation(); if (!path || !PATH_TO_TYPE[path]) { return null; } const type = PATH_TO_TYPE[path]; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, DEFAULT_VIEWS[type].map(dataview => { return (0,external_React_.createElement)(DataViewItem, { key: dataview.slug, slug: dataview.slug, title: dataview.title, icon: dataview.icon, type: dataview.view.type, isActive: isCustom === 'false' && dataview.slug === activeView, isCustom: "false" }); })), window?.__experimentalAdminViews && (0,external_React_.createElement)(CustomDataViewsList, { activeView: activeView, type: type, isCustom: "true" })); } ;// CONCATENATED MODULE: external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// CONCATENATED MODULE: external ["wp","escapeHtml"] const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; ;// CONCATENATED MODULE: external ["wp","wordcount"] const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-page/status-label.js /** * External dependencies */ /** * WordPress dependencies */ function StatusLabel({ status, date, short }) { const relateToNow = (0,external_wp_date_namespaceObject.humanTimeDiff)(date); let statusLabel = status; switch (status) { case 'publish': statusLabel = date ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is the relative time when the post was published. */ (0,external_wp_i18n_namespaceObject.__)('Published '), relateToNow), { time: (0,external_React_.createElement)("time", { dateTime: date }) }) : (0,external_wp_i18n_namespaceObject.__)('Published'); break; case 'future': const formattedDate = (0,external_wp_date_namespaceObject.dateI18n)(short ? 'M j' : 'F j', (0,external_wp_date_namespaceObject.getDate)(date)); statusLabel = date ? (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is the formatted date and time on which the post is scheduled to be published. */ (0,external_wp_i18n_namespaceObject.__)('Scheduled: '), formattedDate), { time: (0,external_React_.createElement)("time", { dateTime: date }) }) : (0,external_wp_i18n_namespaceObject.__)('Scheduled'); break; case 'draft': statusLabel = (0,external_wp_i18n_namespaceObject.__)('Draft'); break; case 'pending': statusLabel = (0,external_wp_i18n_namespaceObject.__)('Pending'); break; case 'private': statusLabel = (0,external_wp_i18n_namespaceObject.__)('Private'); break; case 'protected': statusLabel = (0,external_wp_i18n_namespaceObject.__)('Password protected'); break; } return (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-sidebar-navigation-screen-page__status', { [`has-status has-${status}-status`]: !!status }) }, statusLabel); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-page/page-details.js /** * WordPress dependencies */ /** * Internal dependencies */ // Taken from packages/editor/src/components/time-to-read/index.js. const AVERAGE_READING_RATE = 189; function getPageDetails(page) { if (!page) { return []; } const details = [{ label: (0,external_wp_i18n_namespaceObject.__)('Status'), value: (0,external_React_.createElement)(StatusLabel, { status: page?.password ? 'protected' : page.status, date: page?.date, short: true }) }, { label: (0,external_wp_i18n_namespaceObject.__)('Slug'), value: (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1 }, (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(page.slug || page.generated_slug)) }]; if (page?.templateTitle) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Template'), value: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.templateTitle) }); } if (page?.parentTitle) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Parent'), value: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.parentTitle || (0,external_wp_i18n_namespaceObject.__)('(no title)')) }); } /* * translators: If your word count is based on single characters (e.g. East Asian characters), * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. * Do not translate into your own language. */ const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); const wordsCounted = page?.content?.rendered ? (0,external_wp_wordcount_namespaceObject.count)(page.content.rendered, wordCountType) : 0; const readingTime = Math.round(wordsCounted / AVERAGE_READING_RATE); if (wordsCounted && !page?.isPostsPage) { details.push({ label: (0,external_wp_i18n_namespaceObject.__)('Words'), value: wordsCounted.toLocaleString() || (0,external_wp_i18n_namespaceObject.__)('Unknown') }, { label: (0,external_wp_i18n_namespaceObject.__)('Time to read'), value: readingTime > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is the number of minutes. */ (0,external_wp_i18n_namespaceObject.__)('%s mins'), readingTime.toLocaleString()) : (0,external_wp_i18n_namespaceObject.__)('< 1 min') }); } return details; } function PageDetails({ id }) { const { record } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'page', id); const { parentTitle, templateTitle, isPostsPage } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostId } = unlock(select(store_store)); const template = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', constants_TEMPLATE_POST_TYPE, getEditedPostId()); const _templateTitle = template?.title?.rendered; // Parent page title. const _parentTitle = record?.parent ? select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'page', record.parent, { _fields: ['title'] })?.title?.rendered : null; const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteSettings = getEntityRecord('root', 'site'); return { parentTitle: _parentTitle, templateTitle: _templateTitle, isPostsPage: record?.id === siteSettings?.page_for_posts }; }, [record?.parent, record?.id]); return (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanel, { spacing: 5, title: (0,external_wp_i18n_namespaceObject.__)('Details') }, getPageDetails({ parentTitle, templateTitle, isPostsPage, ...record }).map(({ label, value }) => (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelRow, { key: label }, (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelLabel, null, label), (0,external_React_.createElement)(SidebarNavigationScreenDetailsPanelValue, null, value)))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-actions/trash-page-menu-item.js /** * WordPress dependencies */ function TrashPageMenuItem({ postId, onRemove }) { const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const page = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'page', postId), [postId]); async function removePage() { try { await deleteEntityRecord('postType', 'page', postId, {}, { throwOnError: true }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The page's title. */ (0,external_wp_i18n_namespaceObject.__)('"%s" moved to the Trash.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered)), { type: 'snackbar', id: 'edit-site-page-trashed' }); onRemove?.(); } catch (error) { const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the page to the trash.'); createErrorNotice(errorMessage, { type: 'snackbar' }); } } return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => removePage(), isDestructive: true, variant: "secondary" }, (0,external_wp_i18n_namespaceObject.__)('Move to Trash'))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-actions/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PageActions({ postId, toggleProps, onRemove }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Actions'), toggleProps: toggleProps }, () => (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(TrashPageMenuItem, { postId: postId, onRemove: onRemove }))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-page/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useHistory: sidebar_navigation_screen_page_useHistory } = unlock(external_wp_router_namespaceObject.privateApis); function SidebarNavigationScreenPage({ backPath }) { const { setCanvasMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const history = sidebar_navigation_screen_page_useHistory(); const { params: { postId }, goTo } = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)(); const { record, hasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'page', postId); const { featuredMediaAltText, featuredMediaSourceUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); // Featured image. const attachedMedia = record?.featured_media ? getEntityRecord('postType', 'attachment', record?.featured_media) : null; return { featuredMediaSourceUrl: attachedMedia?.media_details.sizes?.medium?.source_url || attachedMedia?.source_url, featuredMediaAltText: (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(attachedMedia?.alt_text || attachedMedia?.description?.raw || '') }; }, [record]); // Redirect to the main pages navigation screen if the page is not found or has been deleted. (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasResolved && !record) { history.push({ path: '/page', postId: undefined, postType: undefined, canvas: 'view' }); } }, [hasResolved, history]); const featureImageAltText = featuredMediaAltText ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(featuredMediaAltText) : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(record?.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('Featured image')); return record ? (0,external_React_.createElement)(SidebarNavigationScreen, { backPath: backPath, title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(record?.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('(no title)')), actions: (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(PageActions, { postId: postId, toggleProps: { as: SidebarButton }, onRemove: () => { goTo('/page'); } }), (0,external_React_.createElement)(SidebarButton, { onClick: () => setCanvasMode('edit'), label: (0,external_wp_i18n_namespaceObject.__)('Edit'), icon: library_pencil })), meta: (0,external_React_.createElement)(external_wp_components_namespaceObject.ExternalLink, { className: "edit-site-sidebar-navigation-screen__page-link", href: record.link }, (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURIComponent)(record.link))), content: (0,external_React_.createElement)(external_React_.Fragment, null, !!featuredMediaSourceUrl && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalVStack, { className: "edit-site-sidebar-navigation-screen-page__featured-image-wrapper", alignment: "left", spacing: 2 }, (0,external_React_.createElement)("div", { className: "edit-site-sidebar-navigation-screen-page__featured-image has-image" }, (0,external_React_.createElement)("img", { alt: featureImageAltText, src: featuredMediaSourceUrl }))), !!record?.excerpt?.rendered && (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, { className: "edit-site-sidebar-navigation-screen-page__excerpt", numberOfLines: 3 }, (0,external_wp_dom_namespaceObject.__unstableStripHTML)(record.excerpt.rendered)), (0,external_React_.createElement)(PageDetails, { id: postId })), footer: record?.modified ? (0,external_React_.createElement)(SidebarNavigationScreenDetailsFooter, { record: record }) : null }) : null; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useLocation: sidebar_useLocation } = unlock(external_wp_router_namespaceObject.privateApis); function SidebarScreenWrapper({ className, ...props }) { return (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { className: classnames_default()('edit-site-sidebar__screen-wrapper', className), ...props }); } function SidebarScreens() { useSyncPathWithURL(); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/" }, (0,external_React_.createElement)(SidebarNavigationScreenMain, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/navigation" }, (0,external_React_.createElement)(SidebarNavigationScreenNavigationMenus, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/navigation/:postType/:postId" }, (0,external_React_.createElement)(SidebarNavigationScreenNavigationMenu, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/wp_global_styles" }, (0,external_React_.createElement)(SidebarNavigationScreenGlobalStyles, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/page" }, (0,external_React_.createElement)(SidebarNavigationScreenPages, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/pages" }, (0,external_React_.createElement)(SidebarNavigationScreen, { title: (0,external_wp_i18n_namespaceObject.__)('Manage pages'), content: (0,external_React_.createElement)(DataViewsSidebarContent, null), backPath: "/page" })), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/page/:postId" }, (0,external_React_.createElement)(SidebarNavigationScreenPage, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/:postType(wp_template)" }, (0,external_React_.createElement)(SidebarNavigationScreenTemplates, null)), !isMobileViewport && (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/patterns" }, (0,external_React_.createElement)(SidebarNavigationScreenPatterns, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/:postType(wp_template|wp_template_part)/all" }, (0,external_React_.createElement)(SidebarNavigationScreenTemplatesBrowse, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/:postType(wp_template_part|wp_block)/:postId" }, (0,external_React_.createElement)(SidebarNavigationScreenPattern, null)), (0,external_React_.createElement)(SidebarScreenWrapper, { path: "/:postType(wp_template)/:postId" }, (0,external_React_.createElement)(SidebarNavigationScreenTemplate, null))); } function Sidebar() { const { params: urlParams } = sidebar_useLocation(); const initialPath = (0,external_wp_element_namespaceObject.useRef)(getPathFromURL(urlParams)); return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorProvider, { className: "edit-site-sidebar__content", initialPath: initialPath.current }, (0,external_React_.createElement)(SidebarScreens, null)), (0,external_React_.createElement)(SaveHub, null)); } /* harmony default export */ const sidebar = ((0,external_wp_element_namespaceObject.memo)(Sidebar)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/warning.js /** * WordPress dependencies */ function CopyButton({ text, children }) { const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); return (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { variant: "secondary", ref: ref }, children); } function ErrorBoundaryWarning({ message, error }) { const actions = [(0,external_React_.createElement)(CopyButton, { key: "copy-error", text: error.stack }, (0,external_wp_i18n_namespaceObject.__)('Copy Error'))]; return (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.Warning, { className: "editor-error-boundary", actions: actions }, message); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/error-boundary/index.js /** * WordPress dependencies */ /** * Internal dependencies */ class ErrorBoundary extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.state = { error: null }; } componentDidCatch(error) { (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error); } static getDerivedStateFromError(error) { return { error }; } render() { if (!this.state.error) { return this.props.children; } return (0,external_React_.createElement)(ErrorBoundaryWarning, { message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'), error: this.state.error }); } } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js /** * WordPress dependencies */ const next = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/icons/build-module/library/previous.js /** * WordPress dependencies */ const previous = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/external.js /** * WordPress dependencies */ const external = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(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/components/keyboard-shortcut-help-modal/config.js /** * WordPress dependencies */ const textFormattingShortcuts = [{ keyCombination: { modifier: 'primary', character: 'b' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.') }, { keyCombination: { modifier: 'primary', character: 'i' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.') }, { keyCombination: { modifier: 'primary', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.') }, { keyCombination: { modifier: 'primaryShift', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') }, { keyCombination: { character: '[[' }, description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') }, { keyCombination: { modifier: 'primary', character: 'u' }, description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') }, { keyCombination: { modifier: 'access', character: 'd' }, description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') }, { keyCombination: { modifier: 'access', character: 'x' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') }, { keyCombination: { modifier: 'access', character: '0' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') }, { keyCombination: { modifier: 'access', character: '1-6' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') }]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/shortcut.js /** * WordPress dependencies */ function KeyCombination({ keyCombination, forceAriaLabel }) { const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; return (0,external_React_.createElement)("kbd", { className: "edit-site-keyboard-shortcut-help-modal__shortcut-key-combination", "aria-label": forceAriaLabel || ariaLabel }, (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => { if (character === '+') { return (0,external_React_.createElement)(external_wp_element_namespaceObject.Fragment, { key: index }, character); } return (0,external_React_.createElement)("kbd", { key: index, className: "edit-site-keyboard-shortcut-help-modal__shortcut-key" }, character); })); } function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { return (0,external_React_.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_React_.createElement)("div", { className: "edit-site-keyboard-shortcut-help-modal__shortcut-description" }, description), (0,external_React_.createElement)("div", { className: "edit-site-keyboard-shortcut-help-modal__shortcut-term" }, (0,external_React_.createElement)(KeyCombination, { keyCombination: keyCombination, forceAriaLabel: ariaLabel }), aliases.map((alias, index) => (0,external_React_.createElement)(KeyCombination, { keyCombination: alias, forceAriaLabel: ariaLabel, key: index })))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js /** * WordPress dependencies */ /** * Internal dependencies */ function DynamicShortcut({ name }) { const { keyCombination, description, aliases } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getShortcutKeyCombination, getShortcutDescription, getShortcutAliases } = select(external_wp_keyboardShortcuts_namespaceObject.store); return { keyCombination: getShortcutKeyCombination(name), aliases: getShortcutAliases(name), description: getShortcutDescription(name) }; }, [name]); if (!keyCombination) { return null; } return (0,external_React_.createElement)(Shortcut, { keyCombination: keyCombination, description: description, aliases: aliases }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/keyboard-shortcut-help-modal/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'edit-site/keyboard-shortcut-help'; const ShortcutList = ({ shortcuts }) => /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ (0,external_React_.createElement)("ul", { className: "edit-site-keyboard-shortcut-help-modal__shortcut-list", role: "list" }, shortcuts.map((shortcut, index) => (0,external_React_.createElement)("li", { className: "edit-site-keyboard-shortcut-help-modal__shortcut", key: index }, typeof shortcut === 'string' ? (0,external_React_.createElement)(DynamicShortcut, { name: shortcut }) : (0,external_React_.createElement)(Shortcut, { ...shortcut })))) /* eslint-enable jsx-a11y/no-redundant-roles */; const ShortcutSection = ({ title, shortcuts, className }) => (0,external_React_.createElement)("section", { className: classnames_default()('edit-site-keyboard-shortcut-help-modal__section', className) }, !!title && (0,external_React_.createElement)("h2", { className: "edit-site-keyboard-shortcut-help-modal__section-title" }, title), (0,external_React_.createElement)(ShortcutList, { shortcuts: shortcuts })); const ShortcutCategorySection = ({ title, categoryName, additionalShortcuts = [] }) => { const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); }, [categoryName]); return (0,external_React_.createElement)(ShortcutSection, { title: title, shortcuts: categoryShortcuts.concat(additionalShortcuts) }); }; function KeyboardShortcutHelpModal() { const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(KEYBOARD_SHORTCUT_HELP_MODAL_NAME)); const { closeModal, openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const toggleModal = () => isModalActive ? closeModal() : openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-site/keyboard-shortcuts', toggleModal); if (!isModalActive) { return null; } return (0,external_React_.createElement)(external_wp_components_namespaceObject.Modal, { className: "edit-site-keyboard-shortcut-help-modal", title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), onRequestClose: toggleModal }, (0,external_React_.createElement)(ShortcutSection, { className: "edit-site-keyboard-shortcut-help-modal__main-shortcuts", shortcuts: ['core/edit-site/keyboard-shortcuts'] }), (0,external_React_.createElement)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), categoryName: "global" }), (0,external_React_.createElement)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), categoryName: "selection" }), (0,external_React_.createElement)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), categoryName: "block", additionalShortcuts: [{ keyCombination: { character: '/' }, description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), /* translators: The forward-slash character. e.g. '/'. */ ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') }] }), (0,external_React_.createElement)(ShortcutSection, { title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), shortcuts: textFormattingShortcuts })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/preferences-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferencesModal } = unlock(external_wp_editor_namespaceObject.privateApis); const PREFERENCES_MODAL_NAME = 'edit-site/preferences'; function EditSitePreferencesModal() { const isModalActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(PREFERENCES_MODAL_NAME)); const { closeModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!isModalActive) { return null; } return (0,external_React_.createElement)(PreferencesModal, { isActive: isModalActive, onClose: closeModal }); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/tools-more-menu-group/index.js /** * WordPress dependencies */ const { Fill: ToolsMoreMenuGroup, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('EditSiteToolsMoreMenuGroup'); ToolsMoreMenuGroup.Slot = ({ fillProps }) => (0,external_React_.createElement)(Slot, { fillProps: fillProps }, fills => fills && fills.length > 0); /* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/download.js /** * WordPress dependencies */ const download = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" })); /* harmony default export */ const library_download = (download); ;// CONCATENATED MODULE: external ["wp","blob"] const external_wp_blob_namespaceObject = window["wp"]["blob"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/more-menu/site-export.js /** * WordPress dependencies */ function SiteExport() { const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); async function handleExport() { try { const response = await external_wp_apiFetch_default()({ path: '/wp-block-editor/v1/export', parse: false, headers: { Accept: 'application/zip' } }); const blob = await response.blob(); const contentDisposition = response.headers.get('content-disposition'); const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/); const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : 'edit-site-export'; (0,external_wp_blob_namespaceObject.downloadBlob)(fileName + '.zip', blob, 'application/zip'); } catch (errorResponse) { let error = {}; try { error = await errorResponse.json(); } catch (e) {} const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while creating the site export.'); createErrorNotice(errorMessage, { type: 'snackbar' }); } } return (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { role: "menuitem", icon: library_download, onClick: handleExport, info: (0,external_wp_i18n_namespaceObject.__)('Download your theme with updated templates and styles.') }, (0,external_wp_i18n_namespaceObject._x)('Export', 'site exporter menu item')); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js /** * WordPress dependencies */ function WelcomeGuideMenuItem() { const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); return (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => toggle('core/edit-site', 'welcomeGuide') }, (0,external_wp_i18n_namespaceObject.__)('Welcome Guide')); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function CopyContentMenuItem() { const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { getEditedPostId, getEditedPostType } = (0,external_wp_data_namespaceObject.useSelect)(store_store); const { getEditedEntityRecord } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store); function getText() { const record = getEditedEntityRecord('postType', getEditedPostType(), getEditedPostId()); if (!record) { return ''; } if (typeof record.content === 'function') { return record.content(record); } else if (record.blocks) { return (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(record.blocks); } else if (record.content) { return record.content; } } function onSuccess() { createNotice('info', (0,external_wp_i18n_namespaceObject.__)('All content copied.'), { isDismissible: true, type: 'snackbar' }); } const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(getText, onSuccess); return (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { ref: ref }, (0,external_wp_i18n_namespaceObject.__)('Copy all blocks')); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/mode-switcher/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Set of available mode options. * * @type {Array} */ const MODES = [{ value: 'visual', label: (0,external_wp_i18n_namespaceObject.__)('Visual editor') }, { value: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Code editor') }]; function ModeSwitcher() { const { shortcut, mode } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ shortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getShortcutRepresentation('core/edit-site/toggle-mode'), mode: select(store_store).getEditorMode() }), []); const { switchEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const choices = MODES.map(choice => { if (choice.value !== mode) { return { ...choice, shortcut }; } return choice; }); return (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Editor') }, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, { choices: choices, value: mode, onSelect: switchEditorMode })); } /* harmony default export */ const mode_switcher = (ModeSwitcher); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/more-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MoreMenu({ showIconLabels }) { const { openModal } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const isBlockBasedTheme = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getCurrentTheme().is_block_theme; }, []); const { toggleDistractionFree } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const turnOffDistractionFree = () => { setPreference('core', 'distractionFree', false); }; return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(MoreMenuDropdown, { toggleProps: { showTooltip: !showIconLabels, ...(showIconLabels && { variant: 'tertiary' }) } }, ({ onClose }) => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun') }, (0,external_React_.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "fixedToolbar", onToggle: turnOffDistractionFree, label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') }), (0,external_React_.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "distractionFree", label: (0,external_wp_i18n_namespaceObject.__)('Distraction free'), info: (0,external_wp_i18n_namespaceObject.__)('Write with calmness'), handleToggling: false, onToggle: toggleDistractionFree, messageActivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Distraction free mode deactivated'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('\\') }), (0,external_React_.createElement)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core", name: "focusMode", label: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode'), info: (0,external_wp_i18n_namespaceObject.__)('Focus on one block at a time'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Spotlight mode deactivated') })), (0,external_React_.createElement)(mode_switcher, null), (0,external_React_.createElement)(action_item.Slot, { name: "core/edit-site/plugin-more-menu", label: (0,external_wp_i18n_namespaceObject.__)('Plugins'), as: external_wp_components_namespaceObject.MenuGroup, fillProps: { onClick: onClose } }), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Tools') }, isBlockBasedTheme && (0,external_React_.createElement)(SiteExport, null), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h') }, (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts')), (0,external_React_.createElement)(WelcomeGuideMenuItem, null), (0,external_React_.createElement)(CopyContentMenuItem, null), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { icon: library_external, role: "menuitem", href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/site-editor/'), target: "_blank", rel: "noopener noreferrer" }, (0,external_wp_i18n_namespaceObject.__)('Help'), (0,external_React_.createElement)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span" }, /* translators: accessibility text */ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)'))), (0,external_React_.createElement)(tools_more_menu_group.Slot, { fillProps: { onClose } })), (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, { onClick: () => openModal(PREFERENCES_MODAL_NAME) }, (0,external_wp_i18n_namespaceObject.__)('Preferences'))))), (0,external_React_.createElement)(KeyboardShortcutHelpModal, null), (0,external_React_.createElement)(EditSitePreferencesModal, null)); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up-down.js /** * WordPress dependencies */ const chevronUpDown = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z" })); /* harmony default export */ const chevron_up_down = (chevronUpDown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/document-tools/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { DocumentTools: EditorDocumentTools } = unlock(external_wp_editor_namespaceObject.privateApis); function DocumentTools({ blockEditorMode, hasFixedToolbar, isDistractionFree }) { const { isVisualMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorMode } = select(store_store); return { isVisualMode: getEditorMode() === 'visual' }; }, []); const { __unstableSetEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { setDeviceType } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode; const isZoomedOutView = blockEditorMode === 'zoom-out'; return (0,external_React_.createElement)(EditorDocumentTools, { disableBlockTools: !isVisualMode, listViewLabel: (0,external_wp_i18n_namespaceObject.__)('List View') }, isZoomedOutViewExperimentEnabled && isLargeViewport && !isDistractionFree && !hasFixedToolbar && (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarItem, { as: external_wp_components_namespaceObject.Button, className: "edit-site-header-edit-mode__zoom-out-view-toggle", icon: chevron_up_down, isPressed: isZoomedOutView /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('Zoom-out View'), onClick: () => { setDeviceType('Desktop'); __unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out'); }, size: "compact" })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/header-edit-mode/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { PostViewLink, PreviewDropdown } = unlock(external_wp_editor_namespaceObject.privateApis); function HeaderEditMode() { const { templateType, isDistractionFree, blockEditorMode, blockSelectionStart, showIconLabels, editorCanvasView, hasFixedToolbar, isZoomOutMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostType } = select(store_store); const { getBlockSelectionStart, __unstableGetEditorMode } = select(external_wp_blockEditor_namespaceObject.store); const { get: getPreference } = select(external_wp_preferences_namespaceObject.store); const { getDeviceType } = select(external_wp_editor_namespaceObject.store); return { deviceType: getDeviceType(), templateType: getEditedPostType(), blockEditorMode: __unstableGetEditorMode(), blockSelectionStart: getBlockSelectionStart(), showIconLabels: getPreference('core', 'showIconLabels'), editorCanvasView: unlock(select(store_store)).getEditorCanvasContainerView(), hasFixedToolbar: getPreference('core', 'fixedToolbar'), isDistractionFree: getPreference('core', 'distractionFree'), isZoomOutMode: __unstableGetEditorMode() === 'zoom-out' }; }, []); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isTopToolbar = !isZoomOutMode && hasFixedToolbar && isLargeViewport; const blockToolbarRef = (0,external_wp_element_namespaceObject.useRef)(); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer(); const isFocusMode = FOCUSABLE_ENTITIES.includes(templateType); const isZoomedOutView = blockEditorMode === 'zoom-out'; const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true); const hasBlockSelected = !!blockSelectionStart; (0,external_wp_element_namespaceObject.useEffect)(() => { // If we have a new block selection, show the block tools if (blockSelectionStart) { setIsBlockToolsCollapsed(false); } }, [blockSelectionStart]); const toolbarVariants = { isDistractionFree: { y: '-50px' }, isDistractionFreeHovering: { y: 0 }, view: { y: 0 }, edit: { y: 0 } }; const toolbarTransition = { type: 'tween', duration: disableMotion ? 0 : 0.2, ease: 'easeOut' }; return (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-header-edit-mode', { 'show-icon-labels': showIconLabels }) }, hasDefaultEditorCanvasView && (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { className: "edit-site-header-edit-mode__start", variants: toolbarVariants, transition: toolbarTransition }, (0,external_React_.createElement)(DocumentTools, { blockEditorMode: blockEditorMode, isDistractionFree: isDistractionFree }), isTopToolbar && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("div", { className: classnames_default()('selected-block-tools-wrapper', { 'is-collapsed': isBlockToolsCollapsed || !hasBlockSelected }) }, (0,external_React_.createElement)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true })), (0,external_React_.createElement)(external_wp_components_namespaceObject.Popover.Slot, { ref: blockToolbarRef, name: "block-toolbar" }), hasBlockSelected && (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { className: "edit-site-header-edit-mode__block-tools-toggle", icon: isBlockToolsCollapsed ? library_next : library_previous, onClick: () => { setIsBlockToolsCollapsed(collapsed => !collapsed); }, label: isBlockToolsCollapsed ? (0,external_wp_i18n_namespaceObject.__)('Show block tools') : (0,external_wp_i18n_namespaceObject.__)('Hide block tools') }))), !isDistractionFree && (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-header-edit-mode__center', { 'is-collapsed': !isBlockToolsCollapsed && isLargeViewport }) }, !hasDefaultEditorCanvasView ? getEditorCanvasContainerTitle(editorCanvasView) : (0,external_React_.createElement)(external_wp_editor_namespaceObject.DocumentBar, null)), (0,external_React_.createElement)("div", { className: "edit-site-header-edit-mode__end" }, (0,external_React_.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, { className: "edit-site-header-edit-mode__actions", variants: toolbarVariants, transition: toolbarTransition }, isLargeViewport && (0,external_React_.createElement)("div", { className: classnames_default()('edit-site-header-edit-mode__preview-options', { 'is-zoomed-out': isZoomedOutView }) }, (0,external_React_.createElement)(PreviewDropdown, { disabled: isFocusMode || !hasDefaultEditorCanvasView })), (0,external_React_.createElement)(PostViewLink, null), (0,external_React_.createElement)(SaveButton, null), !isDistractionFree && (0,external_React_.createElement)(pinned_items.Slot, { scope: "core/edit-site" }), (0,external_React_.createElement)(MoreMenu, { showIconLabels: showIconLabels })))); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js /** * WordPress dependencies */ const wordpress = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24" }, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" })); /* harmony default export */ const library_wordpress = (wordpress); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-icon/index.js /** * External dependencies */ /** * WordPress dependencies */ function SiteIcon({ className }) { const { isRequestingSite, siteIconUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const siteData = getEntityRecord('root', '__unstableBase', undefined); return { isRequestingSite: !siteData, siteIconUrl: siteData?.site_icon_url }; }, []); if (isRequestingSite && !siteIconUrl) { return (0,external_React_.createElement)("div", { className: "edit-site-site-icon__image" }); } const icon = siteIconUrl ? (0,external_React_.createElement)("img", { className: "edit-site-site-icon__image", alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'), src: siteIconUrl }) : (0,external_React_.createElement)(external_wp_components_namespaceObject.Icon, { className: "edit-site-site-icon__icon", icon: library_wordpress, size: 48 }); return (0,external_React_.createElement)("div", { className: classnames_default()(className, 'edit-site-site-icon') }, icon); } /* harmony default export */ const site_icon = (SiteIcon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const HUB_ANIMATION_DURATION = 0.3; const SiteHub = (0,external_wp_element_namespaceObject.memo)(({ isTransparent, className }) => { const { canvasMode, dashboardLink, homeUrl, siteTitle } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCanvasMode, getSettings } = unlock(select(store_store)); const { getSite, getUnstableBase // Site index. } = select(external_wp_coreData_namespaceObject.store); return { canvasMode: getCanvasMode(), dashboardLink: getSettings().__experimentalDashboardLink || 'index.php', homeUrl: getUnstableBase()?.home, siteTitle: getSite()?.title }; }, []); const { open: openCommandCenter } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const { setCanvasMode } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); const { clearSelectedBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { setDeviceType } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const isBackToDashboardButton = canvasMode === 'view'; const siteIconButtonProps = isBackToDashboardButton ? { href: dashboardLink, label: (0,external_wp_i18n_namespaceObject.__)('Go to the Dashboard') } : { href: dashboardLink, // We need to keep the `href` here so the component doesn't remount as a `